1 /*
2 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
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 *
1376 jframe->locinf = 0;
1377
1378 read_volatiles(J);
1379 pc = (uintptr_t) regs[R_PC];
1380 J->curr_fr.pc = pc;
1381 J->curr_fr.fp = regs[R_FP];
1382 J->curr_fr.sp = regs[R_SP];
1383
1384 if (debug)
1385 fprintf(stderr, "Jlookup_by_regs: BEGINs: fp=%#lx, pc=%#lx\n", regs[R_FP], pc);
1386
1387 #if defined(sparc) || defined(__sparc)
1388 /* The following workaround is for SPARC. CALL instruction occupates 8 bytes.
1389 * In the pcDesc structure return pc offset is recorded for CALL instructions.
1390 * regs[R_PC] contains a CALL instruction pc offset.
1391 */
1392 pc += 8;
1393 bcp = (uintptr_t) regs[R_L1];
1394 methodPtr = (uintptr_t) regs[R_L2];
1395 sender_sp = regs[R_I5];
1396 if (debug > 2) {
1397 fprintf(stderr, "\nregs[R_I1]=%lx, regs[R_I2]=%lx, regs[R_I5]=%lx, regs[R_L1]=%lx, regs[R_L2]=%lx\n",
1398 regs[R_I1], regs[R_I2], regs[R_I5], regs[R_L1], regs[R_L2]);
1399 }
1400 #elif defined(i386) || defined(__i386) || defined(__amd64)
1401
1402 fp = (uintptr_t) regs[R_FP];
1403 if (J->prev_fr.fp == 0) {
1404 #ifdef X86_COMPILER2
1405 /* A workaround for top java frames */
1406 J->prev_fr.fp = (uintptr_t)(regs[R_SP] - 2 * POINTER_SIZE);
1407 #else
1408 J->prev_fr.fp = (uintptr_t)(regs[R_SP] - POINTER_SIZE);
1409 #endif /* COMPILER2 */
1410 }
1411 if (debug > 2) {
1412 printf("Jlookup_by_regs: J->prev_fr.fp = %#lx\n", J->prev_fr.fp);
1413 }
1414
1415 if (read_pointer(J, fp + OFFSET_interpreter_frame_method, &methodPtr) != PS_OK) {
|
1 /*
2 * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
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 *
1376 jframe->locinf = 0;
1377
1378 read_volatiles(J);
1379 pc = (uintptr_t) regs[R_PC];
1380 J->curr_fr.pc = pc;
1381 J->curr_fr.fp = regs[R_FP];
1382 J->curr_fr.sp = regs[R_SP];
1383
1384 if (debug)
1385 fprintf(stderr, "Jlookup_by_regs: BEGINs: fp=%#lx, pc=%#lx\n", regs[R_FP], pc);
1386
1387 #if defined(sparc) || defined(__sparc)
1388 /* The following workaround is for SPARC. CALL instruction occupates 8 bytes.
1389 * In the pcDesc structure return pc offset is recorded for CALL instructions.
1390 * regs[R_PC] contains a CALL instruction pc offset.
1391 */
1392 pc += 8;
1393 bcp = (uintptr_t) regs[R_L1];
1394 methodPtr = (uintptr_t) regs[R_L2];
1395 sender_sp = regs[R_I5];
1396 fp = (uintptr_t) regs[R_FP];
1397 if (debug > 2) {
1398 fprintf(stderr, "\nregs[R_I1]=%lx, regs[R_I2]=%lx, regs[R_I5]=%lx, regs[R_L1]=%lx, regs[R_L2]=%lx\n",
1399 regs[R_I1], regs[R_I2], regs[R_I5], regs[R_L1], regs[R_L2]);
1400 }
1401 #elif defined(i386) || defined(__i386) || defined(__amd64)
1402
1403 fp = (uintptr_t) regs[R_FP];
1404 if (J->prev_fr.fp == 0) {
1405 #ifdef X86_COMPILER2
1406 /* A workaround for top java frames */
1407 J->prev_fr.fp = (uintptr_t)(regs[R_SP] - 2 * POINTER_SIZE);
1408 #else
1409 J->prev_fr.fp = (uintptr_t)(regs[R_SP] - POINTER_SIZE);
1410 #endif /* COMPILER2 */
1411 }
1412 if (debug > 2) {
1413 printf("Jlookup_by_regs: J->prev_fr.fp = %#lx\n", J->prev_fr.fp);
1414 }
1415
1416 if (read_pointer(J, fp + OFFSET_interpreter_frame_method, &methodPtr) != PS_OK) {
|