comparison src/share/vm/runtime/deoptimization.hpp @ 20804:7848fc12602b

Merge with jdk8u40-b25
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Tue, 07 Apr 2015 14:58:49 +0200
parents 03c63fd2f714 d3f3f7677537
children be896a1983c0
comparison
equal deleted inserted replaced
20184:84105dcdb05b 20804:7848fc12602b
72 Reason_age, // nmethod too old; tier threshold reached 72 Reason_age, // nmethod too old; tier threshold reached
73 Reason_predicate, // compiler generated predicate failed 73 Reason_predicate, // compiler generated predicate failed
74 Reason_loop_limit_check, // compiler generated loop limits check failed 74 Reason_loop_limit_check, // compiler generated loop limits check failed
75 Reason_speculate_class_check, // saw unexpected object class from type speculation 75 Reason_speculate_class_check, // saw unexpected object class from type speculation
76 Reason_rtm_state_change, // rtm state change detected 76 Reason_rtm_state_change, // rtm state change detected
77 Reason_unstable_if, // a branch predicted always false was taken
77 #ifdef GRAAL 78 #ifdef GRAAL
78 Reason_aliasing, // optimistic assumption about aliasing failed 79 Reason_aliasing, // optimistic assumption about aliasing failed
79 Reason_transfer_to_interpreter, // explicit transferToInterpreter() 80 Reason_transfer_to_interpreter, // explicit transferToInterpreter()
80 Reason_not_compiled_exception_handler, 81 Reason_not_compiled_exception_handler,
81 Reason_unresolved, 82 Reason_unresolved,
82 Reason_jsr_mismatch, 83 Reason_jsr_mismatch,
83 #endif 84 #endif
84 Reason_LIMIT, 85 Reason_LIMIT,
85
86 // Note: Keep this enum in sync. with _trap_reason_name. 86 // Note: Keep this enum in sync. with _trap_reason_name.
87 Reason_RECORDED_LIMIT = Reason_bimorphic // some are not recorded per bc 87 Reason_RECORDED_LIMIT = Reason_bimorphic // some are not recorded per bc
88 // Note: Reason_RECORDED_LIMIT should be < 8 to fit into 3 bits of 88 // Note: Reason_RECORDED_LIMIT should be < 8 to fit into 3 bits of
89 // DataLayout::trap_bits. This dependency is enforced indirectly 89 // DataLayout::trap_bits. This dependency is enforced indirectly
90 // via asserts, to avoid excessive direct header-to-header dependencies. 90 // via asserts, to avoid excessive direct header-to-header dependencies.
143 143
144 // Support for restoring non-escaping objects 144 // Support for restoring non-escaping objects
145 static bool realloc_objects(JavaThread* thread, frame* fr, GrowableArray<ScopeValue*>* objects, TRAPS); 145 static bool realloc_objects(JavaThread* thread, frame* fr, GrowableArray<ScopeValue*>* objects, TRAPS);
146 static void reassign_type_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, typeArrayOop obj, BasicType type); 146 static void reassign_type_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, typeArrayOop obj, BasicType type);
147 static void reassign_object_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, objArrayOop obj); 147 static void reassign_object_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, objArrayOop obj);
148 static void reassign_fields(frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects); 148 static void reassign_fields(frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects, bool realloc_failures);
149 static void relock_objects(GrowableArray<MonitorInfo*>* monitors, JavaThread* thread); 149 static void relock_objects(GrowableArray<MonitorInfo*>* monitors, JavaThread* thread, bool realloc_failures);
150 NOT_PRODUCT(static void print_objects(GrowableArray<ScopeValue*>* objects);) 150 static void pop_frames_failed_reallocs(JavaThread* thread, vframeArray* array);
151 NOT_PRODUCT(static void print_objects(GrowableArray<ScopeValue*>* objects, bool realloc_failures);)
151 #endif // COMPILER2 || GRAAL 152 #endif // COMPILER2 || GRAAL
152 153
153 public: 154 public:
154 static vframeArray* create_vframeArray(JavaThread* thread, frame fr, RegisterMap *reg_map, GrowableArray<compiledVFrame*>* chunk); 155 static vframeArray* create_vframeArray(JavaThread* thread, frame fr, RegisterMap *reg_map, GrowableArray<compiledVFrame*>* chunk, bool realloc_failures);
155 156
156 // Interface used for unpacking deoptimized frames 157 // Interface used for unpacking deoptimized frames
157 158
158 // UnrollBlock is returned by fetch_unroll_info() to the deoptimization handler (blob). 159 // UnrollBlock is returned by fetch_unroll_info() to the deoptimization handler (blob).
159 // This is only a CheapObj to ease debugging after a deopt failure 160 // This is only a CheapObj to ease debugging after a deopt failure
262 // Only called from VMDeoptimizeFrame 263 // Only called from VMDeoptimizeFrame
263 // @argument thread. Thread where stub_frame resides. 264 // @argument thread. Thread where stub_frame resides.
264 // @argument id. id of frame that should be deoptimized. 265 // @argument id. id of frame that should be deoptimized.
265 static void deoptimize_frame_internal(JavaThread* thread, intptr_t* id, DeoptReason reason); 266 static void deoptimize_frame_internal(JavaThread* thread, intptr_t* id, DeoptReason reason);
266 267
267 // if thread is not the current thread then execute 268 // If thread is not the current thread then execute
268 // VM_DeoptimizeFrame otherwise deoptimize directly. 269 // VM_DeoptimizeFrame otherwise deoptimize directly.
269 static void deoptimize_frame(JavaThread* thread, intptr_t* id, DeoptReason reason); 270 static void deoptimize_frame(JavaThread* thread, intptr_t* id, DeoptReason reason);
270 static void deoptimize_frame(JavaThread* thread, intptr_t* id); 271 static void deoptimize_frame(JavaThread* thread, intptr_t* id);
271 272
272 // Statistics 273 // Statistics
352 return reason; 353 return reason;
353 else if (reason == Reason_div0_check) // null check due to divide-by-zero? 354 else if (reason == Reason_div0_check) // null check due to divide-by-zero?
354 return Reason_null_check; // recorded per BCI as a null check 355 return Reason_null_check; // recorded per BCI as a null check
355 else if (reason == Reason_speculate_class_check) 356 else if (reason == Reason_speculate_class_check)
356 return Reason_class_check; 357 return Reason_class_check;
358 else if (reason == Reason_unstable_if)
359 return Reason_intrinsic;
357 else 360 else
358 return Reason_none; 361 return Reason_none;
359 } 362 }
360 363
361 static bool reason_is_speculate(int reason) { 364 static bool reason_is_speculate(int reason) {