src/cpu/sparc/vm/interpreter_sparc.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8074457 Sdiff src/cpu/sparc/vm

src/cpu/sparc/vm/interpreter_sparc.cpp

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "asm/macroAssembler.hpp"
  27 #include "interpreter/bytecodeHistogram.hpp"
  28 #include "interpreter/interpreter.hpp"
  29 #include "interpreter/interpreterGenerator.hpp"
  30 #include "interpreter/interpreterRuntime.hpp"
  31 #include "interpreter/interp_masm.hpp"

  32 #include "interpreter/templateTable.hpp"
  33 #include "oops/arrayOop.hpp"
  34 #include "oops/methodData.hpp"
  35 #include "oops/method.hpp"
  36 #include "oops/oop.inline.hpp"
  37 #include "prims/jvmtiExport.hpp"
  38 #include "prims/jvmtiThreadState.hpp"
  39 #include "prims/methodHandles.hpp"
  40 #include "runtime/arguments.hpp"
  41 #include "runtime/frame.inline.hpp"
  42 #include "runtime/sharedRuntime.hpp"
  43 #include "runtime/stubRoutines.hpp"
  44 #include "runtime/synchronizer.hpp"
  45 #include "runtime/timer.hpp"
  46 #include "runtime/vframeArray.hpp"
  47 #include "utilities/debug.hpp"
  48 #ifdef COMPILER1
  49 #include "c1/c1_Runtime1.hpp"
  50 #endif
  51 
  52 
  53 
  54 // Generation of Interpreter
  55 //
  56 // The InterpreterGenerator generates the interpreter into Interpreter::_code.
  57 
  58 
  59 #define __ _masm->
  60 
  61 
  62 //----------------------------------------------------------------------------------------------------
  63 
  64 #ifndef _LP64
  65 address AbstractInterpreterGenerator::generate_slow_signature_handler() {
  66   address entry = __ pc();
  67   Argument argv(0, true);
  68 
  69   // We are in the jni transition frame. Save the last_java_frame corresponding to the
  70   // outer interpreter frame
  71   //
  72   __ set_last_Java_frame(FP, noreg);
  73   // make sure the interpreter frame we've pushed has a valid return pc
  74   __ mov(O7, I7);
  75   __ mov(Lmethod, G3_scratch);
  76   __ mov(Llocals, G4_scratch);


 177     __ ba(NextArg);
 178     __ delayed()->srl( G4_scratch, 2, G4_scratch );
 179 
 180     __ bind(LoadDoubleArg);
 181     __ ldf( FloatRegisterImpl::D, a, ldarg.as_double_register() );
 182     __ ba(NextArg);
 183     __ delayed()->srl( G4_scratch, 2, G4_scratch );
 184 
 185     __ bind(NextArg);
 186 
 187   }
 188 
 189   __ bind(done);
 190   __ ret();
 191   __ delayed()->
 192      restore(O0, 0, Lscratch);  // caller's Lscratch gets the result handler
 193   return entry;
 194 }
 195 #endif
 196 
 197 void InterpreterGenerator::generate_counter_overflow(Label& Lcontinue) {
 198 
 199   // Generate code to initiate compilation on the counter overflow.
 200 
 201   // InterpreterRuntime::frequency_counter_overflow takes two arguments,
 202   // the first indicates if the counter overflow occurs at a backwards branch (NULL bcp)
 203   // and the second is only used when the first is true.  We pass zero for both.
 204   // The call returns the address of the verified entry point for the method or NULL
 205   // if the compilation did not complete (either went background or bailed out).
 206   __ set((int)false, O2);
 207   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), O2, O2, true);
 208   // returns verified_entry_point or NULL
 209   // we ignore it in any case
 210   __ ba_short(Lcontinue);
 211 
 212 }
 213 
 214 
 215 // End of helpers
 216 
 217 // Various method entries
 218 
 219 // Abstract method entry
 220 // Attempt to execute abstract method. Throw exception
 221 //
 222 address InterpreterGenerator::generate_abstract_entry(void) {
 223   address entry = __ pc();
 224   // abstract method entry
 225   // throw exception
 226   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
 227   // the call_VM checks for exception, so we should never return here.
 228   __ should_not_reach_here();
 229   return entry;
 230 
 231 }


   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "asm/macroAssembler.hpp"
  27 #include "interpreter/bytecodeHistogram.hpp"
  28 #include "interpreter/interpreter.hpp"

  29 #include "interpreter/interpreterRuntime.hpp"
  30 #include "interpreter/interp_masm.hpp"
  31 #include "interpreter/templateInterpreterGenerator.hpp"
  32 #include "interpreter/templateTable.hpp"
  33 #include "oops/arrayOop.hpp"
  34 #include "oops/methodData.hpp"
  35 #include "oops/method.hpp"
  36 #include "oops/oop.inline.hpp"
  37 #include "prims/jvmtiExport.hpp"
  38 #include "prims/jvmtiThreadState.hpp"
  39 #include "prims/methodHandles.hpp"
  40 #include "runtime/arguments.hpp"
  41 #include "runtime/frame.inline.hpp"
  42 #include "runtime/sharedRuntime.hpp"
  43 #include "runtime/stubRoutines.hpp"
  44 #include "runtime/synchronizer.hpp"
  45 #include "runtime/timer.hpp"
  46 #include "runtime/vframeArray.hpp"
  47 #include "utilities/debug.hpp"
  48 #ifdef COMPILER1
  49 #include "c1/c1_Runtime1.hpp"
  50 #endif
  51 
  52 
  53 
  54 // Generation of Interpreter
  55 //
  56 // The TemplateInterpreterGenerator generates the interpreter into Interpreter::_code.
  57 
  58 
  59 #define __ _masm->
  60 
  61 
  62 //----------------------------------------------------------------------------------------------------
  63 
  64 #ifndef _LP64
  65 address AbstractInterpreterGenerator::generate_slow_signature_handler() {
  66   address entry = __ pc();
  67   Argument argv(0, true);
  68 
  69   // We are in the jni transition frame. Save the last_java_frame corresponding to the
  70   // outer interpreter frame
  71   //
  72   __ set_last_Java_frame(FP, noreg);
  73   // make sure the interpreter frame we've pushed has a valid return pc
  74   __ mov(O7, I7);
  75   __ mov(Lmethod, G3_scratch);
  76   __ mov(Llocals, G4_scratch);


 177     __ ba(NextArg);
 178     __ delayed()->srl( G4_scratch, 2, G4_scratch );
 179 
 180     __ bind(LoadDoubleArg);
 181     __ ldf( FloatRegisterImpl::D, a, ldarg.as_double_register() );
 182     __ ba(NextArg);
 183     __ delayed()->srl( G4_scratch, 2, G4_scratch );
 184 
 185     __ bind(NextArg);
 186 
 187   }
 188 
 189   __ bind(done);
 190   __ ret();
 191   __ delayed()->
 192      restore(O0, 0, Lscratch);  // caller's Lscratch gets the result handler
 193   return entry;
 194 }
 195 #endif
 196 
 197 void TemplateInterpreterGenerator::generate_counter_overflow(Label& Lcontinue) {
 198 
 199   // Generate code to initiate compilation on the counter overflow.
 200 
 201   // InterpreterRuntime::frequency_counter_overflow takes two arguments,
 202   // the first indicates if the counter overflow occurs at a backwards branch (NULL bcp)
 203   // and the second is only used when the first is true.  We pass zero for both.
 204   // The call returns the address of the verified entry point for the method or NULL
 205   // if the compilation did not complete (either went background or bailed out).
 206   __ set((int)false, O2);
 207   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), O2, O2, true);
 208   // returns verified_entry_point or NULL
 209   // we ignore it in any case
 210   __ ba_short(Lcontinue);
 211 
 212 }
 213 
 214 
 215 // End of helpers
 216 
 217 // Various method entries
 218 
 219 // Abstract method entry
 220 // Attempt to execute abstract method. Throw exception
 221 //
 222 address TemplateInterpreterGenerator::generate_abstract_entry(void) {
 223   address entry = __ pc();
 224   // abstract method entry
 225   // throw exception
 226   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
 227   // the call_VM checks for exception, so we should never return here.
 228   __ should_not_reach_here();
 229   return entry;
 230 
 231 }
src/cpu/sparc/vm/interpreter_sparc.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File