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/method.hpp"
41 #include "oops/methodCounters.hpp"
42 #include "oops/methodData.hpp"
43 #include "oops/oop.inline.hpp"
44 #include "oops/resolvedIndyEntry.hpp"
45 #include "oops/resolvedMethodEntry.hpp"
46 #include "prims/jvmtiExport.hpp"
47 #include "prims/jvmtiThreadState.hpp"
48 #include "runtime/arguments.hpp"
49 #include "runtime/deoptimization.hpp"
50 #include "runtime/frame.inline.hpp"
51 #include "runtime/globals.hpp"
52 #include "runtime/jniHandles.hpp"
53 #include "runtime/sharedRuntime.hpp"
54 #include "runtime/stubRoutines.hpp"
55 #include "runtime/synchronizer.hpp"
56 #include "runtime/timer.hpp"
57 #include "runtime/vframeArray.hpp"
58 #include "utilities/checkedCast.hpp"
59 #include "utilities/debug.hpp"
60 #include "utilities/powerOfTwo.hpp"
61 #include <sys/types.h>
62
63 // Size of interpreter code. Increase if too small. Interpreter will
456 } else {
457 __ mov(c_rarg2, NULL_WORD);
458 }
459 __ call_VM(r0,
460 CAST_FROM_FN_PTR(address, InterpreterRuntime::create_exception),
461 c_rarg1, c_rarg2);
462 }
463 // throw exception
464 __ b(address(Interpreter::throw_exception_entry()));
465 return entry;
466 }
467
468 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
469 address entry = __ pc();
470
471 // Restore stack bottom in case i2c adjusted stack
472 __ ldr(rscratch1, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
473 __ lea(esp, Address(rfp, rscratch1, Address::lsl(Interpreter::logStackElementSize)));
474 // and null it as marker that esp is now tos until next java call
475 __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
476 __ restore_bcp();
477 __ restore_locals();
478 __ restore_constant_pool_cache();
479 __ get_method(rmethod);
480
481 if (state == atos) {
482 Register obj = r0;
483 Register mdp = r1;
484 Register tmp = r2;
485 __ profile_return_type(mdp, obj, tmp);
486 }
487
488 const Register cache = r1;
489 const Register index = r2;
490
491 if (index_size == sizeof(u4)) {
492 __ load_resolved_indy_entry(cache, index);
493 __ load_unsigned_short(cache, Address(cache, in_bytes(ResolvedIndyEntry::num_parameters_offset())));
494 __ add(esp, esp, cache, Assembler::LSL, 3);
495 } else {
|
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/method.hpp"
41 #include "oops/methodCounters.hpp"
42 #include "oops/methodData.hpp"
43 #include "oops/oop.inline.hpp"
44 #include "oops/inlineKlass.hpp"
45 #include "oops/resolvedIndyEntry.hpp"
46 #include "oops/resolvedMethodEntry.hpp"
47 #include "prims/jvmtiExport.hpp"
48 #include "prims/jvmtiThreadState.hpp"
49 #include "runtime/arguments.hpp"
50 #include "runtime/deoptimization.hpp"
51 #include "runtime/frame.inline.hpp"
52 #include "runtime/globals.hpp"
53 #include "runtime/jniHandles.hpp"
54 #include "runtime/sharedRuntime.hpp"
55 #include "runtime/stubRoutines.hpp"
56 #include "runtime/synchronizer.hpp"
57 #include "runtime/timer.hpp"
58 #include "runtime/vframeArray.hpp"
59 #include "utilities/checkedCast.hpp"
60 #include "utilities/debug.hpp"
61 #include "utilities/powerOfTwo.hpp"
62 #include <sys/types.h>
63
64 // Size of interpreter code. Increase if too small. Interpreter will
457 } else {
458 __ mov(c_rarg2, NULL_WORD);
459 }
460 __ call_VM(r0,
461 CAST_FROM_FN_PTR(address, InterpreterRuntime::create_exception),
462 c_rarg1, c_rarg2);
463 }
464 // throw exception
465 __ b(address(Interpreter::throw_exception_entry()));
466 return entry;
467 }
468
469 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
470 address entry = __ pc();
471
472 // Restore stack bottom in case i2c adjusted stack
473 __ ldr(rscratch1, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
474 __ lea(esp, Address(rfp, rscratch1, Address::lsl(Interpreter::logStackElementSize)));
475 // and null it as marker that esp is now tos until next java call
476 __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
477
478 if (state == atos && InlineTypeReturnedAsFields) {
479 __ store_inline_type_fields_to_buf(nullptr, true);
480 }
481
482 __ restore_bcp();
483 __ restore_locals();
484 __ restore_constant_pool_cache();
485 __ get_method(rmethod);
486
487 if (state == atos) {
488 Register obj = r0;
489 Register mdp = r1;
490 Register tmp = r2;
491 __ profile_return_type(mdp, obj, tmp);
492 }
493
494 const Register cache = r1;
495 const Register index = r2;
496
497 if (index_size == sizeof(u4)) {
498 __ load_resolved_indy_entry(cache, index);
499 __ load_unsigned_short(cache, Address(cache, in_bytes(ResolvedIndyEntry::num_parameters_offset())));
500 __ add(esp, esp, cache, Assembler::LSL, 3);
501 } else {
|