aoqi@0: /* aoqi@0: * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: * aoqi@0: */ aoqi@0: aoqi@0: #ifndef SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_HPP aoqi@0: #define SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_HPP aoqi@0: aoqi@0: #include "memory/allocation.hpp" aoqi@0: #include "oops/methodData.hpp" aoqi@0: #include "oops/method.hpp" aoqi@0: #include "runtime/basicLock.hpp" aoqi@0: #include "runtime/frame.hpp" aoqi@0: #include "runtime/globals.hpp" aoqi@0: #include "utilities/globalDefinitions.hpp" aoqi@0: #ifdef TARGET_ARCH_x86 aoqi@0: # include "bytes_x86.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_sparc aoqi@0: # include "bytes_sparc.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_zero aoqi@0: # include "bytes_zero.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_arm aoqi@0: # include "bytes_arm.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_ppc aoqi@0: # include "bytes_ppc.hpp" aoqi@0: #endif aoqi@0: aoqi@0: #ifdef CC_INTERP aoqi@0: aoqi@0: // JavaStack Implementation aoqi@0: #define MORE_STACK(count) \ aoqi@0: (topOfStack -= ((count) * Interpreter::stackElementWords)) aoqi@0: aoqi@0: // CVM definitions find hotspot equivalents... aoqi@0: aoqi@0: union VMJavaVal64 { aoqi@0: jlong l; aoqi@0: jdouble d; aoqi@0: uint32_t v[2]; aoqi@0: }; aoqi@0: aoqi@0: aoqi@0: typedef class BytecodeInterpreter* interpreterState; aoqi@0: aoqi@0: struct call_message { aoqi@0: class Method* _callee; // method to call during call_method request aoqi@0: address _callee_entry_point; // address to jump to for call_method request aoqi@0: int _bcp_advance; // size of the invoke bytecode operation aoqi@0: }; aoqi@0: aoqi@0: struct osr_message { aoqi@0: address _osr_buf; // the osr buffer aoqi@0: address _osr_entry; // the entry to the osr method aoqi@0: }; aoqi@0: aoqi@0: struct osr_result { aoqi@0: nmethod* nm; // osr nmethod aoqi@0: address return_addr; // osr blob return address aoqi@0: }; aoqi@0: aoqi@0: // Result returned to frame manager aoqi@0: union frame_manager_message { aoqi@0: call_message _to_call; // describes callee aoqi@0: osr_message _osr; // describes the osr aoqi@0: osr_result _osr_result; // result of OSR request aoqi@0: }; aoqi@0: aoqi@0: class BytecodeInterpreter : StackObj { aoqi@0: friend class SharedRuntime; aoqi@0: friend class AbstractInterpreterGenerator; aoqi@0: friend class CppInterpreterGenerator; aoqi@0: friend class InterpreterGenerator; aoqi@0: friend class InterpreterMacroAssembler; aoqi@0: friend class frame; aoqi@0: friend class VMStructs; aoqi@0: aoqi@0: public: aoqi@0: enum messages { aoqi@0: no_request = 0, // unused aoqi@0: initialize, // Perform one time interpreter initializations (assumes all switches set) aoqi@0: // status message to C++ interpreter aoqi@0: method_entry, // initial method entry to interpreter aoqi@0: method_resume, // frame manager response to return_from_method request (assuming a frame to resume) aoqi@0: deopt_resume, // returning from a native call into a deopted frame aoqi@0: deopt_resume2, // deopt resume as a result of a PopFrame aoqi@0: got_monitors, // frame manager response to more_monitors request aoqi@0: rethrow_exception, // unwinding and throwing exception aoqi@0: // requests to frame manager from C++ interpreter aoqi@0: call_method, // request for new frame from interpreter, manager responds with method_entry aoqi@0: return_from_method, // request from interpreter to unwind, manager responds with method_continue aoqi@0: more_monitors, // need a new monitor aoqi@0: throwing_exception, // unwind stack and rethrow aoqi@0: popping_frame, // unwind call and retry call aoqi@0: do_osr, // request this invocation be OSR's aoqi@0: early_return // early return as commanded by jvmti aoqi@0: }; aoqi@0: aoqi@0: private: aoqi@0: JavaThread* _thread; // the vm's java thread pointer aoqi@0: address _bcp; // instruction pointer aoqi@0: intptr_t* _locals; // local variable pointer aoqi@0: ConstantPoolCache* _constants; // constant pool cache aoqi@0: Method* _method; // method being executed aoqi@0: DataLayout* _mdx; // compiler profiling data for current bytecode aoqi@0: intptr_t* _stack; // expression stack aoqi@0: messages _msg; // frame manager <-> interpreter message aoqi@0: frame_manager_message _result; // result to frame manager aoqi@0: interpreterState _prev_link; // previous interpreter state aoqi@0: oop _oop_temp; // mirror for interpreted native, null otherwise aoqi@0: intptr_t* _stack_base; // base of expression stack aoqi@0: intptr_t* _stack_limit; // limit of expression stack aoqi@0: BasicObjectLock* _monitor_base; // base of monitors on the native stack aoqi@0: aoqi@0: aoqi@0: public: aoqi@0: // Constructor is only used by the initialization step. All other instances are created aoqi@0: // by the frame manager. aoqi@0: BytecodeInterpreter(messages msg); aoqi@0: aoqi@0: // aoqi@0: // Deoptimization support aoqi@0: // aoqi@0: static void layout_interpreterState(interpreterState to_fill, aoqi@0: frame* caller, aoqi@0: frame* interpreter_frame, aoqi@0: Method* method, aoqi@0: intptr_t* locals, aoqi@0: intptr_t* stack, aoqi@0: intptr_t* stack_base, aoqi@0: intptr_t* monitor_base, aoqi@0: intptr_t* frame_bottom, aoqi@0: bool top_frame); aoqi@0: aoqi@0: /* aoqi@0: * Generic 32-bit wide "Java slot" definition. This type occurs aoqi@0: * in operand stacks, Java locals, object fields, constant pools. aoqi@0: */ aoqi@0: union VMJavaVal32 { aoqi@0: jint i; aoqi@0: jfloat f; aoqi@0: class oopDesc* r; aoqi@0: uint32_t raw; aoqi@0: }; aoqi@0: aoqi@0: /* aoqi@0: * Generic 64-bit Java value definition aoqi@0: */ aoqi@0: union VMJavaVal64 { aoqi@0: jlong l; aoqi@0: jdouble d; aoqi@0: uint32_t v[2]; aoqi@0: }; aoqi@0: aoqi@0: /* aoqi@0: * Generic 32-bit wide "Java slot" definition. This type occurs aoqi@0: * in Java locals, object fields, constant pools, and aoqi@0: * operand stacks (as a CVMStackVal32). aoqi@0: */ aoqi@0: typedef union VMSlotVal32 { aoqi@0: VMJavaVal32 j; /* For "Java" values */ aoqi@0: address a; /* a return created by jsr or jsr_w */ aoqi@0: } VMSlotVal32; aoqi@0: aoqi@0: aoqi@0: /* aoqi@0: * Generic 32-bit wide stack slot definition. aoqi@0: */ aoqi@0: union VMStackVal32 { aoqi@0: VMJavaVal32 j; /* For "Java" values */ aoqi@0: VMSlotVal32 s; /* any value from a "slot" or locals[] */ aoqi@0: }; aoqi@0: aoqi@0: inline JavaThread* thread() { return _thread; } aoqi@0: aoqi@0: inline address bcp() { return _bcp; } aoqi@0: inline void set_bcp(address new_bcp) { _bcp = new_bcp; } aoqi@0: aoqi@0: inline intptr_t* locals() { return _locals; } aoqi@0: aoqi@0: inline ConstantPoolCache* constants() { return _constants; } aoqi@0: inline Method* method() { return _method; } aoqi@0: inline DataLayout* mdx() { return _mdx; } aoqi@0: inline void set_mdx(DataLayout *new_mdx) { _mdx = new_mdx; } aoqi@0: aoqi@0: inline messages msg() { return _msg; } aoqi@0: inline void set_msg(messages new_msg) { _msg = new_msg; } aoqi@0: aoqi@0: inline Method* callee() { return _result._to_call._callee; } aoqi@0: inline void set_callee(Method* new_callee) { _result._to_call._callee = new_callee; } aoqi@0: inline void set_callee_entry_point(address entry) { _result._to_call._callee_entry_point = entry; } aoqi@0: inline void set_osr_buf(address buf) { _result._osr._osr_buf = buf; } aoqi@0: inline void set_osr_entry(address entry) { _result._osr._osr_entry = entry; } aoqi@0: inline int bcp_advance() { return _result._to_call._bcp_advance; } aoqi@0: inline void set_bcp_advance(int count) { _result._to_call._bcp_advance = count; } aoqi@0: aoqi@0: inline interpreterState prev() { return _prev_link; } aoqi@0: aoqi@0: inline intptr_t* stack() { return _stack; } aoqi@0: inline void set_stack(intptr_t* new_stack) { _stack = new_stack; } aoqi@0: aoqi@0: aoqi@0: inline intptr_t* stack_base() { return _stack_base; } aoqi@0: inline intptr_t* stack_limit() { return _stack_limit; } aoqi@0: aoqi@0: inline BasicObjectLock* monitor_base() { return _monitor_base; } aoqi@0: aoqi@0: /* aoqi@0: * 64-bit Arithmetic: aoqi@0: * aoqi@0: * The functions below follow the semantics of the aoqi@0: * ladd, land, ldiv, lmul, lor, lxor, and lrem bytecodes, aoqi@0: * respectively. aoqi@0: */ aoqi@0: aoqi@0: static jlong VMlongAdd(jlong op1, jlong op2); aoqi@0: static jlong VMlongAnd(jlong op1, jlong op2); aoqi@0: static jlong VMlongDiv(jlong op1, jlong op2); aoqi@0: static jlong VMlongMul(jlong op1, jlong op2); aoqi@0: static jlong VMlongOr (jlong op1, jlong op2); aoqi@0: static jlong VMlongSub(jlong op1, jlong op2); aoqi@0: static jlong VMlongXor(jlong op1, jlong op2); aoqi@0: static jlong VMlongRem(jlong op1, jlong op2); aoqi@0: aoqi@0: /* aoqi@0: * Shift: aoqi@0: * aoqi@0: * The functions below follow the semantics of the aoqi@0: * lushr, lshl, and lshr bytecodes, respectively. aoqi@0: */ aoqi@0: aoqi@0: static jlong VMlongUshr(jlong op1, jint op2); aoqi@0: static jlong VMlongShl (jlong op1, jint op2); aoqi@0: static jlong VMlongShr (jlong op1, jint op2); aoqi@0: aoqi@0: /* aoqi@0: * Unary: aoqi@0: * aoqi@0: * Return the negation of "op" (-op), according to aoqi@0: * the semantics of the lneg bytecode. aoqi@0: */ aoqi@0: aoqi@0: static jlong VMlongNeg(jlong op); aoqi@0: aoqi@0: /* aoqi@0: * Return the complement of "op" (~op) aoqi@0: */ aoqi@0: aoqi@0: static jlong VMlongNot(jlong op); aoqi@0: aoqi@0: aoqi@0: /* aoqi@0: * Comparisons to 0: aoqi@0: */ aoqi@0: aoqi@0: static int32_t VMlongLtz(jlong op); /* op <= 0 */ aoqi@0: static int32_t VMlongGez(jlong op); /* op >= 0 */ aoqi@0: static int32_t VMlongEqz(jlong op); /* op == 0 */ aoqi@0: aoqi@0: /* aoqi@0: * Between operands: aoqi@0: */ aoqi@0: aoqi@0: static int32_t VMlongEq(jlong op1, jlong op2); /* op1 == op2 */ aoqi@0: static int32_t VMlongNe(jlong op1, jlong op2); /* op1 != op2 */ aoqi@0: static int32_t VMlongGe(jlong op1, jlong op2); /* op1 >= op2 */ aoqi@0: static int32_t VMlongLe(jlong op1, jlong op2); /* op1 <= op2 */ aoqi@0: static int32_t VMlongLt(jlong op1, jlong op2); /* op1 < op2 */ aoqi@0: static int32_t VMlongGt(jlong op1, jlong op2); /* op1 > op2 */ aoqi@0: aoqi@0: /* aoqi@0: * Comparisons (returning an jint value: 0, 1, or -1) aoqi@0: * aoqi@0: * Between operands: aoqi@0: * aoqi@0: * Compare "op1" and "op2" according to the semantics of the aoqi@0: * "lcmp" bytecode. aoqi@0: */ aoqi@0: aoqi@0: static int32_t VMlongCompare(jlong op1, jlong op2); aoqi@0: aoqi@0: /* aoqi@0: * Convert int to long, according to "i2l" bytecode semantics aoqi@0: */ aoqi@0: static jlong VMint2Long(jint val); aoqi@0: aoqi@0: /* aoqi@0: * Convert long to int, according to "l2i" bytecode semantics aoqi@0: */ aoqi@0: static jint VMlong2Int(jlong val); aoqi@0: aoqi@0: /* aoqi@0: * Convert long to float, according to "l2f" bytecode semantics aoqi@0: */ aoqi@0: static jfloat VMlong2Float(jlong val); aoqi@0: aoqi@0: /* aoqi@0: * Convert long to double, according to "l2d" bytecode semantics aoqi@0: */ aoqi@0: static jdouble VMlong2Double(jlong val); aoqi@0: aoqi@0: /* aoqi@0: * Java floating-point float value manipulation. aoqi@0: * aoqi@0: * The result argument is, once again, an lvalue. aoqi@0: * aoqi@0: * Arithmetic: aoqi@0: * aoqi@0: * The functions below follow the semantics of the aoqi@0: * fadd, fsub, fmul, fdiv, and frem bytecodes, aoqi@0: * respectively. aoqi@0: */ aoqi@0: aoqi@0: static jfloat VMfloatAdd(jfloat op1, jfloat op2); aoqi@0: static jfloat VMfloatSub(jfloat op1, jfloat op2); aoqi@0: static jfloat VMfloatMul(jfloat op1, jfloat op2); aoqi@0: static jfloat VMfloatDiv(jfloat op1, jfloat op2); aoqi@0: static jfloat VMfloatRem(jfloat op1, jfloat op2); aoqi@0: aoqi@0: /* aoqi@0: * Unary: aoqi@0: * aoqi@0: * Return the negation of "op" (-op), according to aoqi@0: * the semantics of the fneg bytecode. aoqi@0: */ aoqi@0: aoqi@0: static jfloat VMfloatNeg(jfloat op); aoqi@0: aoqi@0: /* aoqi@0: * Comparisons (returning an int value: 0, 1, or -1) aoqi@0: * aoqi@0: * Between operands: aoqi@0: * aoqi@0: * Compare "op1" and "op2" according to the semantics of the aoqi@0: * "fcmpl" (direction is -1) or "fcmpg" (direction is 1) bytecodes. aoqi@0: */ aoqi@0: aoqi@0: static int32_t VMfloatCompare(jfloat op1, jfloat op2, aoqi@0: int32_t direction); aoqi@0: /* aoqi@0: * Conversion: aoqi@0: */ aoqi@0: aoqi@0: /* aoqi@0: * Convert float to double, according to "f2d" bytecode semantics aoqi@0: */ aoqi@0: aoqi@0: static jdouble VMfloat2Double(jfloat op); aoqi@0: aoqi@0: /* aoqi@0: ****************************************** aoqi@0: * Java double floating-point manipulation. aoqi@0: ****************************************** aoqi@0: * aoqi@0: * The result argument is, once again, an lvalue. aoqi@0: * aoqi@0: * Conversions: aoqi@0: */ aoqi@0: aoqi@0: /* aoqi@0: * Convert double to int, according to "d2i" bytecode semantics aoqi@0: */ aoqi@0: aoqi@0: static jint VMdouble2Int(jdouble val); aoqi@0: aoqi@0: /* aoqi@0: * Convert double to float, according to "d2f" bytecode semantics aoqi@0: */ aoqi@0: aoqi@0: static jfloat VMdouble2Float(jdouble val); aoqi@0: aoqi@0: /* aoqi@0: * Convert int to double, according to "i2d" bytecode semantics aoqi@0: */ aoqi@0: aoqi@0: static jdouble VMint2Double(jint val); aoqi@0: aoqi@0: /* aoqi@0: * Arithmetic: aoqi@0: * aoqi@0: * The functions below follow the semantics of the aoqi@0: * dadd, dsub, ddiv, dmul, and drem bytecodes, respectively. aoqi@0: */ aoqi@0: aoqi@0: static jdouble VMdoubleAdd(jdouble op1, jdouble op2); aoqi@0: static jdouble VMdoubleSub(jdouble op1, jdouble op2); aoqi@0: static jdouble VMdoubleDiv(jdouble op1, jdouble op2); aoqi@0: static jdouble VMdoubleMul(jdouble op1, jdouble op2); aoqi@0: static jdouble VMdoubleRem(jdouble op1, jdouble op2); aoqi@0: aoqi@0: /* aoqi@0: * Unary: aoqi@0: * aoqi@0: * Return the negation of "op" (-op), according to aoqi@0: * the semantics of the dneg bytecode. aoqi@0: */ aoqi@0: aoqi@0: static jdouble VMdoubleNeg(jdouble op); aoqi@0: aoqi@0: /* aoqi@0: * Comparisons (returning an int32_t value: 0, 1, or -1) aoqi@0: * aoqi@0: * Between operands: aoqi@0: * aoqi@0: * Compare "op1" and "op2" according to the semantics of the aoqi@0: * "dcmpl" (direction is -1) or "dcmpg" (direction is 1) bytecodes. aoqi@0: */ aoqi@0: aoqi@0: static int32_t VMdoubleCompare(jdouble op1, jdouble op2, int32_t direction); aoqi@0: aoqi@0: /* aoqi@0: * Copy two typeless 32-bit words from one location to another. aoqi@0: * This is semantically equivalent to: aoqi@0: * aoqi@0: * to[0] = from[0]; aoqi@0: * to[1] = from[1]; aoqi@0: * aoqi@0: * but this interface is provided for those platforms that could aoqi@0: * optimize this into a single 64-bit transfer. aoqi@0: */ aoqi@0: aoqi@0: static void VMmemCopy64(uint32_t to[2], const uint32_t from[2]); aoqi@0: aoqi@0: aoqi@0: // Arithmetic operations aoqi@0: aoqi@0: /* aoqi@0: * Java arithmetic methods. aoqi@0: * The functions below follow the semantics of the aoqi@0: * iadd, isub, imul, idiv, irem, iand, ior, ixor, aoqi@0: * and ineg bytecodes, respectively. aoqi@0: */ aoqi@0: aoqi@0: static jint VMintAdd(jint op1, jint op2); aoqi@0: static jint VMintSub(jint op1, jint op2); aoqi@0: static jint VMintMul(jint op1, jint op2); aoqi@0: static jint VMintDiv(jint op1, jint op2); aoqi@0: static jint VMintRem(jint op1, jint op2); aoqi@0: static jint VMintAnd(jint op1, jint op2); aoqi@0: static jint VMintOr (jint op1, jint op2); aoqi@0: static jint VMintXor(jint op1, jint op2); aoqi@0: aoqi@0: /* aoqi@0: * Shift Operation: aoqi@0: * The functions below follow the semantics of the aoqi@0: * iushr, ishl, and ishr bytecodes, respectively. aoqi@0: */ aoqi@0: aoqi@0: static juint VMintUshr(jint op, jint num); aoqi@0: static jint VMintShl (jint op, jint num); aoqi@0: static jint VMintShr (jint op, jint num); aoqi@0: aoqi@0: /* aoqi@0: * Unary Operation: aoqi@0: * aoqi@0: * Return the negation of "op" (-op), according to aoqi@0: * the semantics of the ineg bytecode. aoqi@0: */ aoqi@0: aoqi@0: static jint VMintNeg(jint op); aoqi@0: aoqi@0: /* aoqi@0: * Int Conversions: aoqi@0: */ aoqi@0: aoqi@0: /* aoqi@0: * Convert int to float, according to "i2f" bytecode semantics aoqi@0: */ aoqi@0: aoqi@0: static jfloat VMint2Float(jint val); aoqi@0: aoqi@0: /* aoqi@0: * Convert int to byte, according to "i2b" bytecode semantics aoqi@0: */ aoqi@0: aoqi@0: static jbyte VMint2Byte(jint val); aoqi@0: aoqi@0: /* aoqi@0: * Convert int to char, according to "i2c" bytecode semantics aoqi@0: */ aoqi@0: aoqi@0: static jchar VMint2Char(jint val); aoqi@0: aoqi@0: /* aoqi@0: * Convert int to short, according to "i2s" bytecode semantics aoqi@0: */ aoqi@0: aoqi@0: static jshort VMint2Short(jint val); aoqi@0: aoqi@0: /*========================================================================= aoqi@0: * Bytecode interpreter operations aoqi@0: *=======================================================================*/ aoqi@0: aoqi@0: static void dup(intptr_t *tos); aoqi@0: static void dup2(intptr_t *tos); aoqi@0: static void dup_x1(intptr_t *tos); /* insert top word two down */ aoqi@0: static void dup_x2(intptr_t *tos); /* insert top word three down */ aoqi@0: static void dup2_x1(intptr_t *tos); /* insert top 2 slots three down */ aoqi@0: static void dup2_x2(intptr_t *tos); /* insert top 2 slots four down */ aoqi@0: static void swap(intptr_t *tos); /* swap top two elements */ aoqi@0: aoqi@0: // umm don't like this method modifies its object aoqi@0: aoqi@0: // The Interpreter used when aoqi@0: static void run(interpreterState istate); aoqi@0: // The interpreter used if JVMTI needs interpreter events aoqi@0: static void runWithChecks(interpreterState istate); aoqi@0: static void End_Of_Interpreter(void); aoqi@0: aoqi@0: // Inline static functions for Java Stack and Local manipulation aoqi@0: aoqi@0: static address stack_slot(intptr_t *tos, int offset); aoqi@0: static jint stack_int(intptr_t *tos, int offset); aoqi@0: static jfloat stack_float(intptr_t *tos, int offset); aoqi@0: static oop stack_object(intptr_t *tos, int offset); aoqi@0: static jdouble stack_double(intptr_t *tos, int offset); aoqi@0: static jlong stack_long(intptr_t *tos, int offset); aoqi@0: aoqi@0: // only used for value types aoqi@0: static void set_stack_slot(intptr_t *tos, address value, int offset); aoqi@0: static void set_stack_int(intptr_t *tos, int value, int offset); aoqi@0: static void set_stack_float(intptr_t *tos, jfloat value, int offset); aoqi@0: static void set_stack_object(intptr_t *tos, oop value, int offset); aoqi@0: aoqi@0: // needs to be platform dep for the 32 bit platforms. aoqi@0: static void set_stack_double(intptr_t *tos, jdouble value, int offset); aoqi@0: static void set_stack_long(intptr_t *tos, jlong value, int offset); aoqi@0: aoqi@0: static void set_stack_double_from_addr(intptr_t *tos, address addr, int offset); aoqi@0: static void set_stack_long_from_addr(intptr_t *tos, address addr, int offset); aoqi@0: aoqi@0: // Locals aoqi@0: aoqi@0: static address locals_slot(intptr_t* locals, int offset); aoqi@0: static jint locals_int(intptr_t* locals, int offset); aoqi@0: static jfloat locals_float(intptr_t* locals, int offset); aoqi@0: static oop locals_object(intptr_t* locals, int offset); aoqi@0: static jdouble locals_double(intptr_t* locals, int offset); aoqi@0: static jlong locals_long(intptr_t* locals, int offset); aoqi@0: aoqi@0: static address locals_long_at(intptr_t* locals, int offset); aoqi@0: static address locals_double_at(intptr_t* locals, int offset); aoqi@0: aoqi@0: static void set_locals_slot(intptr_t *locals, address value, int offset); aoqi@0: static void set_locals_int(intptr_t *locals, jint value, int offset); aoqi@0: static void set_locals_float(intptr_t *locals, jfloat value, int offset); aoqi@0: static void set_locals_object(intptr_t *locals, oop value, int offset); aoqi@0: static void set_locals_double(intptr_t *locals, jdouble value, int offset); aoqi@0: static void set_locals_long(intptr_t *locals, jlong value, int offset); aoqi@0: static void set_locals_double_from_addr(intptr_t *locals, aoqi@0: address addr, int offset); aoqi@0: static void set_locals_long_from_addr(intptr_t *locals, aoqi@0: address addr, int offset); aoqi@0: aoqi@0: static void astore(intptr_t* topOfStack, int stack_offset, aoqi@0: intptr_t* locals, int locals_offset); aoqi@0: aoqi@0: // Support for dup and swap aoqi@0: static void copy_stack_slot(intptr_t *tos, int from_offset, int to_offset); aoqi@0: aoqi@0: #ifndef PRODUCT aoqi@0: static const char* C_msg(BytecodeInterpreter::messages msg); aoqi@0: void print(); aoqi@0: #endif // PRODUCT aoqi@0: aoqi@0: // Platform fields/methods aoqi@0: #ifdef TARGET_ARCH_x86 aoqi@0: # include "bytecodeInterpreter_x86.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_sparc aoqi@0: # include "bytecodeInterpreter_sparc.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_zero aoqi@0: # include "bytecodeInterpreter_zero.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_arm aoqi@0: # include "bytecodeInterpreter_arm.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_ppc aoqi@0: # include "bytecodeInterpreter_ppc.hpp" aoqi@0: #endif aoqi@0: aoqi@0: aoqi@0: }; // BytecodeInterpreter aoqi@0: aoqi@0: #endif // CC_INTERP aoqi@0: aoqi@0: #endif // SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_HPP