< prev index next >

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Print this page




  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #include "precompiled.hpp"
  27 #include "asm/macroAssembler.inline.hpp"
  28 #include "gc/shared/barrierSetAssembler.hpp"
  29 #include "interpreter/bytecodeHistogram.hpp"
  30 #include "interpreter/interpreter.hpp"
  31 #include "interpreter/interpreterRuntime.hpp"
  32 #include "interpreter/interp_masm.hpp"
  33 #include "interpreter/templateInterpreterGenerator.hpp"
  34 #include "interpreter/templateTable.hpp"
  35 #include "interpreter/bytecodeTracer.hpp"
  36 #include "memory/resourceArea.hpp"
  37 #include "oops/arrayOop.hpp"
  38 #include "oops/methodData.hpp"
  39 #include "oops/method.hpp"
  40 #include "oops/oop.inline.hpp"

  41 #include "prims/jvmtiExport.hpp"
  42 #include "prims/jvmtiThreadState.hpp"
  43 #include "runtime/arguments.hpp"
  44 #include "runtime/deoptimization.hpp"
  45 #include "runtime/frame.inline.hpp"
  46 #include "runtime/sharedRuntime.hpp"
  47 #include "runtime/stubRoutines.hpp"
  48 #include "runtime/synchronizer.hpp"
  49 #include "runtime/timer.hpp"
  50 #include "runtime/vframeArray.hpp"
  51 #include "utilities/debug.hpp"
  52 #include <sys/types.h>
  53 
  54 #ifndef PRODUCT
  55 #include "oops/method.hpp"
  56 #endif // !PRODUCT
  57 
  58 #ifdef BUILTIN_SIM
  59 #include "../../../../../../simulator/simulator.hpp"
  60 #endif


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





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


 549     __ dispatch_next(state, step);
 550   } else {
 551     __ jump_to_entry(continuation);
 552   }
 553   return entry;
 554 }
 555 
 556 address TemplateInterpreterGenerator::generate_result_handler_for(
 557         BasicType type) {
 558     address entry = __ pc();
 559   switch (type) {
 560   case T_BOOLEAN: __ c2bool(r0);         break;
 561   case T_CHAR   : __ uxth(r0, r0);       break;
 562   case T_BYTE   : __ sxtb(r0, r0);        break;
 563   case T_SHORT  : __ sxth(r0, r0);        break;
 564   case T_INT    : __ uxtw(r0, r0);        break;  // FIXME: We almost certainly don't need this
 565   case T_LONG   : /* nothing to do */        break;
 566   case T_VOID   : /* nothing to do */        break;
 567   case T_FLOAT  : /* nothing to do */        break;
 568   case T_DOUBLE : /* nothing to do */        break;

 569   case T_OBJECT :
 570     // retrieve result from frame
 571     __ ldr(r0, Address(rfp, frame::interpreter_frame_oop_temp_offset*wordSize));
 572     // and verify it
 573     __ verify_oop(r0);
 574     break;
 575   default       : ShouldNotReachHere();
 576   }
 577   __ ret(lr);                                  // return from result handler
 578   return entry;
 579 }
 580 
 581 address TemplateInterpreterGenerator::generate_safept_entry_for(
 582         TosState state,
 583         address runtime_entry) {
 584   address entry = __ pc();
 585   __ push(state);
 586   __ call_VM(noreg, runtime_entry);
 587   __ membar(Assembler::AnyAny);
 588   __ dispatch_via(vtos, Interpreter::_normal_table.table_for(vtos));




  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #include "precompiled.hpp"
  27 #include "asm/macroAssembler.inline.hpp"
  28 #include "gc/shared/barrierSetAssembler.hpp"
  29 #include "interpreter/bytecodeHistogram.hpp"
  30 #include "interpreter/interpreter.hpp"
  31 #include "interpreter/interpreterRuntime.hpp"
  32 #include "interpreter/interp_masm.hpp"
  33 #include "interpreter/templateInterpreterGenerator.hpp"
  34 #include "interpreter/templateTable.hpp"
  35 #include "interpreter/bytecodeTracer.hpp"
  36 #include "memory/resourceArea.hpp"
  37 #include "oops/arrayOop.hpp"
  38 #include "oops/methodData.hpp"
  39 #include "oops/method.hpp"
  40 #include "oops/oop.inline.hpp"
  41 #include "oops/valueKlass.hpp"
  42 #include "prims/jvmtiExport.hpp"
  43 #include "prims/jvmtiThreadState.hpp"
  44 #include "runtime/arguments.hpp"
  45 #include "runtime/deoptimization.hpp"
  46 #include "runtime/frame.inline.hpp"
  47 #include "runtime/sharedRuntime.hpp"
  48 #include "runtime/stubRoutines.hpp"
  49 #include "runtime/synchronizer.hpp"
  50 #include "runtime/timer.hpp"
  51 #include "runtime/vframeArray.hpp"
  52 #include "utilities/debug.hpp"
  53 #include <sys/types.h>
  54 
  55 #ifndef PRODUCT
  56 #include "oops/method.hpp"
  57 #endif // !PRODUCT
  58 
  59 #ifdef BUILTIN_SIM
  60 #include "../../../../../../simulator/simulator.hpp"
  61 #endif


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


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


< prev index next >