--- a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp Thu Oct 17 20:27:44 2019 +0100
+++ b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp Thu Oct 17 20:53:35 2019 +0100
@@ -55,10 +55,6 @@
#include "oops/method.hpp"
#endif // !PRODUCT
-#ifdef BUILTIN_SIM
-#include "../../../../../../simulator/simulator.hpp"
-#endif
-
// Size of interpreter code. Increase if too small. Interpreter will
// fail with a guarantee ("not enough space for interpreter generation");
// if too small.
@@ -300,9 +296,8 @@
ShouldNotReachHere();
fn = NULL; // unreachable
}
- const int gpargs = 0, rtype = 3;
__ mov(rscratch1, fn);
- __ blrt(rscratch1, gpargs, fpargs, rtype);
+ __ blr(rscratch1);
}
// Abstract method entry
@@ -469,13 +464,6 @@
__ sub(rscratch1, rscratch2, rscratch1, ext::uxtw, 3);
__ andr(sp, rscratch1, -16);
-#ifndef PRODUCT
- // tell the simulator that the method has been reentered
- if (NotifySimulator) {
- __ notify(Assembler::method_reentry);
- }
-#endif
-
__ check_and_handle_popframe(rthread);
__ check_and_handle_earlyret(rthread);
@@ -514,7 +502,7 @@
// only occur on method entry so emit it only for vtos with step 0.
if ((EnableJVMCI || UseAOT) && state == vtos && step == 0) {
Label L;
- __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
+ __ ldrb(rscratch1, Address(rthread, JavaThread::pending_monitorenter_offset()));
__ cbz(rscratch1, L);
// Clear flag.
__ strb(zr, Address(rthread, JavaThread::pending_monitorenter_offset()));
@@ -525,7 +513,7 @@
#ifdef ASSERT
if (EnableJVMCI) {
Label L;
- __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
+ __ ldrb(rscratch1, Address(rthread, JavaThread::pending_monitorenter_offset()));
__ cbz(rscratch1, L);
__ stop("unexpected pending monitor in deopt entry");
__ bind(L);
@@ -886,8 +874,8 @@
}
// Get mirror and store it in the frame as GC root for this Method*
- __ load_mirror(rscratch1, rmethod);
- __ stp(rscratch1, zr, Address(sp, 4 * wordSize));
+ __ load_mirror(r10, rmethod);
+ __ stp(r10, zr, Address(sp, 4 * wordSize));
__ ldr(rcpool, Address(rmethod, Method::const_offset()));
__ ldr(rcpool, Address(rcpool, ConstMethod::constants_offset()));
@@ -1185,12 +1173,6 @@
// initialize fixed part of activation frame
generate_fixed_frame(true);
-#ifndef PRODUCT
- // tell the simulator that a method has been entered
- if (NotifySimulator) {
- __ notify(Assembler::method_entry);
- }
-#endif
// make sure method is native & not abstract
#ifdef ASSERT
@@ -1375,7 +1357,7 @@
__ stlrw(rscratch1, rscratch2);
// Call the native method.
- __ blrt(r10, rscratch1);
+ __ blr(r10);
__ bind(native_return);
__ maybe_isb();
__ get_method(rmethod);
@@ -1415,7 +1397,7 @@
//
__ mov(c_rarg0, rthread);
__ mov(rscratch2, CAST_FROM_FN_PTR(address, JavaThread::check_special_condition_for_native_trans));
- __ blrt(rscratch2, 1, 0, 0);
+ __ blr(rscratch2);
__ maybe_isb();
__ get_method(rmethod);
__ reinit_heapbase();
@@ -1466,7 +1448,7 @@
__ pusha(); // XXX only save smashed registers
__ mov(c_rarg0, rthread);
__ mov(rscratch2, CAST_FROM_FN_PTR(address, SharedRuntime::reguard_yellow_pages));
- __ blrt(rscratch2, 0, 0, 0);
+ __ blr(rscratch2);
__ popa(); // XXX only restore smashed registers
__ bind(no_reguard);
}
@@ -1621,12 +1603,7 @@
// initialize fixed part of activation frame
generate_fixed_frame(false);
-#ifndef PRODUCT
- // tell the simulator that a method has been entered
- if (NotifySimulator) {
- __ notify(Assembler::method_entry);
- }
-#endif
+
// make sure method is not native & not abstract
#ifdef ASSERT
__ ldrw(r0, access_flags);
@@ -1762,13 +1739,6 @@
__ reinit_heapbase(); // restore rheapbase as heapbase.
__ get_dispatch();
-#ifndef PRODUCT
- // tell the simulator that the caller method has been reentered
- if (NotifySimulator) {
- __ get_method(rmethod);
- __ notify(Assembler::method_reentry);
- }
-#endif
// Entry point for exceptions thrown within interpreter code
Interpreter::_throw_exception_entry = __ pc();
// If we came here via a NullPointerException on the receiver of a
@@ -2086,121 +2056,4 @@
__ pop(rscratch1);
}
-#ifdef BUILTIN_SIM
-
-#include <sys/mman.h>
-#include <unistd.h>
-
-extern "C" {
- static int PAGESIZE = getpagesize();
- int is_mapped_address(u_int64_t address)
- {
- address = (address & ~((u_int64_t)PAGESIZE - 1));
- if (msync((void *)address, PAGESIZE, MS_ASYNC) == 0) {
- return true;
- }
- if (errno != ENOMEM) {
- return true;
- }
- return false;
- }
-
- void bccheck1(u_int64_t pc, u_int64_t fp, char *method, int *bcidx, int *framesize, char *decode)
- {
- if (method != 0) {
- method[0] = '\0';
- }
- if (bcidx != 0) {
- *bcidx = -2;
- }
- if (decode != 0) {
- decode[0] = 0;
- }
-
- if (framesize != 0) {
- *framesize = -1;
- }
-
- if (Interpreter::contains((address)pc)) {
- AArch64Simulator *sim = AArch64Simulator::get_current(UseSimulatorCache, DisableBCCheck);
- Method* meth;
- address bcp;
- if (fp) {
-#define FRAME_SLOT_METHOD 3
-#define FRAME_SLOT_BCP 7
- meth = (Method*)sim->getMemory()->loadU64(fp - (FRAME_SLOT_METHOD << 3));
- bcp = (address)sim->getMemory()->loadU64(fp - (FRAME_SLOT_BCP << 3));
-#undef FRAME_SLOT_METHOD
-#undef FRAME_SLOT_BCP
- } else {
- meth = (Method*)sim->getCPUState().xreg(RMETHOD, 0);
- bcp = (address)sim->getCPUState().xreg(RBCP, 0);
- }
- if (meth->is_native()) {
- return;
- }
- if(method && meth->is_method()) {
- ResourceMark rm;
- method[0] = 'I';
- method[1] = ' ';
- meth->name_and_sig_as_C_string(method + 2, 398);
- }
- if (bcidx) {
- if (meth->contains(bcp)) {
- *bcidx = meth->bci_from(bcp);
- } else {
- *bcidx = -2;
- }
- }
- if (decode) {
- if (!BytecodeTracer::closure()) {
- BytecodeTracer::set_closure(BytecodeTracer::std_closure());
- }
- stringStream str(decode, 400);
- BytecodeTracer::trace(meth, bcp, &str);
- }
- } else {
- if (method) {
- CodeBlob *cb = CodeCache::find_blob((address)pc);
- if (cb != NULL) {
- if (cb->is_nmethod()) {
- ResourceMark rm;
- nmethod* nm = (nmethod*)cb;
- method[0] = 'C';
- method[1] = ' ';
- nm->method()->name_and_sig_as_C_string(method + 2, 398);
- } else if (cb->is_adapter_blob()) {
- strcpy(method, "B adapter blob");
- } else if (cb->is_runtime_stub()) {
- strcpy(method, "B runtime stub");
- } else if (cb->is_exception_stub()) {
- strcpy(method, "B exception stub");
- } else if (cb->is_deoptimization_stub()) {
- strcpy(method, "B deoptimization stub");
- } else if (cb->is_safepoint_stub()) {
- strcpy(method, "B safepoint stub");
- } else if (cb->is_uncommon_trap_stub()) {
- strcpy(method, "B uncommon trap stub");
- } else if (cb->contains((address)StubRoutines::call_stub())) {
- strcpy(method, "B call stub");
- } else {
- strcpy(method, "B unknown blob : ");
- strcat(method, cb->name());
- }
- if (framesize != NULL) {
- *framesize = cb->frame_size();
- }
- }
- }
- }
- }
-
-
- JNIEXPORT void bccheck(u_int64_t pc, u_int64_t fp, char *method, int *bcidx, int *framesize, char *decode)
- {
- bccheck1(pc, fp, method, bcidx, framesize, decode);
- }
-}
-
-#endif // BUILTIN_SIM
#endif // !PRODUCT