Thu, 10 Mar 2011 17:44:32 +0100
7025485: leverage shared x86-only deoptimization code
Summary: removed an ifdef IA32 around harmless code useful for some ports
Reviewed-by: chrisphi, never
src/share/vm/runtime/deoptimization.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/runtime/deoptimization.hpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/runtime/deoptimization.cpp Mon Mar 07 16:03:28 2011 -0500 1.2 +++ b/src/share/vm/runtime/deoptimization.cpp Thu Mar 10 17:44:32 2011 +0100 1.3 @@ -101,9 +101,9 @@ 1.4 _frame_pcs = frame_pcs; 1.5 _register_block = NEW_C_HEAP_ARRAY(intptr_t, RegisterMap::reg_count * 2); 1.6 _return_type = return_type; 1.7 + _initial_fp = 0; 1.8 // PD (x86 only) 1.9 _counter_temp = 0; 1.10 - _initial_fp = 0; 1.11 _unpack_kind = 0; 1.12 _sender_sp_temp = 0; 1.13 1.14 @@ -459,18 +459,9 @@ 1.15 frame_sizes, 1.16 frame_pcs, 1.17 return_type); 1.18 -#if defined(IA32) || defined(AMD64) 1.19 - // We need a way to pass fp to the unpacking code so the skeletal frames 1.20 - // come out correct. This is only needed for x86 because of c2 using ebp 1.21 - // as an allocatable register. So this update is useless (and harmless) 1.22 - // on the other platforms. It would be nice to do this in a different 1.23 - // way but even the old style deoptimization had a problem with deriving 1.24 - // this value. NEEDS_CLEANUP 1.25 - // Note: now that c1 is using c2's deopt blob we must do this on all 1.26 - // x86 based platforms 1.27 - intptr_t** fp_addr = (intptr_t**) (((address)info) + info->initial_fp_offset_in_bytes()); 1.28 - *fp_addr = array->sender().fp(); // was adapter_caller 1.29 -#endif /* IA32 || AMD64 */ 1.30 + // On some platforms, we need a way to pass fp to the unpacking code 1.31 + // so the skeletal frames come out correct. 1.32 + info->set_initial_fp((intptr_t) array->sender().fp()); 1.33 1.34 if (array->frames() > 1) { 1.35 if (VerifyStack && TraceDeoptimization) {
2.1 --- a/src/share/vm/runtime/deoptimization.hpp Mon Mar 07 16:03:28 2011 -0500 2.2 +++ b/src/share/vm/runtime/deoptimization.hpp Thu Mar 10 17:44:32 2011 +0100 2.3 @@ -136,12 +136,12 @@ 2.4 address* _frame_pcs; // Array of frame pc's, in bytes, for unrolling the stack 2.5 intptr_t* _register_block; // Block for storing callee-saved registers. 2.6 BasicType _return_type; // Tells if we have to restore double or long return value 2.7 + intptr_t _initial_fp; // FP of the sender frame 2.8 // The following fields are used as temps during the unpacking phase 2.9 // (which is tight on registers, especially on x86). They really ought 2.10 // to be PD variables but that involves moving this class into its own 2.11 // file to use the pd include mechanism. Maybe in a later cleanup ... 2.12 intptr_t _counter_temp; // SHOULD BE PD VARIABLE (x86 frame count temp) 2.13 - intptr_t _initial_fp; // SHOULD BE PD VARIABLE (x86/c2 initial ebp) 2.14 intptr_t _unpack_kind; // SHOULD BE PD VARIABLE (x86 unpack kind) 2.15 intptr_t _sender_sp_temp; // SHOULD BE PD VARIABLE (x86 sender_sp) 2.16 public: 2.17 @@ -165,6 +165,8 @@ 2.18 // Returns the total size of frames 2.19 int size_of_frames() const; 2.20 2.21 + void set_initial_fp(intptr_t fp) { _initial_fp = fp; } 2.22 + 2.23 // Accessors used by the code generator for the unpack stub. 2.24 static int size_of_deoptimized_frame_offset_in_bytes() { return offset_of(UnrollBlock, _size_of_deoptimized_frame); } 2.25 static int caller_adjustment_offset_in_bytes() { return offset_of(UnrollBlock, _caller_adjustment); }