< prev index next >

src/share/vm/runtime/handles.inline.hpp

Print this page
rev 7614 : [mq]: shark-build-hotspot.patch

@@ -49,10 +49,16 @@
     _handle = thread->handle_area()->allocate_handle(obj);
   }
 }
 #endif // ASSERT
 
+#ifndef SHARK
+#define CHECK_IN_STACK() assert (_thread->is_in_stack((address)this), "not on stack?")
+#else
+#define CHECK_IN_STACK()
+#endif
+
 // Constructors for metadata handles
 #define DEF_METADATA_HANDLE_FN(name, type) \
 inline name##Handle::name##Handle(type* obj) : _value(obj), _thread(NULL) {       \
   if (obj != NULL) {                                                   \
     assert(((Metadata*)obj)->is_valid(), "obj is valid");              \

@@ -77,11 +83,11 @@
       assert(h._thread == Thread::current(), "thread must be current");\
       _thread = h._thread;                                             \
     } else {                                                           \
       _thread = Thread::current();                                     \
     }                                                                  \
-    assert (_thread->is_in_stack((address)this), "not on stack?");     \
+    CHECK_IN_STACK();                                                  \
     _thread->metadata_handles()->push((Metadata*)_value);              \
   } else {                                                             \
     _thread = NULL;                                                    \
   }                                                                    \
 }                                                                      \

@@ -113,10 +119,12 @@
 inline name##Handle::~name##Handle () { remove(); }                    \
 
 DEF_METADATA_HANDLE_FN(method, Method)
 DEF_METADATA_HANDLE_FN(constantPool, ConstantPool)
 
+#undef CHECK_IN_STACK
+
 inline HandleMark::HandleMark() {
   initialize(Thread::current());
 }
 
 
< prev index next >