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;
3072 Method* moop = fr.interpreter_frame_method();
3073 int max_locals = moop->max_locals();
3074 // Allocate temp buffer, 1 word per local & 2 per active monitor
3075 int buf_size_words = max_locals + active_monitor_count * BasicObjectLock::size();
3076 intptr_t *buf = NEW_C_HEAP_ARRAY(intptr_t,buf_size_words, mtCode);
3077
3078 // Copy the locals. Order is preserved so that loading of longs works.
3079 // Since there's no GC I can copy the oops blindly.
3080 assert(sizeof(HeapWord)==sizeof(intptr_t), "fix this code");
3081 Copy::disjoint_words((HeapWord*)fr.interpreter_frame_local_at(max_locals-1),
3082 (HeapWord*)&buf[0],
3083 max_locals);
3084
3085 // Inflate locks. Copy the displaced headers. Be careful, there can be holes.
3086 int i = max_locals;
3087 for (BasicObjectLock *kptr2 = fr.interpreter_frame_monitor_end();
3088 kptr2 < fr.interpreter_frame_monitor_begin();
3089 kptr2 = fr.next_monitor_in_interpreter_frame(kptr2) ) {
3090 if (kptr2->obj() != NULL) { // Avoid 'holes' in the monitor array
3091 BasicLock *lock = kptr2->lock();
3092 // Inflate so the displaced header becomes position-independent
3093 if (lock->displaced_header()->is_unlocked())
3094 ObjectSynchronizer::inflate_helper(kptr2->obj());
3095 // Now the displaced header is free to move
3096 buf[i++] = (intptr_t)lock->displaced_header();
3097 buf[i++] = cast_from_oop<intptr_t>(kptr2->obj());
3098 }
3099 }
3100 assert(i - max_locals == active_monitor_count*2, "found the expected number of monitors");
3101
3102 return buf;
3103 JRT_END
3104
3105 JRT_LEAF(void, SharedRuntime::OSR_migration_end( intptr_t* buf) )
3106 FREE_C_HEAP_ARRAY(intptr_t, buf);
3107 JRT_END
3108
3109 bool AdapterHandlerLibrary::contains(const CodeBlob* b) {
3110 AdapterHandlerTableIterator iter(_adapters);
3111 while (iter.has_next()) {
3112 AdapterHandlerEntry* a = iter.next();
3113 if (b == CodeCache::find_blob(a->get_i2c_entry())) return true;
3114 }
|
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;
3074 Method* moop = fr.interpreter_frame_method();
3075 int max_locals = moop->max_locals();
3076 // Allocate temp buffer, 1 word per local & 2 per active monitor
3077 int buf_size_words = max_locals + active_monitor_count * BasicObjectLock::size();
3078 intptr_t *buf = NEW_C_HEAP_ARRAY(intptr_t,buf_size_words, mtCode);
3079
3080 // Copy the locals. Order is preserved so that loading of longs works.
3081 // Since there's no GC I can copy the oops blindly.
3082 assert(sizeof(HeapWord)==sizeof(intptr_t), "fix this code");
3083 Copy::disjoint_words((HeapWord*)fr.interpreter_frame_local_at(max_locals-1),
3084 (HeapWord*)&buf[0],
3085 max_locals);
3086
3087 // Inflate locks. Copy the displaced headers. Be careful, there can be holes.
3088 int i = max_locals;
3089 for (BasicObjectLock *kptr2 = fr.interpreter_frame_monitor_end();
3090 kptr2 < fr.interpreter_frame_monitor_begin();
3091 kptr2 = fr.next_monitor_in_interpreter_frame(kptr2) ) {
3092 if (kptr2->obj() != NULL) { // Avoid 'holes' in the monitor array
3093 BasicLock *lock = kptr2->lock();
3094 // Disallow async deflation of the inflated monitor so the
3095 // displaced header stays stable until we've copied it.
3096 ObjectMonitorHandle omh;
3097 // Inflate so the displaced header becomes position-independent
3098 if (lock->displaced_header()->is_unlocked()) {
3099 ObjectSynchronizer::inflate_helper(&omh, kptr2->obj());
3100 }
3101 // Now the displaced header is free to move
3102 buf[i++] = (intptr_t)lock->displaced_header();
3103 buf[i++] = cast_from_oop<intptr_t>(kptr2->obj());
3104 }
3105 }
3106 assert(i - max_locals == active_monitor_count*2, "found the expected number of monitors");
3107
3108 return buf;
3109 JRT_END
3110
3111 JRT_LEAF(void, SharedRuntime::OSR_migration_end( intptr_t* buf) )
3112 FREE_C_HEAP_ARRAY(intptr_t, buf);
3113 JRT_END
3114
3115 bool AdapterHandlerLibrary::contains(const CodeBlob* b) {
3116 AdapterHandlerTableIterator iter(_adapters);
3117 while (iter.has_next()) {
3118 AdapterHandlerEntry* a = iter.next();
3119 if (b == CodeCache::find_blob(a->get_i2c_entry())) return true;
3120 }
|