0N/A/*
1879N/A * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
1879N/A#ifndef CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP
1879N/A#define CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP
1879N/A
0N/A// Platform specific for C++ based Interpreter
0N/A#define LOTS_OF_REGS /* Lets interpreter use plenty of registers */
0N/A
0N/Aprivate:
0N/A
0N/A // save the bottom of the stack after frame manager setup. For ease of restoration after return
0N/A // from recursive interpreter call
0N/A intptr_t* _frame_bottom; /* saved bottom of frame manager frame */
0N/A intptr_t* _last_Java_pc; /* pc to return to in frame manager */
0N/A interpreterState _self_link; /* Previous interpreter state */ /* sometimes points to self??? */
0N/A double _native_fresult; /* save result of native calls that might return floats */
0N/A intptr_t _native_lresult; /* save result of native calls that might return handle/longs */
0N/Apublic:
0N/A
0N/A static void pd_layout_interpreterState(interpreterState istate, address last_Java_pc, intptr_t* last_Java_fp);
0N/A
0N/A
0N/A#define SET_LAST_JAVA_FRAME()
0N/A
0N/A#define RESET_LAST_JAVA_FRAME() THREAD->frame_anchor()->set_flags(0);
0N/A
0N/A/*
0N/A * Macros for accessing the stack.
0N/A */
0N/A#undef STACK_INT
0N/A#undef STACK_FLOAT
0N/A#undef STACK_ADDR
0N/A#undef STACK_OBJECT
0N/A#undef STACK_DOUBLE
0N/A#undef STACK_LONG
0N/A// JavaStack Implementation
0N/A
0N/A
0N/A#define GET_STACK_SLOT(offset) (*((intptr_t*) &topOfStack[-(offset)]))
0N/A#define STACK_SLOT(offset) ((address) &topOfStack[-(offset)])
0N/A#define STACK_ADDR(offset) (*((address *) &topOfStack[-(offset)]))
0N/A#define STACK_INT(offset) (*((jint*) &topOfStack[-(offset)]))
0N/A#define STACK_FLOAT(offset) (*((jfloat *) &topOfStack[-(offset)]))
0N/A#define STACK_OBJECT(offset) (*((oop *) &topOfStack [-(offset)]))
0N/A#define STACK_DOUBLE(offset) (((VMJavaVal64*) &topOfStack[-(offset)])->d)
0N/A#define STACK_LONG(offset) (((VMJavaVal64 *) &topOfStack[-(offset)])->l)
0N/A
0N/A#define SET_STACK_SLOT(value, offset) (*(intptr_t*)&topOfStack[-(offset)] = *(intptr_t*)(value))
0N/A#define SET_STACK_ADDR(value, offset) (*((address *)&topOfStack[-(offset)]) = (value))
0N/A#define SET_STACK_INT(value, offset) (*((jint *)&topOfStack[-(offset)]) = (value))
0N/A#define SET_STACK_FLOAT(value, offset) (*((jfloat *)&topOfStack[-(offset)]) = (value))
0N/A#define SET_STACK_OBJECT(value, offset) (*((oop *)&topOfStack[-(offset)]) = (value))
0N/A#define SET_STACK_DOUBLE(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = (value))
0N/A#define SET_STACK_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = \
0N/A ((VMJavaVal64*)(addr))->d)
0N/A#define SET_STACK_LONG(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = (value))
0N/A#define SET_STACK_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = \
0N/A ((VMJavaVal64*)(addr))->l)
0N/A
0N/A#define LOCALS_SLOT(offset) ((intptr_t*)&locals[-(offset)])
0N/A#define LOCALS_ADDR(offset) ((address)locals[-(offset)])
123N/A#define LOCALS_INT(offset) (*((jint*)&locals[-(offset)]))
0N/A#define LOCALS_FLOAT(offset) (*((jfloat*)&locals[-(offset)]))
0N/A#define LOCALS_OBJECT(offset) ((oop)locals[-(offset)])
0N/A#define LOCALS_DOUBLE(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->d)
0N/A#define LOCALS_LONG(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->l)
0N/A#define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)]))
0N/A#define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)]))
0N/A
0N/A#define SET_LOCALS_SLOT(value, offset) (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value))
0N/A#define SET_LOCALS_ADDR(value, offset) (*((address *)&locals[-(offset)]) = (value))
0N/A#define SET_LOCALS_INT(value, offset) (*((jint *)&locals[-(offset)]) = (value))
0N/A#define SET_LOCALS_FLOAT(value, offset) (*((jfloat *)&locals[-(offset)]) = (value))
0N/A#define SET_LOCALS_OBJECT(value, offset) (*((oop *)&locals[-(offset)]) = (value))
0N/A#define SET_LOCALS_DOUBLE(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value))
0N/A#define SET_LOCALS_LONG(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value))
0N/A#define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \
0N/A ((VMJavaVal64*)(addr))->d)
0N/A#define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \
0N/A ((VMJavaVal64*)(addr))->l)
1879N/A
1879N/A#endif // CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP