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;
3053 Method* moop = fr.interpreter_frame_method();
3054 int max_locals = moop->max_locals();
3055 // Allocate temp buffer, 1 word per local & 2 per active monitor
3056 int buf_size_words = max_locals + active_monitor_count * BasicObjectLock::size();
3057 intptr_t *buf = NEW_C_HEAP_ARRAY(intptr_t,buf_size_words, mtCode);
3058
3059 // Copy the locals. Order is preserved so that loading of longs works.
3060 // Since there's no GC I can copy the oops blindly.
3061 assert(sizeof(HeapWord)==sizeof(intptr_t), "fix this code");
3062 Copy::disjoint_words((HeapWord*)fr.interpreter_frame_local_at(max_locals-1),
3063 (HeapWord*)&buf[0],
3064 max_locals);
3065
3066 // Inflate locks. Copy the displaced headers. Be careful, there can be holes.
3067 int i = max_locals;
3068 for (BasicObjectLock *kptr2 = fr.interpreter_frame_monitor_end();
3069 kptr2 < fr.interpreter_frame_monitor_begin();
3070 kptr2 = fr.next_monitor_in_interpreter_frame(kptr2) ) {
3071 if (kptr2->obj() != NULL) { // Avoid 'holes' in the monitor array
3072 BasicLock *lock = kptr2->lock();
3073 // Inflate so the displaced header becomes position-independent
3074 if (lock->displaced_header().is_unlocked())
3075 ObjectSynchronizer::inflate_helper(kptr2->obj());
3076 // Now the displaced header is free to move
3077 buf[i++] = (intptr_t)lock->displaced_header().value();
3078 buf[i++] = cast_from_oop<intptr_t>(kptr2->obj());
3079 }
3080 }
3081 assert(i - max_locals == active_monitor_count*2, "found the expected number of monitors");
3082
3083 return buf;
3084 JRT_END
3085
3086 JRT_LEAF(void, SharedRuntime::OSR_migration_end( intptr_t* buf) )
3087 FREE_C_HEAP_ARRAY(intptr_t, buf);
3088 JRT_END
3089
3090 bool AdapterHandlerLibrary::contains(const CodeBlob* b) {
3091 AdapterHandlerTableIterator iter(_adapters);
3092 while (iter.has_next()) {
3093 AdapterHandlerEntry* a = iter.next();
3094 if (b == CodeCache::find_blob(a->get_i2c_entry())) return true;
3095 }
3096 return false;
|
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/synchronizer.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;
3054 Method* moop = fr.interpreter_frame_method();
3055 int max_locals = moop->max_locals();
3056 // Allocate temp buffer, 1 word per local & 2 per active monitor
3057 int buf_size_words = max_locals + active_monitor_count * BasicObjectLock::size();
3058 intptr_t *buf = NEW_C_HEAP_ARRAY(intptr_t,buf_size_words, mtCode);
3059
3060 // Copy the locals. Order is preserved so that loading of longs works.
3061 // Since there's no GC I can copy the oops blindly.
3062 assert(sizeof(HeapWord)==sizeof(intptr_t), "fix this code");
3063 Copy::disjoint_words((HeapWord*)fr.interpreter_frame_local_at(max_locals-1),
3064 (HeapWord*)&buf[0],
3065 max_locals);
3066
3067 // Inflate locks. Copy the displaced headers. Be careful, there can be holes.
3068 int i = max_locals;
3069 for (BasicObjectLock *kptr2 = fr.interpreter_frame_monitor_end();
3070 kptr2 < fr.interpreter_frame_monitor_begin();
3071 kptr2 = fr.next_monitor_in_interpreter_frame(kptr2) ) {
3072 if (kptr2->obj() != NULL) { // Avoid 'holes' in the monitor array
3073 BasicLock *lock = kptr2->lock();
3074 // Inflate so the object's header no longer refers to the BasicLock.
3075 if (lock->displaced_header().is_unlocked()) {
3076 // The object is locked and the resulting ObjectMonitor* will also be
3077 // locked so it can't be async deflated until ownership is dropped.
3078 // See the big comment in basicLock.cpp: BasicLock::move_to().
3079 ObjectSynchronizer::inflate_helper(kptr2->obj());
3080 }
3081 // Now the displaced header is free to move because the
3082 // object's header no longer refers to it.
3083 buf[i++] = (intptr_t)lock->displaced_header().value();
3084 buf[i++] = cast_from_oop<intptr_t>(kptr2->obj());
3085 }
3086 }
3087 assert(i - max_locals == active_monitor_count*2, "found the expected number of monitors");
3088
3089 return buf;
3090 JRT_END
3091
3092 JRT_LEAF(void, SharedRuntime::OSR_migration_end( intptr_t* buf) )
3093 FREE_C_HEAP_ARRAY(intptr_t, buf);
3094 JRT_END
3095
3096 bool AdapterHandlerLibrary::contains(const CodeBlob* b) {
3097 AdapterHandlerTableIterator iter(_adapters);
3098 while (iter.has_next()) {
3099 AdapterHandlerEntry* a = iter.next();
3100 if (b == CodeCache::find_blob(a->get_i2c_entry())) return true;
3101 }
3102 return false;
|