changeset 2695:5432047c7db7

7087445: Improve platform independence of JSR292 shared code Summary: changes necessary for some JSR292 ports Reviewed-by: jrose, dholmes
author bdelsart
date Thu, 08 Sep 2011 10:12:25 +0200
parents da6a29fb0da5
children b0efc7ee3b31
files src/cpu/sparc/vm/frame_sparc.cpp src/cpu/x86/vm/frame_x86.cpp src/cpu/x86/vm/sharedRuntime_x86_32.cpp src/cpu/x86/vm/sharedRuntime_x86_64.cpp src/cpu/zero/vm/frame_zero.cpp src/share/vm/runtime/arguments.cpp src/share/vm/runtime/deoptimization.cpp src/share/vm/runtime/deoptimization.hpp src/share/vm/runtime/frame.hpp
diffstat 9 files changed, 34 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/sparc/vm/frame_sparc.cpp	Wed Sep 07 12:58:42 2011 -0700
+++ b/src/cpu/sparc/vm/frame_sparc.cpp	Thu Sep 08 10:12:25 2011 +0200
@@ -839,3 +839,9 @@
 }
 
 #endif
+
+intptr_t *frame::initial_deoptimization_info() {
+  // unused... but returns fp() to minimize changes introduced by 7087445
+  return fp();
+}
+
--- a/src/cpu/x86/vm/frame_x86.cpp	Wed Sep 07 12:58:42 2011 -0700
+++ b/src/cpu/x86/vm/frame_x86.cpp	Thu Sep 08 10:12:25 2011 +0200
@@ -666,3 +666,9 @@
 
 }
 #endif
+
+intptr_t *frame::initial_deoptimization_info() {
+  // used to reset the saved FP
+  return fp();
+}
+
--- a/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Wed Sep 07 12:58:42 2011 -0700
+++ b/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Thu Sep 08 10:12:25 2011 +0200
@@ -2471,7 +2471,7 @@
   __ 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 @@
   __ 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
--- a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Wed Sep 07 12:58:42 2011 -0700
+++ b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Thu Sep 08 10:12:25 2011 +0200
@@ -2730,7 +2730,7 @@
   __ 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 @@
   // 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
--- a/src/cpu/zero/vm/frame_zero.cpp	Wed Sep 07 12:58:42 2011 -0700
+++ b/src/cpu/zero/vm/frame_zero.cpp	Thu Sep 08 10:12:25 2011 +0200
@@ -425,3 +425,9 @@
 }
 
 #endif
+
+intptr_t *frame::initial_deoptimization_info() {
+  // unused... but returns fp() to minimize changes introduced by 7087445
+  return fp();
+}
+
--- a/src/share/vm/runtime/arguments.cpp	Wed Sep 07 12:58:42 2011 -0700
+++ b/src/share/vm/runtime/arguments.cpp	Thu Sep 08 10:12:25 2011 +0200
@@ -3018,9 +3018,6 @@
   }
 
 #ifdef JAVASE_EMBEDDED
-  #ifdef PPC
-    UNSUPPORTED_OPTION(EnableInvokeDynamic, "Invoke dynamic");
-  #endif
   UNSUPPORTED_OPTION(UseG1GC, "G1 GC");
 #endif
 
--- a/src/share/vm/runtime/deoptimization.cpp	Wed Sep 07 12:58:42 2011 -0700
+++ b/src/share/vm/runtime/deoptimization.cpp	Thu Sep 08 10:12:25 2011 +0200
@@ -103,7 +103,7 @@
   _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 @@
                                       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) {
--- a/src/share/vm/runtime/deoptimization.hpp	Wed Sep 07 12:58:42 2011 -0700
+++ b/src/share/vm/runtime/deoptimization.hpp	Thu Sep 08 10:12:25 2011 +0200
@@ -137,7 +137,7 @@
     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 @@
     // 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 @@
     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);            }
 
--- a/src/share/vm/runtime/frame.hpp	Wed Sep 07 12:58:42 2011 -0700
+++ b/src/share/vm/runtime/frame.hpp	Thu Sep 08 10:12:25 2011 +0200
@@ -221,6 +221,10 @@
   // 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: