135 Unpack_uncommon_trap = 2, // redo last byte code (C2 only) |
135 Unpack_uncommon_trap = 2, // redo last byte code (C2 only) |
136 Unpack_reexecute = 3, // reexecute bytecode (C1 only) |
136 Unpack_reexecute = 3, // reexecute bytecode (C1 only) |
137 Unpack_LIMIT = 4 |
137 Unpack_LIMIT = 4 |
138 }; |
138 }; |
139 |
139 |
140 static void deoptimize_all_marked(); |
|
141 |
|
142 private: |
|
143 // Checks all compiled methods. Invalid methods are deleted and |
140 // Checks all compiled methods. Invalid methods are deleted and |
144 // corresponding activations are deoptimized. |
141 // corresponding activations are deoptimized. |
145 static int deoptimize_dependents(); |
142 static int deoptimize_dependents(); |
146 static void revoke_using_handshake(JavaThread* thread, frame fr, RegisterMap* map); |
143 |
147 static void revoke_using_safepoint(JavaThread* thread, frame fr, RegisterMap* map); |
|
148 static void deopt_thread(bool in_handshake, JavaThread* thread, frame fr, RegisterMap *map, DeoptReason reason); |
|
149 |
|
150 public: |
|
151 // Deoptimizes a frame lazily. nmethod gets patched deopt happens on return to the frame |
144 // Deoptimizes a frame lazily. nmethod gets patched deopt happens on return to the frame |
152 static void deoptimize(JavaThread* thread, frame fr, RegisterMap *map, bool in_handshake = false); |
145 static void deoptimize(JavaThread* thread, frame fr, RegisterMap *reg_map); |
153 static void deoptimize(JavaThread* thread, frame fr, RegisterMap *reg_map, DeoptReason reason); |
146 static void deoptimize(JavaThread* thread, frame fr, RegisterMap *reg_map, DeoptReason reason); |
154 |
147 |
155 #if INCLUDE_JVMCI |
148 #if INCLUDE_JVMCI |
156 static address deoptimize_for_missing_exception_handler(CompiledMethod* cm); |
149 static address deoptimize_for_missing_exception_handler(CompiledMethod* cm); |
157 static oop get_cached_box(AutoBoxObjectValue* bv, frame* fr, RegisterMap* reg_map, TRAPS); |
150 static oop get_cached_box(AutoBoxObjectValue* bv, frame* fr, RegisterMap* reg_map, TRAPS); |
161 // Does the actual work for deoptimizing a single frame |
154 // Does the actual work for deoptimizing a single frame |
162 static void deoptimize_single_frame(JavaThread* thread, frame fr, DeoptReason reason); |
155 static void deoptimize_single_frame(JavaThread* thread, frame fr, DeoptReason reason); |
163 |
156 |
164 // Helper function to revoke biases of all monitors in frame if UseBiasedLocking |
157 // Helper function to revoke biases of all monitors in frame if UseBiasedLocking |
165 // is enabled |
158 // is enabled |
166 static void revoke_biases_of_monitors(JavaThread* thread, frame fr, RegisterMap* map) { |
159 static void revoke_biases_of_monitors(JavaThread* thread, frame fr, RegisterMap* map); |
167 revoke_using_safepoint(thread, fr, map); |
|
168 } |
|
169 |
160 |
170 #if COMPILER2_OR_JVMCI |
161 #if COMPILER2_OR_JVMCI |
171 JVMCI_ONLY(public:) |
162 JVMCI_ONLY(public:) |
172 |
163 |
173 // Support for restoring non-escaping objects |
164 // Support for restoring non-escaping objects |