Mercurial > hg > truffle
comparison src/share/vm/runtime/deoptimization.hpp @ 8151:b8f261ba79c6
Minimize diff to plain HotSpot version.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Thu, 07 Mar 2013 21:00:29 +0100 |
parents | 5d0bb7d52783 |
children | d343737786fe |
comparison
equal
deleted
inserted
replaced
8150:b66f831ac5ab | 8151:b8f261ba79c6 |
---|---|
35 | 35 |
36 class Deoptimization : AllStatic { | 36 class Deoptimization : AllStatic { |
37 friend class VMStructs; | 37 friend class VMStructs; |
38 | 38 |
39 public: | 39 public: |
40 // What condition caused the deoptimization | 40 // What condition caused the deoptimization? |
41 enum DeoptReason { | 41 enum DeoptReason { |
42 Reason_many = -1, // indicates presence of several reasons | 42 Reason_many = -1, // indicates presence of several reasons |
43 Reason_none = 0, // indicates absence of a relevant deopt. | 43 Reason_none = 0, // indicates absence of a relevant deopt. |
44 // Next 7 reasons are recorded per bytecode in DataLayout::trap_bits. | 44 // Next 7 reasons are recorded per bytecode in DataLayout::trap_bits. |
45 // This is more complicated for Graal as Graal may deoptimize to *some* bytecode before the | 45 // This is more complicated for Graal as Graal may deoptimize to *some* bytecode before the |
83 Reason_RECORDED_LIMIT = Reason_bimorphic // some are not recorded per bc | 83 Reason_RECORDED_LIMIT = Reason_bimorphic // some are not recorded per bc |
84 // Note: Keep this enum in sync. with _trap_reason_name. | 84 // Note: Keep this enum in sync. with _trap_reason_name. |
85 // Note: Reason_RECORDED_LIMIT should be < 8 to fit into 3 bits of | 85 // Note: Reason_RECORDED_LIMIT should be < 8 to fit into 3 bits of |
86 // DataLayout::trap_bits. This dependency is enforced indirectly | 86 // DataLayout::trap_bits. This dependency is enforced indirectly |
87 // via asserts, to avoid excessive direct header-to-header dependencies. | 87 // via asserts, to avoid excessive direct header-to-header dependencies. |
88 // See Deoptimization::trap_state_reason and class DataLayout | 88 // See Deoptimization::trap_state_reason and class DataLayout. |
89 }; | 89 }; |
90 | 90 |
91 // What action must be taken by the runtime? | 91 // What action must be taken by the runtime? |
92 enum DeoptAction { | 92 enum DeoptAction { |
93 Action_none, // just interpret, do not invalidate nmethod | 93 Action_none, // just interpret, do not invalidate nmethod |
130 static void revoke_biases_of_monitors(JavaThread* thread, frame fr, RegisterMap* map); | 130 static void revoke_biases_of_monitors(JavaThread* thread, frame fr, RegisterMap* map); |
131 // Helper function to revoke biases of all monitors in frames | 131 // Helper function to revoke biases of all monitors in frames |
132 // executing in a particular CodeBlob if UseBiasedLocking is enabled | 132 // executing in a particular CodeBlob if UseBiasedLocking is enabled |
133 static void revoke_biases_of_monitors(CodeBlob* cb); | 133 static void revoke_biases_of_monitors(CodeBlob* cb); |
134 | 134 |
135 //#ifdef COMPILER2 | 135 #if defined(COMPILER2) || defined(GRAAL) |
136 // Support for restoring non-escaping objects | 136 // Support for restoring non-escaping objects |
137 static bool realloc_objects(JavaThread* thread, frame* fr, GrowableArray<ScopeValue*>* objects, TRAPS); | 137 static bool realloc_objects(JavaThread* thread, frame* fr, GrowableArray<ScopeValue*>* objects, TRAPS); |
138 static void reassign_type_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, typeArrayOop obj, BasicType type); | 138 static void reassign_type_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, typeArrayOop obj, BasicType type); |
139 static void reassign_object_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, objArrayOop obj); | 139 static void reassign_object_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, objArrayOop obj); |
140 static void reassign_fields(frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects); | 140 static void reassign_fields(frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects); |
141 static void relock_objects(GrowableArray<MonitorInfo*>* monitors, JavaThread* thread); | 141 static void relock_objects(GrowableArray<MonitorInfo*>* monitors, JavaThread* thread); |
142 NOT_PRODUCT(static void print_objects(GrowableArray<ScopeValue*>* objects);) | 142 NOT_PRODUCT(static void print_objects(GrowableArray<ScopeValue*>* objects);) |
143 //#endif // COMPILER2 | 143 #endif // COMPILER2 || GRAAL |
144 | 144 |
145 public: | 145 public: |
146 static vframeArray* create_vframeArray(JavaThread* thread, frame fr, RegisterMap *reg_map, GrowableArray<compiledVFrame*>* chunk); | 146 static vframeArray* create_vframeArray(JavaThread* thread, frame fr, RegisterMap *reg_map, GrowableArray<compiledVFrame*>* chunk); |
147 | 147 |
148 // Interface used for unpacking deoptimized frames | 148 // Interface used for unpacking deoptimized frames |
317 #endif | 317 #endif |
318 | 318 |
319 assert((1 << _reason_bits) >= Reason_LIMIT, "enough bits"); | 319 assert((1 << _reason_bits) >= Reason_LIMIT, "enough bits"); |
320 assert((1 << _action_bits) >= Action_LIMIT, "enough bits"); | 320 assert((1 << _action_bits) >= Action_LIMIT, "enough bits"); |
321 int trap_request; | 321 int trap_request; |
322 if (index != -1) { | 322 if (index != -1) |
323 trap_request = index; | 323 trap_request = index; |
324 } else { | 324 else |
325 trap_request = (~(((reason) << _reason_shift) | 325 trap_request = (~(((reason) << _reason_shift) |
326 + ((action) << _action_shift))); | 326 + ((action) << _action_shift))); |
327 } | |
328 assert(reason == trap_request_reason(trap_request), "valid reason"); | 327 assert(reason == trap_request_reason(trap_request), "valid reason"); |
329 assert(action == trap_request_action(trap_request), "valid action"); | 328 assert(action == trap_request_action(trap_request), "valid action"); |
330 assert(index == trap_request_index(trap_request), "valid index"); | 329 assert(index == trap_request_index(trap_request), "valid index"); |
331 return trap_request; | 330 return trap_request; |
332 } | 331 } |