From 15bdbb1e9b23230fb36fbb76a7226d81e4e9177c Mon Sep 17 00:00:00 2001 From: bdelsart Date: Thu, 8 Sep 2011 10:12:25 +0200 Subject: [PATCH] 7087445: Improve platform independence of JSR292 shared code Summary: changes necessary for some JSR292 ports Reviewed-by: jrose, dholmes --- src/cpu/sparc/vm/frame_sparc.cpp | 6 ++++++ src/cpu/x86/vm/frame_x86.cpp | 6 ++++++ src/cpu/x86/vm/sharedRuntime_x86_32.cpp | 4 ++-- src/cpu/x86/vm/sharedRuntime_x86_64.cpp | 4 ++-- src/cpu/zero/vm/frame_zero.cpp | 6 ++++++ src/share/vm/runtime/arguments.cpp | 3 --- src/share/vm/runtime/deoptimization.cpp | 9 +++++---- src/share/vm/runtime/deoptimization.hpp | 6 +++--- src/share/vm/runtime/frame.hpp | 4 ++++ 9 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/cpu/sparc/vm/frame_sparc.cpp b/src/cpu/sparc/vm/frame_sparc.cpp index edac2b3ca..83fd37182 100644 --- a/src/cpu/sparc/vm/frame_sparc.cpp +++ b/src/cpu/sparc/vm/frame_sparc.cpp @@ -839,3 +839,9 @@ void frame::describe_pd(FrameValues& values, int frame_no) { } #endif + +intptr_t *frame::initial_deoptimization_info() { + // unused... but returns fp() to minimize changes introduced by 7087445 + return fp(); +} + diff --git a/src/cpu/x86/vm/frame_x86.cpp b/src/cpu/x86/vm/frame_x86.cpp index 21705957e..3d82d0622 100644 --- a/src/cpu/x86/vm/frame_x86.cpp +++ b/src/cpu/x86/vm/frame_x86.cpp @@ -666,3 +666,9 @@ void frame::describe_pd(FrameValues& values, int frame_no) { } #endif + +intptr_t *frame::initial_deoptimization_info() { + // used to reset the saved FP + return fp(); +} + diff --git a/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/src/cpu/x86/vm/sharedRuntime_x86_32.cpp index f21ed399f..9b43aba25 100644 --- a/src/cpu/x86/vm/sharedRuntime_x86_32.cpp +++ b/src/cpu/x86/vm/sharedRuntime_x86_32.cpp @@ -2471,7 +2471,7 @@ void SharedRuntime::generate_deopt_blob() { __ movl(counter, rbx); // Pick up the initial fp we should save - __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_fp_offset_in_bytes())); + __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes())); // Now adjust the caller's stack to make up for the extra locals // but record the original sp so that we can save it in the skeletal interpreter @@ -2691,7 +2691,7 @@ void SharedRuntime::generate_uncommon_trap_blob() { __ movl(counter, rbx); // Pick up the initial fp we should save - __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_fp_offset_in_bytes())); + __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes())); // Now adjust the caller's stack to make up for the extra locals // but record the original sp so that we can save it in the skeletal interpreter diff --git a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index 06b3d8d0c..effb3ce36 100644 --- a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -2730,7 +2730,7 @@ void SharedRuntime::generate_deopt_blob() { __ movl(rdx, Address(rdi, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes())); // Pick up the initial fp we should save - __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_fp_offset_in_bytes())); + __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes())); // Now adjust the caller's stack to make up for the extra locals // but record the original sp so that we can save it in the skeletal interpreter @@ -2922,7 +2922,7 @@ void SharedRuntime::generate_uncommon_trap_blob() { // Pick up the initial fp we should save __ movptr(rbp, Address(rdi, - Deoptimization::UnrollBlock::initial_fp_offset_in_bytes())); + Deoptimization::UnrollBlock::initial_info_offset_in_bytes())); // Now adjust the caller's stack to make up for the extra locals but // record the original sp so that we can save it in the skeletal diff --git a/src/cpu/zero/vm/frame_zero.cpp b/src/cpu/zero/vm/frame_zero.cpp index 9e3211224..35b6e52e4 100644 --- a/src/cpu/zero/vm/frame_zero.cpp +++ b/src/cpu/zero/vm/frame_zero.cpp @@ -425,3 +425,9 @@ void frame::describe_pd(FrameValues& values, int frame_no) { } #endif + +intptr_t *frame::initial_deoptimization_info() { + // unused... but returns fp() to minimize changes introduced by 7087445 + return fp(); +} + diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp index c159e48f0..c802f0351 100644 --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -3018,9 +3018,6 @@ jint Arguments::parse(const JavaVMInitArgs* args) { } #ifdef JAVASE_EMBEDDED - #ifdef PPC - UNSUPPORTED_OPTION(EnableInvokeDynamic, "Invoke dynamic"); - #endif UNSUPPORTED_OPTION(UseG1GC, "G1 GC"); #endif diff --git a/src/share/vm/runtime/deoptimization.cpp b/src/share/vm/runtime/deoptimization.cpp index b2f172d1d..db95badcd 100644 --- a/src/share/vm/runtime/deoptimization.cpp +++ b/src/share/vm/runtime/deoptimization.cpp @@ -103,7 +103,7 @@ Deoptimization::UnrollBlock::UnrollBlock(int size_of_deoptimized_frame, _frame_pcs = frame_pcs; _register_block = NEW_C_HEAP_ARRAY(intptr_t, RegisterMap::reg_count * 2); _return_type = return_type; - _initial_fp = 0; + _initial_info = 0; // PD (x86 only) _counter_temp = 0; _unpack_kind = 0; @@ -486,9 +486,10 @@ Deoptimization::UnrollBlock* Deoptimization::fetch_unroll_info_helper(JavaThread frame_sizes, frame_pcs, return_type); - // On some platforms, we need a way to pass fp to the unpacking code - // so the skeletal frames come out correct. - info->set_initial_fp((intptr_t) array->sender().fp()); + // On some platforms, we need a way to pass some platform dependent + // information to the unpacking code so the skeletal frames come out + // correct (initial fp value, unextended sp, ...) + info->set_initial_info((intptr_t) array->sender().initial_deoptimization_info()); if (array->frames() > 1) { if (VerifyStack && TraceDeoptimization) { diff --git a/src/share/vm/runtime/deoptimization.hpp b/src/share/vm/runtime/deoptimization.hpp index 853cd9a01..161d3a31a 100644 --- a/src/share/vm/runtime/deoptimization.hpp +++ b/src/share/vm/runtime/deoptimization.hpp @@ -137,7 +137,7 @@ class Deoptimization : AllStatic { address* _frame_pcs; // Array of frame pc's, in bytes, for unrolling the stack intptr_t* _register_block; // Block for storing callee-saved registers. BasicType _return_type; // Tells if we have to restore double or long return value - intptr_t _initial_fp; // FP of the sender frame + intptr_t _initial_info; // Platform dependent data for the sender frame (was FP on x86) int _caller_actual_parameters; // The number of actual arguments at the // interpreted caller of the deoptimized frame @@ -170,7 +170,7 @@ class Deoptimization : AllStatic { // Returns the total size of frames int size_of_frames() const; - void set_initial_fp(intptr_t fp) { _initial_fp = fp; } + void set_initial_info(intptr_t info) { _initial_info = info; } int caller_actual_parameters() const { return _caller_actual_parameters; } @@ -184,7 +184,7 @@ class Deoptimization : AllStatic { static int register_block_offset_in_bytes() { return offset_of(UnrollBlock, _register_block); } static int return_type_offset_in_bytes() { return offset_of(UnrollBlock, _return_type); } static int counter_temp_offset_in_bytes() { return offset_of(UnrollBlock, _counter_temp); } - static int initial_fp_offset_in_bytes() { return offset_of(UnrollBlock, _initial_fp); } + static int initial_info_offset_in_bytes() { return offset_of(UnrollBlock, _initial_info); } static int unpack_kind_offset_in_bytes() { return offset_of(UnrollBlock, _unpack_kind); } static int sender_sp_temp_offset_in_bytes() { return offset_of(UnrollBlock, _sender_sp_temp); } diff --git a/src/share/vm/runtime/frame.hpp b/src/share/vm/runtime/frame.hpp index 0273edf92..ec3e3e6eb 100644 --- a/src/share/vm/runtime/frame.hpp +++ b/src/share/vm/runtime/frame.hpp @@ -221,6 +221,10 @@ class frame VALUE_OBJ_CLASS_SPEC { // returns the stack pointer of the calling frame intptr_t* sender_sp() const; + // Deoptimization info, if needed (platform dependent). + // Stored in the initial_info field of the unroll info, to be used by + // the platform dependent deoptimization blobs. + intptr_t *initial_deoptimization_info(); // Interpreter frames: -- GitLab