changeset 3700:b5c649e4e700

Merge.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 24 Nov 2011 17:45:38 +0100
parents 67e92894d065 (current diff) 9b5611392eb9 (diff)
children 713131edb435
files src/share/vm/graal/graalVMEntries.cpp
diffstat 4 files changed, 23 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/graal/graalVMEntries.cpp	Thu Nov 24 17:45:19 2011 +0100
+++ b/src/share/vm/graal/graalVMEntries.cpp	Thu Nov 24 17:45:38 2011 +0100
@@ -676,6 +676,11 @@
   TRACE_graal_3("VMEntries::RiType_componentType");
   VM_ENTRY_MARK;
   KlassHandle array_klass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass));
+  if(array_klass->oop_is_typeArray()) {
+    BasicType t = typeArrayKlass::cast(array_klass())->element_type();
+    oop primitive_type = VMExits::createRiTypePrimitive((int) t, CHECK_NULL);
+    return JNIHandles::make_local(primitive_type);
+  }
   assert(array_klass->oop_is_objArray(), "just checking");
   klassOop element_type = objArrayKlass::cast(array_klass())->element_klass();
   assert(JNIHandles::resolve(klass) != NULL, "");
--- a/src/share/vm/runtime/sweeper.cpp	Thu Nov 24 17:45:19 2011 +0100
+++ b/src/share/vm/runtime/sweeper.cpp	Thu Nov 24 17:45:38 2011 +0100
@@ -310,10 +310,10 @@
 
 class NMethodMarker: public StackObj {
  private:
-  CompilerThread* _thread;
+  JavaThread* _thread;
  public:
   NMethodMarker(nmethod* nm) {
-    _thread = CompilerThread::current();
+    _thread = JavaThread::current();
     _thread->set_scanned_nmethod(nm);
   }
   ~NMethodMarker() {
--- a/src/share/vm/runtime/thread.cpp	Thu Nov 24 17:45:19 2011 +0100
+++ b/src/share/vm/runtime/thread.cpp	Thu Nov 24 17:45:38 2011 +0100
@@ -1292,6 +1292,7 @@
   _do_not_unlock_if_synchronized = false;
   _cached_monitor_info = NULL;
   _parker = Parker::Allocate(this) ;
+  _scanned_nmethod = NULL;
 
 #ifndef PRODUCT
   _jmp_ring_index = 0;
@@ -2558,6 +2559,13 @@
   if (jvmti_thread_state() != NULL) {
     jvmti_thread_state()->oops_do(f);
   }
+
+  if (_scanned_nmethod != NULL && cf != NULL) {
+      // Safepoints can occur when the sweeper is scanning an nmethod so
+      // process it here to make sure it isn't unloaded in the middle of
+      // a scan.
+      cf->do_code_blob(_scanned_nmethod);
+    }
 }
 
 void JavaThread::nmethods_do(CodeBlobClosure* cf) {
@@ -2948,23 +2956,12 @@
   _task  = NULL;
   _queue = queue;
   _counters = counters;
-  _scanned_nmethod = NULL;
 
 #ifndef PRODUCT
   _ideal_graph_printer = NULL;
 #endif
 }
 
-void CompilerThread::oops_do(OopClosure* f, CodeBlobClosure* cf) {
-  JavaThread::oops_do(f, cf);
-  if (_scanned_nmethod != NULL && cf != NULL) {
-    // Safepoints can occur when the sweeper is scanning an nmethod so
-    // process it here to make sure it isn't unloaded in the middle of
-    // a scan.
-    cf->do_code_blob(_scanned_nmethod);
-  }
-}
-
 // ======= Threads ========
 
 // The Threads class links together all active threads, and provides
--- a/src/share/vm/runtime/thread.hpp	Thu Nov 24 17:45:19 2011 +0100
+++ b/src/share/vm/runtime/thread.hpp	Thu Nov 24 17:45:38 2011 +0100
@@ -845,6 +845,8 @@
 
   StackGuardState        _stack_guard_state;
 
+  nmethod*      _scanned_nmethod;  // nmethod being scanned by the sweeper
+
   // Compiler exception handling (NOTE: The _exception_oop is *NOT* the same as _pending_exception. It is
   // used to temp. parsing values into and out of the runtime system during exception handling for compiled
   // code)
@@ -940,6 +942,12 @@
 
   void cleanup_failed_attach_current_thread();
 
+  // Track the nmethod currently being scanned by the sweeper
+  void          set_scanned_nmethod(nmethod* nm) {
+    assert(_scanned_nmethod == NULL || nm == NULL, "should reset to NULL before writing a new value");
+    _scanned_nmethod = nm;
+  }
+
   // Testers
   virtual bool is_Java_thread() const            { return true;  }
 
@@ -1714,7 +1722,6 @@
   CompileTask*  _task;
   CompileQueue* _queue;
 
-  nmethod*      _scanned_nmethod;  // nmethod being scanned by the sweeper
 
  public:
 
@@ -1738,11 +1745,6 @@
     _log = log;
   }
 
-  // GC support
-  // Apply "f->do_oop" to all root oops in "this".
-  // Apply "cf->do_code_blob" (if !NULL) to all code blobs active in frames
-  void oops_do(OopClosure* f, CodeBlobClosure* cf);
-
 #ifndef PRODUCT
 private:
   IdealGraphPrinter *_ideal_graph_printer;
@@ -1754,12 +1756,6 @@
   // Get/set the thread's current task
   CompileTask*  task()                           { return _task; }
   void          set_task(CompileTask* task)      { _task = task; }
-
-  // Track the nmethod currently being scanned by the sweeper
-  void          set_scanned_nmethod(nmethod* nm) {
-    assert(_scanned_nmethod == NULL || nm == NULL, "should reset to NULL before writing a new value");
-    _scanned_nmethod = nm;
-  }
 };
 
 inline CompilerThread* CompilerThread::current() {