< prev index next >

src/hotspot/share/runtime/sharedRuntime.cpp

Print this page
rev 54996 : 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;


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



3107       // Inflate so the displaced header becomes position-independent
3108       if (lock->displaced_header()->is_unlocked())
3109         ObjectSynchronizer::inflate_helper(kptr2->obj());

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




  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;


3089   Method* moop = fr.interpreter_frame_method();
3090   int max_locals = moop->max_locals();
3091   // Allocate temp buffer, 1 word per local & 2 per active monitor
3092   int buf_size_words = max_locals + active_monitor_count * BasicObjectLock::size();
3093   intptr_t *buf = NEW_C_HEAP_ARRAY(intptr_t,buf_size_words, mtCode);
3094 
3095   // Copy the locals.  Order is preserved so that loading of longs works.
3096   // Since there's no GC I can copy the oops blindly.
3097   assert(sizeof(HeapWord)==sizeof(intptr_t), "fix this code");
3098   Copy::disjoint_words((HeapWord*)fr.interpreter_frame_local_at(max_locals-1),
3099                        (HeapWord*)&buf[0],
3100                        max_locals);
3101 
3102   // Inflate locks.  Copy the displaced headers.  Be careful, there can be holes.
3103   int i = max_locals;
3104   for (BasicObjectLock *kptr2 = fr.interpreter_frame_monitor_end();
3105        kptr2 < fr.interpreter_frame_monitor_begin();
3106        kptr2 = fr.next_monitor_in_interpreter_frame(kptr2) ) {
3107     if (kptr2->obj() != NULL) {         // Avoid 'holes' in the monitor array
3108       BasicLock *lock = kptr2->lock();
3109       // Disallow async deflation of the inflated monitor so the
3110       // displaced header stays stable until we've copied it.
3111       ObjectMonitorHandle omh;
3112       // Inflate so the displaced header becomes position-independent
3113       if (lock->displaced_header()->is_unlocked()) {
3114         ObjectSynchronizer::inflate_helper(&omh, kptr2->obj());
3115       }
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   }


< prev index next >