annotate src/cpu/x86/vm/bytecodeInterpreter_x86.hpp @ 1472:c18cbe5936b8

6941466: Oracle rebranding changes for Hotspot repositories Summary: Change all the Sun copyrights to Oracle copyright Reviewed-by: ohair
author trims
date Thu, 27 May 2010 19:08:38 -0700
parents a61af66fc99e
children f95d63e2154a
rev   line source
duke@0 1 /*
trims@1472 2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
duke@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 *
duke@0 5 * This code is free software; you can redistribute it and/or modify it
duke@0 6 * under the terms of the GNU General Public License version 2 only, as
duke@0 7 * published by the Free Software Foundation.
duke@0 8 *
duke@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@0 13 * accompanied this code).
duke@0 14 *
duke@0 15 * You should have received a copy of the GNU General Public License version
duke@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 18 *
trims@1472 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1472 20 * or visit www.oracle.com if you need additional information or have any
trims@1472 21 * questions.
duke@0 22 *
duke@0 23 */
duke@0 24
duke@0 25 // Platform specific for C++ based Interpreter
duke@0 26
duke@0 27 private:
duke@0 28
duke@0 29 interpreterState _self_link; /* Previous interpreter state */ /* sometimes points to self??? */
duke@0 30 address _result_handler; /* temp for saving native result handler */
duke@0 31 intptr_t* _sender_sp; /* sender's sp before stack (locals) extension */
duke@0 32
duke@0 33 address _extra_junk1; /* temp to save on recompiles */
duke@0 34 address _extra_junk2; /* temp to save on recompiles */
duke@0 35 address _extra_junk3; /* temp to save on recompiles */
duke@0 36 // address dummy_for_native2; /* a native frame result handler would be here... */
duke@0 37 // address dummy_for_native1; /* native result type stored here in a interpreter native frame */
duke@0 38 address _extra_junk4; /* temp to save on recompiles */
duke@0 39 address _extra_junk5; /* temp to save on recompiles */
duke@0 40 address _extra_junk6; /* temp to save on recompiles */
duke@0 41 public:
duke@0 42 // we have an interpreter frame...
duke@0 43 inline intptr_t* sender_sp() {
duke@0 44 return _sender_sp;
duke@0 45 }
duke@0 46
duke@0 47 // The interpreter always has the frame anchor fully setup so we don't
duke@0 48 // have to do anything going to vm from the interpreter. On return
duke@0 49 // we do have to clear the flags in case they we're modified to
duke@0 50 // maintain the stack walking invariants.
duke@0 51 //
duke@0 52 #define SET_LAST_JAVA_FRAME()
duke@0 53
duke@0 54 #define RESET_LAST_JAVA_FRAME()
duke@0 55
duke@0 56 /*
duke@0 57 * Macros for accessing the stack.
duke@0 58 */
duke@0 59 #undef STACK_INT
duke@0 60 #undef STACK_FLOAT
duke@0 61 #undef STACK_ADDR
duke@0 62 #undef STACK_OBJECT
duke@0 63 #undef STACK_DOUBLE
duke@0 64 #undef STACK_LONG
duke@0 65
duke@0 66 // JavaStack Implementation
duke@0 67
duke@0 68 #define GET_STACK_SLOT(offset) (*((intptr_t*) &topOfStack[-(offset)]))
duke@0 69 #define STACK_SLOT(offset) ((address) &topOfStack[-(offset)])
duke@0 70 #define STACK_ADDR(offset) (*((address *) &topOfStack[-(offset)]))
duke@0 71 #define STACK_INT(offset) (*((jint*) &topOfStack[-(offset)]))
duke@0 72 #define STACK_FLOAT(offset) (*((jfloat *) &topOfStack[-(offset)]))
duke@0 73 #define STACK_OBJECT(offset) (*((oop *) &topOfStack [-(offset)]))
duke@0 74 #define STACK_DOUBLE(offset) (((VMJavaVal64*) &topOfStack[-(offset)])->d)
duke@0 75 #define STACK_LONG(offset) (((VMJavaVal64 *) &topOfStack[-(offset)])->l)
duke@0 76
duke@0 77 #define SET_STACK_SLOT(value, offset) (*(intptr_t*)&topOfStack[-(offset)] = *(intptr_t*)(value))
duke@0 78 #define SET_STACK_ADDR(value, offset) (*((address *)&topOfStack[-(offset)]) = (value))
duke@0 79 #define SET_STACK_INT(value, offset) (*((jint *)&topOfStack[-(offset)]) = (value))
duke@0 80 #define SET_STACK_FLOAT(value, offset) (*((jfloat *)&topOfStack[-(offset)]) = (value))
duke@0 81 #define SET_STACK_OBJECT(value, offset) (*((oop *)&topOfStack[-(offset)]) = (value))
duke@0 82 #define SET_STACK_DOUBLE(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = (value))
duke@0 83 #define SET_STACK_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = \
duke@0 84 ((VMJavaVal64*)(addr))->d)
duke@0 85 #define SET_STACK_LONG(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = (value))
duke@0 86 #define SET_STACK_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = \
duke@0 87 ((VMJavaVal64*)(addr))->l)
duke@0 88 // JavaLocals implementation
duke@0 89
duke@0 90 #define LOCALS_SLOT(offset) ((intptr_t*)&locals[-(offset)])
duke@0 91 #define LOCALS_ADDR(offset) ((address)locals[-(offset)])
duke@0 92 #define LOCALS_INT(offset) ((jint)(locals[-(offset)]))
duke@0 93 #define LOCALS_FLOAT(offset) (*((jfloat*)&locals[-(offset)]))
duke@0 94 #define LOCALS_OBJECT(offset) ((oop)locals[-(offset)])
duke@0 95 #define LOCALS_DOUBLE(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->d)
duke@0 96 #define LOCALS_LONG(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->l)
duke@0 97 #define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)]))
duke@0 98 #define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)]))
duke@0 99
duke@0 100 #define SET_LOCALS_SLOT(value, offset) (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value))
duke@0 101 #define SET_LOCALS_ADDR(value, offset) (*((address *)&locals[-(offset)]) = (value))
duke@0 102 #define SET_LOCALS_INT(value, offset) (*((jint *)&locals[-(offset)]) = (value))
duke@0 103 #define SET_LOCALS_FLOAT(value, offset) (*((jfloat *)&locals[-(offset)]) = (value))
duke@0 104 #define SET_LOCALS_OBJECT(value, offset) (*((oop *)&locals[-(offset)]) = (value))
duke@0 105 #define SET_LOCALS_DOUBLE(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value))
duke@0 106 #define SET_LOCALS_LONG(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value))
duke@0 107 #define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \
duke@0 108 ((VMJavaVal64*)(addr))->d)
duke@0 109 #define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \
duke@0 110 ((VMJavaVal64*)(addr))->l)