< prev index next >

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Print this page

  23  *
  24  */
  25 
  26 #include "precompiled.hpp"
  27 #include "asm/macroAssembler.inline.hpp"
  28 #include "classfile/javaClasses.hpp"
  29 #include "compiler/compiler_globals.hpp"
  30 #include "gc/shared/barrierSetAssembler.hpp"
  31 #include "interpreter/bytecodeHistogram.hpp"
  32 #include "interpreter/interpreter.hpp"
  33 #include "interpreter/interpreterRuntime.hpp"
  34 #include "interpreter/interp_masm.hpp"
  35 #include "interpreter/templateInterpreterGenerator.hpp"
  36 #include "interpreter/templateTable.hpp"
  37 #include "interpreter/bytecodeTracer.hpp"
  38 #include "memory/resourceArea.hpp"
  39 #include "oops/arrayOop.hpp"
  40 #include "oops/methodData.hpp"
  41 #include "oops/method.hpp"
  42 #include "oops/oop.inline.hpp"

  43 #include "prims/jvmtiExport.hpp"
  44 #include "prims/jvmtiThreadState.hpp"
  45 #include "runtime/arguments.hpp"
  46 #include "runtime/deoptimization.hpp"
  47 #include "runtime/frame.inline.hpp"
  48 #include "runtime/jniHandles.hpp"
  49 #include "runtime/sharedRuntime.hpp"
  50 #include "runtime/stubRoutines.hpp"
  51 #include "runtime/synchronizer.hpp"
  52 #include "runtime/timer.hpp"
  53 #include "runtime/vframeArray.hpp"
  54 #include "utilities/debug.hpp"
  55 #include "utilities/powerOfTwo.hpp"
  56 #include <sys/types.h>
  57 
  58 #ifndef PRODUCT
  59 #include "oops/method.hpp"
  60 #endif // !PRODUCT
  61 
  62 // Size of interpreter code.  Increase if too small.  Interpreter will

 421       __ lea(c_rarg2, Address((address)message));
 422     } else {
 423       __ mov(c_rarg2, NULL_WORD);
 424     }
 425     __ call_VM(r0,
 426                CAST_FROM_FN_PTR(address, InterpreterRuntime::create_exception),
 427                c_rarg1, c_rarg2);
 428   }
 429   // throw exception
 430   __ b(address(Interpreter::throw_exception_entry()));
 431   return entry;
 432 }
 433 
 434 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
 435   address entry = __ pc();
 436 
 437   // Restore stack bottom in case i2c adjusted stack
 438   __ ldr(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 439   // and NULL it as marker that esp is now tos until next java call
 440   __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));





 441   __ restore_bcp();
 442   __ restore_locals();
 443   __ restore_constant_pool_cache();
 444   __ get_method(rmethod);
 445 
 446   if (state == atos) {
 447     Register obj = r0;
 448     Register mdp = r1;
 449     Register tmp = r2;
 450     __ profile_return_type(mdp, obj, tmp);
 451   }
 452 
 453   // Pop N words from the stack
 454   __ get_cache_and_index_at_bcp(r1, r2, 1, index_size);
 455   __ ldr(r1, Address(r1, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset()));
 456   __ andr(r1, r1, ConstantPoolCacheEntry::parameter_size_mask);
 457 
 458   __ add(esp, esp, r1, Assembler::LSL, 3);
 459 
 460   // Restore machine SP

 539     __ dispatch_next(state, step);
 540   } else {
 541     __ jump_to_entry(continuation);
 542   }
 543   return entry;
 544 }
 545 
 546 address TemplateInterpreterGenerator::generate_result_handler_for(
 547         BasicType type) {
 548     address entry = __ pc();
 549   switch (type) {
 550   case T_BOOLEAN: __ c2bool(r0);         break;
 551   case T_CHAR   : __ uxth(r0, r0);       break;
 552   case T_BYTE   : __ sxtb(r0, r0);        break;
 553   case T_SHORT  : __ sxth(r0, r0);        break;
 554   case T_INT    : __ uxtw(r0, r0);        break;  // FIXME: We almost certainly don't need this
 555   case T_LONG   : /* nothing to do */        break;
 556   case T_VOID   : /* nothing to do */        break;
 557   case T_FLOAT  : /* nothing to do */        break;
 558   case T_DOUBLE : /* nothing to do */        break;

 559   case T_OBJECT :
 560     // retrieve result from frame
 561     __ ldr(r0, Address(rfp, frame::interpreter_frame_oop_temp_offset*wordSize));
 562     // and verify it
 563     __ verify_oop(r0);
 564     break;
 565   default       : ShouldNotReachHere();
 566   }
 567   __ ret(lr);                                  // return from result handler
 568   return entry;
 569 }
 570 
 571 address TemplateInterpreterGenerator::generate_safept_entry_for(
 572         TosState state,
 573         address runtime_entry) {
 574   address entry = __ pc();
 575   __ push(state);
 576   __ call_VM(noreg, runtime_entry);
 577   __ membar(Assembler::AnyAny);
 578   __ dispatch_via(vtos, Interpreter::_normal_table.table_for(vtos));

  23  *
  24  */
  25 
  26 #include "precompiled.hpp"
  27 #include "asm/macroAssembler.inline.hpp"
  28 #include "classfile/javaClasses.hpp"
  29 #include "compiler/compiler_globals.hpp"
  30 #include "gc/shared/barrierSetAssembler.hpp"
  31 #include "interpreter/bytecodeHistogram.hpp"
  32 #include "interpreter/interpreter.hpp"
  33 #include "interpreter/interpreterRuntime.hpp"
  34 #include "interpreter/interp_masm.hpp"
  35 #include "interpreter/templateInterpreterGenerator.hpp"
  36 #include "interpreter/templateTable.hpp"
  37 #include "interpreter/bytecodeTracer.hpp"
  38 #include "memory/resourceArea.hpp"
  39 #include "oops/arrayOop.hpp"
  40 #include "oops/methodData.hpp"
  41 #include "oops/method.hpp"
  42 #include "oops/oop.inline.hpp"
  43 #include "oops/inlineKlass.hpp"
  44 #include "prims/jvmtiExport.hpp"
  45 #include "prims/jvmtiThreadState.hpp"
  46 #include "runtime/arguments.hpp"
  47 #include "runtime/deoptimization.hpp"
  48 #include "runtime/frame.inline.hpp"
  49 #include "runtime/jniHandles.hpp"
  50 #include "runtime/sharedRuntime.hpp"
  51 #include "runtime/stubRoutines.hpp"
  52 #include "runtime/synchronizer.hpp"
  53 #include "runtime/timer.hpp"
  54 #include "runtime/vframeArray.hpp"
  55 #include "utilities/debug.hpp"
  56 #include "utilities/powerOfTwo.hpp"
  57 #include <sys/types.h>
  58 
  59 #ifndef PRODUCT
  60 #include "oops/method.hpp"
  61 #endif // !PRODUCT
  62 
  63 // Size of interpreter code.  Increase if too small.  Interpreter will

 422       __ lea(c_rarg2, Address((address)message));
 423     } else {
 424       __ mov(c_rarg2, NULL_WORD);
 425     }
 426     __ call_VM(r0,
 427                CAST_FROM_FN_PTR(address, InterpreterRuntime::create_exception),
 428                c_rarg1, c_rarg2);
 429   }
 430   // throw exception
 431   __ b(address(Interpreter::throw_exception_entry()));
 432   return entry;
 433 }
 434 
 435 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
 436   address entry = __ pc();
 437 
 438   // Restore stack bottom in case i2c adjusted stack
 439   __ ldr(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 440   // and NULL it as marker that esp is now tos until next java call
 441   __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 442 
 443   if (state == atos && InlineTypeReturnedAsFields) {
 444     __ store_inline_type_fields_to_buf(NULL, true);
 445   }
 446 
 447   __ restore_bcp();
 448   __ restore_locals();
 449   __ restore_constant_pool_cache();
 450   __ get_method(rmethod);
 451 
 452   if (state == atos) {
 453     Register obj = r0;
 454     Register mdp = r1;
 455     Register tmp = r2;
 456     __ profile_return_type(mdp, obj, tmp);
 457   }
 458 
 459   // Pop N words from the stack
 460   __ get_cache_and_index_at_bcp(r1, r2, 1, index_size);
 461   __ ldr(r1, Address(r1, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset()));
 462   __ andr(r1, r1, ConstantPoolCacheEntry::parameter_size_mask);
 463 
 464   __ add(esp, esp, r1, Assembler::LSL, 3);
 465 
 466   // Restore machine SP

 545     __ dispatch_next(state, step);
 546   } else {
 547     __ jump_to_entry(continuation);
 548   }
 549   return entry;
 550 }
 551 
 552 address TemplateInterpreterGenerator::generate_result_handler_for(
 553         BasicType type) {
 554     address entry = __ pc();
 555   switch (type) {
 556   case T_BOOLEAN: __ c2bool(r0);         break;
 557   case T_CHAR   : __ uxth(r0, r0);       break;
 558   case T_BYTE   : __ sxtb(r0, r0);        break;
 559   case T_SHORT  : __ sxth(r0, r0);        break;
 560   case T_INT    : __ uxtw(r0, r0);        break;  // FIXME: We almost certainly don't need this
 561   case T_LONG   : /* nothing to do */        break;
 562   case T_VOID   : /* nothing to do */        break;
 563   case T_FLOAT  : /* nothing to do */        break;
 564   case T_DOUBLE : /* nothing to do */        break;
 565   case T_INLINE_TYPE: // fall through (value types are handled with oops)
 566   case T_OBJECT :
 567     // retrieve result from frame
 568     __ ldr(r0, Address(rfp, frame::interpreter_frame_oop_temp_offset*wordSize));
 569     // and verify it
 570     __ verify_oop(r0);
 571     break;
 572   default       : ShouldNotReachHere();
 573   }
 574   __ ret(lr);                                  // return from result handler
 575   return entry;
 576 }
 577 
 578 address TemplateInterpreterGenerator::generate_safept_entry_for(
 579         TosState state,
 580         address runtime_entry) {
 581   address entry = __ pc();
 582   __ push(state);
 583   __ call_VM(noreg, runtime_entry);
 584   __ membar(Assembler::AnyAny);
 585   __ dispatch_via(vtos, Interpreter::_normal_table.table_for(vtos));
< prev index next >