src/cpu/x86/vm/bytecodeInterpreter_x86.hpp

Mon, 09 Mar 2009 13:28:46 -0700

author
xdono
date
Mon, 09 Mar 2009 13:28:46 -0700
changeset 1014
0fbdb4381b99
parent 435
a61af66fc99e
child 1907
c18cbe5936b8
permissions
-rw-r--r--

6814575: Update copyright year
Summary: Update copyright for files that have been modified in 2009, up to 03/09
Reviewed-by: katleman, tbell, ohair

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

mercurial