< prev index next >

src/hotspot/share/runtime/sharedRuntime.cpp

Print this page
rev 54572 : Checkpoint latest preliminary review patches for full OpenJDK review; merge with 8222295.patch.


  47 #include "memory/resourceArea.hpp"
  48 #include "memory/universe.hpp"
  49 #include "oops/klass.hpp"
  50 #include "oops/method.inline.hpp"
  51 #include "oops/objArrayKlass.hpp"
  52 #include "oops/oop.inline.hpp"
  53 #include "prims/forte.hpp"
  54 #include "prims/jvmtiExport.hpp"
  55 #include "prims/methodHandles.hpp"
  56 #include "prims/nativeLookup.hpp"
  57 #include "runtime/arguments.hpp"
  58 #include "runtime/atomic.hpp"
  59 #include "runtime/biasedLocking.hpp"
  60 #include "runtime/compilationPolicy.hpp"
  61 #include "runtime/frame.inline.hpp"
  62 #include "runtime/handles.inline.hpp"
  63 #include "runtime/init.hpp"
  64 #include "runtime/interfaceSupport.inline.hpp"
  65 #include "runtime/java.hpp"
  66 #include "runtime/javaCalls.hpp"

  67 #include "runtime/sharedRuntime.hpp"
  68 #include "runtime/stubRoutines.hpp"

  69 #include "runtime/vframe.inline.hpp"
  70 #include "runtime/vframeArray.hpp"
  71 #include "utilities/copy.hpp"
  72 #include "utilities/dtrace.hpp"
  73 #include "utilities/events.hpp"
  74 #include "utilities/hashtable.inline.hpp"
  75 #include "utilities/macros.hpp"
  76 #include "utilities/xmlstream.hpp"
  77 #ifdef COMPILER1
  78 #include "c1/c1_Runtime1.hpp"
  79 #endif
  80 
  81 // Shared stub locations
  82 RuntimeStub*        SharedRuntime::_wrong_method_blob;
  83 RuntimeStub*        SharedRuntime::_wrong_method_abstract_blob;
  84 RuntimeStub*        SharedRuntime::_ic_miss_blob;
  85 RuntimeStub*        SharedRuntime::_resolve_opt_virtual_call_blob;
  86 RuntimeStub*        SharedRuntime::_resolve_virtual_call_blob;
  87 RuntimeStub*        SharedRuntime::_resolve_static_call_blob;
  88 address             SharedRuntime::_resolve_static_call_entry;


3093   Method* moop = fr.interpreter_frame_method();
3094   int max_locals = moop->max_locals();
3095   // Allocate temp buffer, 1 word per local & 2 per active monitor
3096   int buf_size_words = max_locals + active_monitor_count * BasicObjectLock::size();
3097   intptr_t *buf = NEW_C_HEAP_ARRAY(intptr_t,buf_size_words, mtCode);
3098 
3099   // Copy the locals.  Order is preserved so that loading of longs works.
3100   // Since there's no GC I can copy the oops blindly.
3101   assert(sizeof(HeapWord)==sizeof(intptr_t), "fix this code");
3102   Copy::disjoint_words((HeapWord*)fr.interpreter_frame_local_at(max_locals-1),
3103                        (HeapWord*)&buf[0],
3104                        max_locals);
3105 
3106   // Inflate locks.  Copy the displaced headers.  Be careful, there can be holes.
3107   int i = max_locals;
3108   for (BasicObjectLock *kptr2 = fr.interpreter_frame_monitor_end();
3109        kptr2 < fr.interpreter_frame_monitor_begin();
3110        kptr2 = fr.next_monitor_in_interpreter_frame(kptr2) ) {
3111     if (kptr2->obj() != NULL) {         // Avoid 'holes' in the monitor array
3112       BasicLock *lock = kptr2->lock();



3113       // Inflate so the displaced header becomes position-independent
3114       if (lock->displaced_header()->is_unlocked())
3115         ObjectSynchronizer::inflate_helper(kptr2->obj());

3116       // Now the displaced header is free to move
3117       buf[i++] = (intptr_t)lock->displaced_header();
3118       buf[i++] = cast_from_oop<intptr_t>(kptr2->obj());
3119     }
3120   }
3121   assert(i - max_locals == active_monitor_count*2, "found the expected number of monitors");
3122 
3123   return buf;
3124 JRT_END
3125 
3126 JRT_LEAF(void, SharedRuntime::OSR_migration_end( intptr_t* buf) )
3127   FREE_C_HEAP_ARRAY(intptr_t, buf);
3128 JRT_END
3129 
3130 bool AdapterHandlerLibrary::contains(const CodeBlob* b) {
3131   AdapterHandlerTableIterator iter(_adapters);
3132   while (iter.has_next()) {
3133     AdapterHandlerEntry* a = iter.next();
3134     if (b == CodeCache::find_blob(a->get_i2c_entry())) return true;
3135   }




  47 #include "memory/resourceArea.hpp"
  48 #include "memory/universe.hpp"
  49 #include "oops/klass.hpp"
  50 #include "oops/method.inline.hpp"
  51 #include "oops/objArrayKlass.hpp"
  52 #include "oops/oop.inline.hpp"
  53 #include "prims/forte.hpp"
  54 #include "prims/jvmtiExport.hpp"
  55 #include "prims/methodHandles.hpp"
  56 #include "prims/nativeLookup.hpp"
  57 #include "runtime/arguments.hpp"
  58 #include "runtime/atomic.hpp"
  59 #include "runtime/biasedLocking.hpp"
  60 #include "runtime/compilationPolicy.hpp"
  61 #include "runtime/frame.inline.hpp"
  62 #include "runtime/handles.inline.hpp"
  63 #include "runtime/init.hpp"
  64 #include "runtime/interfaceSupport.inline.hpp"
  65 #include "runtime/java.hpp"
  66 #include "runtime/javaCalls.hpp"
  67 #include "runtime/objectMonitor.hpp"
  68 #include "runtime/sharedRuntime.hpp"
  69 #include "runtime/stubRoutines.hpp"
  70 #include "runtime/synchronizer.hpp"
  71 #include "runtime/vframe.inline.hpp"
  72 #include "runtime/vframeArray.hpp"
  73 #include "utilities/copy.hpp"
  74 #include "utilities/dtrace.hpp"
  75 #include "utilities/events.hpp"
  76 #include "utilities/hashtable.inline.hpp"
  77 #include "utilities/macros.hpp"
  78 #include "utilities/xmlstream.hpp"
  79 #ifdef COMPILER1
  80 #include "c1/c1_Runtime1.hpp"
  81 #endif
  82 
  83 // Shared stub locations
  84 RuntimeStub*        SharedRuntime::_wrong_method_blob;
  85 RuntimeStub*        SharedRuntime::_wrong_method_abstract_blob;
  86 RuntimeStub*        SharedRuntime::_ic_miss_blob;
  87 RuntimeStub*        SharedRuntime::_resolve_opt_virtual_call_blob;
  88 RuntimeStub*        SharedRuntime::_resolve_virtual_call_blob;
  89 RuntimeStub*        SharedRuntime::_resolve_static_call_blob;
  90 address             SharedRuntime::_resolve_static_call_entry;


3095   Method* moop = fr.interpreter_frame_method();
3096   int max_locals = moop->max_locals();
3097   // Allocate temp buffer, 1 word per local & 2 per active monitor
3098   int buf_size_words = max_locals + active_monitor_count * BasicObjectLock::size();
3099   intptr_t *buf = NEW_C_HEAP_ARRAY(intptr_t,buf_size_words, mtCode);
3100 
3101   // Copy the locals.  Order is preserved so that loading of longs works.
3102   // Since there's no GC I can copy the oops blindly.
3103   assert(sizeof(HeapWord)==sizeof(intptr_t), "fix this code");
3104   Copy::disjoint_words((HeapWord*)fr.interpreter_frame_local_at(max_locals-1),
3105                        (HeapWord*)&buf[0],
3106                        max_locals);
3107 
3108   // Inflate locks.  Copy the displaced headers.  Be careful, there can be holes.
3109   int i = max_locals;
3110   for (BasicObjectLock *kptr2 = fr.interpreter_frame_monitor_end();
3111        kptr2 < fr.interpreter_frame_monitor_begin();
3112        kptr2 = fr.next_monitor_in_interpreter_frame(kptr2) ) {
3113     if (kptr2->obj() != NULL) {         // Avoid 'holes' in the monitor array
3114       BasicLock *lock = kptr2->lock();
3115       // Disallow async deflation of the inflated monitor so the
3116       // displaced header stays stable until we've copied it.
3117       ObjectMonitorHandle omh;
3118       // Inflate so the displaced header becomes position-independent
3119       if (lock->displaced_header()->is_unlocked()) {
3120         ObjectSynchronizer::inflate_helper(&omh, kptr2->obj());
3121       }
3122       // Now the displaced header is free to move
3123       buf[i++] = (intptr_t)lock->displaced_header();
3124       buf[i++] = cast_from_oop<intptr_t>(kptr2->obj());
3125     }
3126   }
3127   assert(i - max_locals == active_monitor_count*2, "found the expected number of monitors");
3128 
3129   return buf;
3130 JRT_END
3131 
3132 JRT_LEAF(void, SharedRuntime::OSR_migration_end( intptr_t* buf) )
3133   FREE_C_HEAP_ARRAY(intptr_t, buf);
3134 JRT_END
3135 
3136 bool AdapterHandlerLibrary::contains(const CodeBlob* b) {
3137   AdapterHandlerTableIterator iter(_adapters);
3138   while (iter.has_next()) {
3139     AdapterHandlerEntry* a = iter.next();
3140     if (b == CodeCache::find_blob(a->get_i2c_entry())) return true;
3141   }


< prev index next >