46 #include "memory/metaspaceShared.hpp"
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/frame.inline.hpp"
61 #include "runtime/handles.inline.hpp"
62 #include "runtime/init.hpp"
63 #include "runtime/interfaceSupport.inline.hpp"
64 #include "runtime/java.hpp"
65 #include "runtime/javaCalls.hpp"
66 #include "runtime/sharedRuntime.hpp"
67 #include "runtime/stubRoutines.hpp"
68 #include "runtime/vframe.inline.hpp"
69 #include "runtime/vframeArray.hpp"
70 #include "utilities/copy.hpp"
71 #include "utilities/dtrace.hpp"
72 #include "utilities/events.hpp"
73 #include "utilities/hashtable.inline.hpp"
74 #include "utilities/macros.hpp"
75 #include "utilities/xmlstream.hpp"
76 #ifdef COMPILER1
77 #include "c1/c1_Runtime1.hpp"
78 #endif
79
80 // Shared stub locations
81 RuntimeStub* SharedRuntime::_wrong_method_blob;
82 RuntimeStub* SharedRuntime::_wrong_method_abstract_blob;
83 RuntimeStub* SharedRuntime::_ic_miss_blob;
84 RuntimeStub* SharedRuntime::_resolve_opt_virtual_call_blob;
85 RuntimeStub* SharedRuntime::_resolve_virtual_call_blob;
86 RuntimeStub* SharedRuntime::_resolve_static_call_blob;
87 address SharedRuntime::_resolve_static_call_entry;
3094 Method* moop = fr.interpreter_frame_method();
3095 int max_locals = moop->max_locals();
3096 // Allocate temp buffer, 1 word per local & 2 per active monitor
3097 int buf_size_words = max_locals + active_monitor_count * BasicObjectLock::size();
3098 intptr_t *buf = NEW_C_HEAP_ARRAY(intptr_t,buf_size_words, mtCode);
3099
3100 // Copy the locals. Order is preserved so that loading of longs works.
3101 // Since there's no GC I can copy the oops blindly.
3102 assert(sizeof(HeapWord)==sizeof(intptr_t), "fix this code");
3103 Copy::disjoint_words((HeapWord*)fr.interpreter_frame_local_at(max_locals-1),
3104 (HeapWord*)&buf[0],
3105 max_locals);
3106
3107 // Inflate locks. Copy the displaced headers. Be careful, there can be holes.
3108 int i = max_locals;
3109 for (BasicObjectLock *kptr2 = fr.interpreter_frame_monitor_end();
3110 kptr2 < fr.interpreter_frame_monitor_begin();
3111 kptr2 = fr.next_monitor_in_interpreter_frame(kptr2) ) {
3112 if (kptr2->obj() != NULL) { // Avoid 'holes' in the monitor array
3113 BasicLock *lock = kptr2->lock();
3114 // Inflate so the displaced header becomes position-independent
3115 if (lock->displaced_header().is_unlocked())
3116 ObjectSynchronizer::inflate_helper(kptr2->obj());
3117 // Now the displaced header is free to move
3118 buf[i++] = (intptr_t)lock->displaced_header().value();
3119 buf[i++] = cast_from_oop<intptr_t>(kptr2->obj());
3120 }
3121 }
3122 assert(i - max_locals == active_monitor_count*2, "found the expected number of monitors");
3123
3124 return buf;
3125 JRT_END
3126
3127 JRT_LEAF(void, SharedRuntime::OSR_migration_end( intptr_t* buf) )
3128 FREE_C_HEAP_ARRAY(intptr_t, buf);
3129 JRT_END
3130
3131 bool AdapterHandlerLibrary::contains(const CodeBlob* b) {
3132 AdapterHandlerTableIterator iter(_adapters);
3133 while (iter.has_next()) {
3134 AdapterHandlerEntry* a = iter.next();
3135 if (b == CodeCache::find_blob(a->get_i2c_entry())) return true;
3136 }
|
46 #include "memory/metaspaceShared.hpp"
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/frame.inline.hpp"
61 #include "runtime/handles.inline.hpp"
62 #include "runtime/init.hpp"
63 #include "runtime/interfaceSupport.inline.hpp"
64 #include "runtime/java.hpp"
65 #include "runtime/javaCalls.hpp"
66 #include "runtime/objectMonitor.hpp"
67 #include "runtime/sharedRuntime.hpp"
68 #include "runtime/stubRoutines.hpp"
69 #include "runtime/synchronizer.hpp"
70 #include "runtime/vframe.inline.hpp"
71 #include "runtime/vframeArray.hpp"
72 #include "utilities/copy.hpp"
73 #include "utilities/dtrace.hpp"
74 #include "utilities/events.hpp"
75 #include "utilities/hashtable.inline.hpp"
76 #include "utilities/macros.hpp"
77 #include "utilities/xmlstream.hpp"
78 #ifdef COMPILER1
79 #include "c1/c1_Runtime1.hpp"
80 #endif
81
82 // Shared stub locations
83 RuntimeStub* SharedRuntime::_wrong_method_blob;
84 RuntimeStub* SharedRuntime::_wrong_method_abstract_blob;
85 RuntimeStub* SharedRuntime::_ic_miss_blob;
86 RuntimeStub* SharedRuntime::_resolve_opt_virtual_call_blob;
87 RuntimeStub* SharedRuntime::_resolve_virtual_call_blob;
88 RuntimeStub* SharedRuntime::_resolve_static_call_blob;
89 address SharedRuntime::_resolve_static_call_entry;
3096 Method* moop = fr.interpreter_frame_method();
3097 int max_locals = moop->max_locals();
3098 // Allocate temp buffer, 1 word per local & 2 per active monitor
3099 int buf_size_words = max_locals + active_monitor_count * BasicObjectLock::size();
3100 intptr_t *buf = NEW_C_HEAP_ARRAY(intptr_t,buf_size_words, mtCode);
3101
3102 // Copy the locals. Order is preserved so that loading of longs works.
3103 // Since there's no GC I can copy the oops blindly.
3104 assert(sizeof(HeapWord)==sizeof(intptr_t), "fix this code");
3105 Copy::disjoint_words((HeapWord*)fr.interpreter_frame_local_at(max_locals-1),
3106 (HeapWord*)&buf[0],
3107 max_locals);
3108
3109 // Inflate locks. Copy the displaced headers. Be careful, there can be holes.
3110 int i = max_locals;
3111 for (BasicObjectLock *kptr2 = fr.interpreter_frame_monitor_end();
3112 kptr2 < fr.interpreter_frame_monitor_begin();
3113 kptr2 = fr.next_monitor_in_interpreter_frame(kptr2) ) {
3114 if (kptr2->obj() != NULL) { // Avoid 'holes' in the monitor array
3115 BasicLock *lock = kptr2->lock();
3116 // Disallow async deflation of the inflated monitor so the
3117 // displaced header stays stable until we've copied it.
3118 ObjectMonitorHandle omh;
3119 // Inflate so the displaced header becomes position-independent
3120 if (lock->displaced_header().is_unlocked()) {
3121 ObjectSynchronizer::inflate_helper(&omh, kptr2->obj());
3122 }
3123 // Now the displaced header is free to move
3124 buf[i++] = (intptr_t)lock->displaced_header().value();
3125 buf[i++] = cast_from_oop<intptr_t>(kptr2->obj());
3126 }
3127 }
3128 assert(i - max_locals == active_monitor_count*2, "found the expected number of monitors");
3129
3130 return buf;
3131 JRT_END
3132
3133 JRT_LEAF(void, SharedRuntime::OSR_migration_end( intptr_t* buf) )
3134 FREE_C_HEAP_ARRAY(intptr_t, buf);
3135 JRT_END
3136
3137 bool AdapterHandlerLibrary::contains(const CodeBlob* b) {
3138 AdapterHandlerTableIterator iter(_adapters);
3139 while (iter.has_next()) {
3140 AdapterHandlerEntry* a = iter.next();
3141 if (b == CodeCache::find_blob(a->get_i2c_entry())) return true;
3142 }
|