Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/cpu/ppc/vm/bytecodeInterpreter_ppc.hpp
32285 views
/*1* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.2* Copyright 2012, 2013 SAP AG. 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 it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 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 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*23*/2425#ifndef CPU_PPC_VM_BYTECODEINTERPRETER_PPC_HPP26#define CPU_PPC_VM_BYTECODEINTERPRETER_PPC_HPP2728// Platform specific for C++ based Interpreter29#define LOTS_OF_REGS /* Lets interpreter use plenty of registers */3031private:3233// Save the bottom of the stack after frame manager setup. For ease of restoration after return34// from recursive interpreter call.35intptr_t* _frame_bottom; // Saved bottom of frame manager frame.36address _last_Java_pc; // Pc to return to in frame manager.37intptr_t* _last_Java_fp; // frame pointer38intptr_t* _last_Java_sp; // stack pointer39interpreterState _self_link; // Previous interpreter state // sometimes points to self???40double _native_fresult; // Save result of native calls that might return floats.41intptr_t _native_lresult; // Save result of native calls that might return handle/longs.4243public:44address last_Java_pc(void) { return _last_Java_pc; }45intptr_t* last_Java_fp(void) { return _last_Java_fp; }4647static ByteSize native_lresult_offset() {48return byte_offset_of(BytecodeInterpreter, _native_lresult);49}5051static ByteSize native_fresult_offset() {52return byte_offset_of(BytecodeInterpreter, _native_fresult);53}5455static void pd_layout_interpreterState(interpreterState istate, address last_Java_pc, intptr_t* last_Java_fp);5657#define SET_LAST_JAVA_FRAME() THREAD->frame_anchor()->set(istate->_last_Java_sp, istate->_last_Java_pc);58#define RESET_LAST_JAVA_FRAME() THREAD->frame_anchor()->clear();596061// Macros for accessing the stack.62#undef STACK_INT63#undef STACK_FLOAT64#undef STACK_ADDR65#undef STACK_OBJECT66#undef STACK_DOUBLE67#undef STACK_LONG6869// JavaStack Implementation70#define STACK_SLOT(offset) ((address) &topOfStack[-(offset)])71#define STACK_INT(offset) (*((jint*) &topOfStack[-(offset)]))72#define STACK_FLOAT(offset) (*((jfloat *) &topOfStack[-(offset)]))73#define STACK_OBJECT(offset) (*((oop *) &topOfStack [-(offset)]))74#define STACK_DOUBLE(offset) (((VMJavaVal64*) &topOfStack[-(offset)])->d)75#define STACK_LONG(offset) (((VMJavaVal64 *) &topOfStack[-(offset)])->l)7677#define SET_STACK_SLOT(value, offset) (*(intptr_t*)&topOfStack[-(offset)] = *(intptr_t*)(value))78#define SET_STACK_ADDR(value, offset) (*((address *)&topOfStack[-(offset)]) = (value))79#define SET_STACK_INT(value, offset) (*((jint *)&topOfStack[-(offset)]) = (value))80#define SET_STACK_FLOAT(value, offset) (*((jfloat *)&topOfStack[-(offset)]) = (value))81#define SET_STACK_OBJECT(value, offset) (*((oop *)&topOfStack[-(offset)]) = (value))82#define SET_STACK_DOUBLE(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = (value))83#define SET_STACK_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = \84((VMJavaVal64*)(addr))->d)85#define SET_STACK_LONG(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = (value))86#define SET_STACK_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = \87((VMJavaVal64*)(addr))->l)88// JavaLocals implementation8990#define LOCALS_SLOT(offset) ((intptr_t*)&locals[-(offset)])91#define LOCALS_ADDR(offset) ((address)locals[-(offset)])92#define LOCALS_INT(offset) (*(jint*)&(locals[-(offset)]))93#define LOCALS_OBJECT(offset) (cast_to_oop(locals[-(offset)]))94#define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)]))95#define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)]))9697#define SET_LOCALS_SLOT(value, offset) (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value))98#define SET_LOCALS_INT(value, offset) (*((jint *)&locals[-(offset)]) = (value))99#define SET_LOCALS_DOUBLE(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value))100#define SET_LOCALS_LONG(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value))101#define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \102((VMJavaVal64*)(addr))->d)103104105#endif // CPU_PPC_VM_BYTECODEINTERPRETER_PPC_PP106107108