annotate src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp @ 196:d1605aabd0a1 jdk7-b30

6719955: Update copyright year Summary: Update copyright year for files that have been modified in 2008 Reviewed-by: ohair, tbell
author xdono
date Wed, 02 Jul 2008 12:55:16 -0700
parents 9e5a7340635e
children c18cbe5936b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
196
d1605aabd0a1 6719955: Update copyright year
xdono
parents: 123
diff changeset
2 * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 // Platform specific for C++ based Interpreter
a61af66fc99e Initial load
duke
parents:
diff changeset
26 #define LOTS_OF_REGS /* Lets interpreter use plenty of registers */
a61af66fc99e Initial load
duke
parents:
diff changeset
27
a61af66fc99e Initial load
duke
parents:
diff changeset
28 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
29
a61af66fc99e Initial load
duke
parents:
diff changeset
30 // save the bottom of the stack after frame manager setup. For ease of restoration after return
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // from recursive interpreter call
a61af66fc99e Initial load
duke
parents:
diff changeset
32 intptr_t* _frame_bottom; /* saved bottom of frame manager frame */
a61af66fc99e Initial load
duke
parents:
diff changeset
33 intptr_t* _last_Java_pc; /* pc to return to in frame manager */
a61af66fc99e Initial load
duke
parents:
diff changeset
34 interpreterState _self_link; /* Previous interpreter state */ /* sometimes points to self??? */
a61af66fc99e Initial load
duke
parents:
diff changeset
35 double _native_fresult; /* save result of native calls that might return floats */
a61af66fc99e Initial load
duke
parents:
diff changeset
36 intptr_t _native_lresult; /* save result of native calls that might return handle/longs */
a61af66fc99e Initial load
duke
parents:
diff changeset
37 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 static void pd_layout_interpreterState(interpreterState istate, address last_Java_pc, intptr_t* last_Java_fp);
a61af66fc99e Initial load
duke
parents:
diff changeset
40
a61af66fc99e Initial load
duke
parents:
diff changeset
41
a61af66fc99e Initial load
duke
parents:
diff changeset
42 #define SET_LAST_JAVA_FRAME()
a61af66fc99e Initial load
duke
parents:
diff changeset
43
a61af66fc99e Initial load
duke
parents:
diff changeset
44 #define RESET_LAST_JAVA_FRAME() THREAD->frame_anchor()->set_flags(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
47 * Macros for accessing the stack.
a61af66fc99e Initial load
duke
parents:
diff changeset
48 */
a61af66fc99e Initial load
duke
parents:
diff changeset
49 #undef STACK_INT
a61af66fc99e Initial load
duke
parents:
diff changeset
50 #undef STACK_FLOAT
a61af66fc99e Initial load
duke
parents:
diff changeset
51 #undef STACK_ADDR
a61af66fc99e Initial load
duke
parents:
diff changeset
52 #undef STACK_OBJECT
a61af66fc99e Initial load
duke
parents:
diff changeset
53 #undef STACK_DOUBLE
a61af66fc99e Initial load
duke
parents:
diff changeset
54 #undef STACK_LONG
a61af66fc99e Initial load
duke
parents:
diff changeset
55 // JavaStack Implementation
a61af66fc99e Initial load
duke
parents:
diff changeset
56
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 #define GET_STACK_SLOT(offset) (*((intptr_t*) &topOfStack[-(offset)]))
a61af66fc99e Initial load
duke
parents:
diff changeset
59 #define STACK_SLOT(offset) ((address) &topOfStack[-(offset)])
a61af66fc99e Initial load
duke
parents:
diff changeset
60 #define STACK_ADDR(offset) (*((address *) &topOfStack[-(offset)]))
a61af66fc99e Initial load
duke
parents:
diff changeset
61 #define STACK_INT(offset) (*((jint*) &topOfStack[-(offset)]))
a61af66fc99e Initial load
duke
parents:
diff changeset
62 #define STACK_FLOAT(offset) (*((jfloat *) &topOfStack[-(offset)]))
a61af66fc99e Initial load
duke
parents:
diff changeset
63 #define STACK_OBJECT(offset) (*((oop *) &topOfStack [-(offset)]))
a61af66fc99e Initial load
duke
parents:
diff changeset
64 #define STACK_DOUBLE(offset) (((VMJavaVal64*) &topOfStack[-(offset)])->d)
a61af66fc99e Initial load
duke
parents:
diff changeset
65 #define STACK_LONG(offset) (((VMJavaVal64 *) &topOfStack[-(offset)])->l)
a61af66fc99e Initial load
duke
parents:
diff changeset
66
a61af66fc99e Initial load
duke
parents:
diff changeset
67 #define SET_STACK_SLOT(value, offset) (*(intptr_t*)&topOfStack[-(offset)] = *(intptr_t*)(value))
a61af66fc99e Initial load
duke
parents:
diff changeset
68 #define SET_STACK_ADDR(value, offset) (*((address *)&topOfStack[-(offset)]) = (value))
a61af66fc99e Initial load
duke
parents:
diff changeset
69 #define SET_STACK_INT(value, offset) (*((jint *)&topOfStack[-(offset)]) = (value))
a61af66fc99e Initial load
duke
parents:
diff changeset
70 #define SET_STACK_FLOAT(value, offset) (*((jfloat *)&topOfStack[-(offset)]) = (value))
a61af66fc99e Initial load
duke
parents:
diff changeset
71 #define SET_STACK_OBJECT(value, offset) (*((oop *)&topOfStack[-(offset)]) = (value))
a61af66fc99e Initial load
duke
parents:
diff changeset
72 #define SET_STACK_DOUBLE(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = (value))
a61af66fc99e Initial load
duke
parents:
diff changeset
73 #define SET_STACK_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = \
a61af66fc99e Initial load
duke
parents:
diff changeset
74 ((VMJavaVal64*)(addr))->d)
a61af66fc99e Initial load
duke
parents:
diff changeset
75 #define SET_STACK_LONG(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = (value))
a61af66fc99e Initial load
duke
parents:
diff changeset
76 #define SET_STACK_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = \
a61af66fc99e Initial load
duke
parents:
diff changeset
77 ((VMJavaVal64*)(addr))->l)
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 #define LOCALS_SLOT(offset) ((intptr_t*)&locals[-(offset)])
a61af66fc99e Initial load
duke
parents:
diff changeset
80 #define LOCALS_ADDR(offset) ((address)locals[-(offset)])
123
9e5a7340635e 6688137: c++ interpreter fails on 64bit sparc
sgoldman
parents: 0
diff changeset
81 #define LOCALS_INT(offset) (*((jint*)&locals[-(offset)]))
0
a61af66fc99e Initial load
duke
parents:
diff changeset
82 #define LOCALS_FLOAT(offset) (*((jfloat*)&locals[-(offset)]))
a61af66fc99e Initial load
duke
parents:
diff changeset
83 #define LOCALS_OBJECT(offset) ((oop)locals[-(offset)])
a61af66fc99e Initial load
duke
parents:
diff changeset
84 #define LOCALS_DOUBLE(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->d)
a61af66fc99e Initial load
duke
parents:
diff changeset
85 #define LOCALS_LONG(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->l)
a61af66fc99e Initial load
duke
parents:
diff changeset
86 #define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)]))
a61af66fc99e Initial load
duke
parents:
diff changeset
87 #define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)]))
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89 #define SET_LOCALS_SLOT(value, offset) (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value))
a61af66fc99e Initial load
duke
parents:
diff changeset
90 #define SET_LOCALS_ADDR(value, offset) (*((address *)&locals[-(offset)]) = (value))
a61af66fc99e Initial load
duke
parents:
diff changeset
91 #define SET_LOCALS_INT(value, offset) (*((jint *)&locals[-(offset)]) = (value))
a61af66fc99e Initial load
duke
parents:
diff changeset
92 #define SET_LOCALS_FLOAT(value, offset) (*((jfloat *)&locals[-(offset)]) = (value))
a61af66fc99e Initial load
duke
parents:
diff changeset
93 #define SET_LOCALS_OBJECT(value, offset) (*((oop *)&locals[-(offset)]) = (value))
a61af66fc99e Initial load
duke
parents:
diff changeset
94 #define SET_LOCALS_DOUBLE(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value))
a61af66fc99e Initial load
duke
parents:
diff changeset
95 #define SET_LOCALS_LONG(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value))
a61af66fc99e Initial load
duke
parents:
diff changeset
96 #define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \
a61af66fc99e Initial load
duke
parents:
diff changeset
97 ((VMJavaVal64*)(addr))->d)
a61af66fc99e Initial load
duke
parents:
diff changeset
98 #define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \
a61af66fc99e Initial load
duke
parents:
diff changeset
99 ((VMJavaVal64*)(addr))->l)