1.1 --- a/src/share/vm/interpreter/bytecodeInterpreter.cpp Fri Apr 30 04:27:25 2010 -0700 1.2 +++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp Fri Apr 30 08:37:24 2010 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * Copyright 2002-2010 Sun Microsystems, Inc. All Rights Reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -2692,219 +2692,141 @@ 1.11 // The implementations are platform dependent. We have to worry about alignment 1.12 // issues on some machines which can change on the same platform depending on 1.13 // whether it is an LP64 machine also. 1.14 -#ifdef ASSERT 1.15 -void BytecodeInterpreter::verify_stack_tag(intptr_t *tos, frame::Tag tag, int offset) { 1.16 - if (TaggedStackInterpreter) { 1.17 - frame::Tag t = (frame::Tag)tos[Interpreter::expr_tag_index_at(-offset)]; 1.18 - assert(t == tag, "stack tag mismatch"); 1.19 - } 1.20 -} 1.21 -#endif // ASSERT 1.22 - 1.23 address BytecodeInterpreter::stack_slot(intptr_t *tos, int offset) { 1.24 - debug_only(verify_stack_tag(tos, frame::TagValue, offset)); 1.25 return (address) tos[Interpreter::expr_index_at(-offset)]; 1.26 } 1.27 1.28 jint BytecodeInterpreter::stack_int(intptr_t *tos, int offset) { 1.29 - debug_only(verify_stack_tag(tos, frame::TagValue, offset)); 1.30 return *((jint*) &tos[Interpreter::expr_index_at(-offset)]); 1.31 } 1.32 1.33 jfloat BytecodeInterpreter::stack_float(intptr_t *tos, int offset) { 1.34 - debug_only(verify_stack_tag(tos, frame::TagValue, offset)); 1.35 return *((jfloat *) &tos[Interpreter::expr_index_at(-offset)]); 1.36 } 1.37 1.38 oop BytecodeInterpreter::stack_object(intptr_t *tos, int offset) { 1.39 - debug_only(verify_stack_tag(tos, frame::TagReference, offset)); 1.40 return (oop)tos [Interpreter::expr_index_at(-offset)]; 1.41 } 1.42 1.43 jdouble BytecodeInterpreter::stack_double(intptr_t *tos, int offset) { 1.44 - debug_only(verify_stack_tag(tos, frame::TagValue, offset)); 1.45 - debug_only(verify_stack_tag(tos, frame::TagValue, offset-1)); 1.46 return ((VMJavaVal64*) &tos[Interpreter::expr_index_at(-offset)])->d; 1.47 } 1.48 1.49 jlong BytecodeInterpreter::stack_long(intptr_t *tos, int offset) { 1.50 - debug_only(verify_stack_tag(tos, frame::TagValue, offset)); 1.51 - debug_only(verify_stack_tag(tos, frame::TagValue, offset-1)); 1.52 return ((VMJavaVal64 *) &tos[Interpreter::expr_index_at(-offset)])->l; 1.53 } 1.54 1.55 -void BytecodeInterpreter::tag_stack(intptr_t *tos, frame::Tag tag, int offset) { 1.56 - if (TaggedStackInterpreter) 1.57 - tos[Interpreter::expr_tag_index_at(-offset)] = (intptr_t)tag; 1.58 -} 1.59 - 1.60 // only used for value types 1.61 void BytecodeInterpreter::set_stack_slot(intptr_t *tos, address value, 1.62 int offset) { 1.63 - tag_stack(tos, frame::TagValue, offset); 1.64 *((address *)&tos[Interpreter::expr_index_at(-offset)]) = value; 1.65 } 1.66 1.67 void BytecodeInterpreter::set_stack_int(intptr_t *tos, int value, 1.68 int offset) { 1.69 - tag_stack(tos, frame::TagValue, offset); 1.70 *((jint *)&tos[Interpreter::expr_index_at(-offset)]) = value; 1.71 } 1.72 1.73 void BytecodeInterpreter::set_stack_float(intptr_t *tos, jfloat value, 1.74 int offset) { 1.75 - tag_stack(tos, frame::TagValue, offset); 1.76 *((jfloat *)&tos[Interpreter::expr_index_at(-offset)]) = value; 1.77 } 1.78 1.79 void BytecodeInterpreter::set_stack_object(intptr_t *tos, oop value, 1.80 int offset) { 1.81 - tag_stack(tos, frame::TagReference, offset); 1.82 *((oop *)&tos[Interpreter::expr_index_at(-offset)]) = value; 1.83 } 1.84 1.85 // needs to be platform dep for the 32 bit platforms. 1.86 void BytecodeInterpreter::set_stack_double(intptr_t *tos, jdouble value, 1.87 int offset) { 1.88 - tag_stack(tos, frame::TagValue, offset); 1.89 - tag_stack(tos, frame::TagValue, offset-1); 1.90 ((VMJavaVal64*)&tos[Interpreter::expr_index_at(-offset)])->d = value; 1.91 } 1.92 1.93 void BytecodeInterpreter::set_stack_double_from_addr(intptr_t *tos, 1.94 address addr, int offset) { 1.95 - tag_stack(tos, frame::TagValue, offset); 1.96 - tag_stack(tos, frame::TagValue, offset-1); 1.97 (((VMJavaVal64*)&tos[Interpreter::expr_index_at(-offset)])->d = 1.98 ((VMJavaVal64*)addr)->d); 1.99 } 1.100 1.101 void BytecodeInterpreter::set_stack_long(intptr_t *tos, jlong value, 1.102 int offset) { 1.103 - tag_stack(tos, frame::TagValue, offset); 1.104 ((VMJavaVal64*)&tos[Interpreter::expr_index_at(-offset+1)])->l = 0xdeedbeeb; 1.105 - tag_stack(tos, frame::TagValue, offset-1); 1.106 ((VMJavaVal64*)&tos[Interpreter::expr_index_at(-offset)])->l = value; 1.107 } 1.108 1.109 void BytecodeInterpreter::set_stack_long_from_addr(intptr_t *tos, 1.110 address addr, int offset) { 1.111 - tag_stack(tos, frame::TagValue, offset); 1.112 ((VMJavaVal64*)&tos[Interpreter::expr_index_at(-offset+1)])->l = 0xdeedbeeb; 1.113 - tag_stack(tos, frame::TagValue, offset-1); 1.114 ((VMJavaVal64*)&tos[Interpreter::expr_index_at(-offset)])->l = 1.115 ((VMJavaVal64*)addr)->l; 1.116 } 1.117 1.118 // Locals 1.119 1.120 -#ifdef ASSERT 1.121 -void BytecodeInterpreter::verify_locals_tag(intptr_t *locals, frame::Tag tag, 1.122 - int offset) { 1.123 - if (TaggedStackInterpreter) { 1.124 - frame::Tag t = (frame::Tag)locals[Interpreter::local_tag_index_at(-offset)]; 1.125 - assert(t == tag, "locals tag mismatch"); 1.126 - } 1.127 -} 1.128 -#endif // ASSERT 1.129 address BytecodeInterpreter::locals_slot(intptr_t* locals, int offset) { 1.130 - debug_only(verify_locals_tag(locals, frame::TagValue, offset)); 1.131 return (address)locals[Interpreter::local_index_at(-offset)]; 1.132 } 1.133 jint BytecodeInterpreter::locals_int(intptr_t* locals, int offset) { 1.134 - debug_only(verify_locals_tag(locals, frame::TagValue, offset)); 1.135 return (jint)locals[Interpreter::local_index_at(-offset)]; 1.136 } 1.137 jfloat BytecodeInterpreter::locals_float(intptr_t* locals, int offset) { 1.138 - debug_only(verify_locals_tag(locals, frame::TagValue, offset)); 1.139 return (jfloat)locals[Interpreter::local_index_at(-offset)]; 1.140 } 1.141 oop BytecodeInterpreter::locals_object(intptr_t* locals, int offset) { 1.142 - debug_only(verify_locals_tag(locals, frame::TagReference, offset)); 1.143 return (oop)locals[Interpreter::local_index_at(-offset)]; 1.144 } 1.145 jdouble BytecodeInterpreter::locals_double(intptr_t* locals, int offset) { 1.146 - debug_only(verify_locals_tag(locals, frame::TagValue, offset)); 1.147 - debug_only(verify_locals_tag(locals, frame::TagValue, offset)); 1.148 return ((VMJavaVal64*)&locals[Interpreter::local_index_at(-(offset+1))])->d; 1.149 } 1.150 jlong BytecodeInterpreter::locals_long(intptr_t* locals, int offset) { 1.151 - debug_only(verify_locals_tag(locals, frame::TagValue, offset)); 1.152 - debug_only(verify_locals_tag(locals, frame::TagValue, offset+1)); 1.153 return ((VMJavaVal64*)&locals[Interpreter::local_index_at(-(offset+1))])->l; 1.154 } 1.155 1.156 // Returns the address of locals value. 1.157 address BytecodeInterpreter::locals_long_at(intptr_t* locals, int offset) { 1.158 - debug_only(verify_locals_tag(locals, frame::TagValue, offset)); 1.159 - debug_only(verify_locals_tag(locals, frame::TagValue, offset+1)); 1.160 return ((address)&locals[Interpreter::local_index_at(-(offset+1))]); 1.161 } 1.162 address BytecodeInterpreter::locals_double_at(intptr_t* locals, int offset) { 1.163 - debug_only(verify_locals_tag(locals, frame::TagValue, offset)); 1.164 - debug_only(verify_locals_tag(locals, frame::TagValue, offset+1)); 1.165 return ((address)&locals[Interpreter::local_index_at(-(offset+1))]); 1.166 } 1.167 1.168 -void BytecodeInterpreter::tag_locals(intptr_t *locals, frame::Tag tag, int offset) { 1.169 - if (TaggedStackInterpreter) 1.170 - locals[Interpreter::local_tag_index_at(-offset)] = (intptr_t)tag; 1.171 -} 1.172 - 1.173 // Used for local value or returnAddress 1.174 void BytecodeInterpreter::set_locals_slot(intptr_t *locals, 1.175 address value, int offset) { 1.176 - tag_locals(locals, frame::TagValue, offset); 1.177 *((address*)&locals[Interpreter::local_index_at(-offset)]) = value; 1.178 } 1.179 void BytecodeInterpreter::set_locals_int(intptr_t *locals, 1.180 jint value, int offset) { 1.181 - tag_locals(locals, frame::TagValue, offset); 1.182 *((jint *)&locals[Interpreter::local_index_at(-offset)]) = value; 1.183 } 1.184 void BytecodeInterpreter::set_locals_float(intptr_t *locals, 1.185 jfloat value, int offset) { 1.186 - tag_locals(locals, frame::TagValue, offset); 1.187 *((jfloat *)&locals[Interpreter::local_index_at(-offset)]) = value; 1.188 } 1.189 void BytecodeInterpreter::set_locals_object(intptr_t *locals, 1.190 oop value, int offset) { 1.191 - tag_locals(locals, frame::TagReference, offset); 1.192 *((oop *)&locals[Interpreter::local_index_at(-offset)]) = value; 1.193 } 1.194 void BytecodeInterpreter::set_locals_double(intptr_t *locals, 1.195 jdouble value, int offset) { 1.196 - tag_locals(locals, frame::TagValue, offset); 1.197 - tag_locals(locals, frame::TagValue, offset+1); 1.198 ((VMJavaVal64*)&locals[Interpreter::local_index_at(-(offset+1))])->d = value; 1.199 } 1.200 void BytecodeInterpreter::set_locals_long(intptr_t *locals, 1.201 jlong value, int offset) { 1.202 - tag_locals(locals, frame::TagValue, offset); 1.203 - tag_locals(locals, frame::TagValue, offset+1); 1.204 ((VMJavaVal64*)&locals[Interpreter::local_index_at(-(offset+1))])->l = value; 1.205 } 1.206 void BytecodeInterpreter::set_locals_double_from_addr(intptr_t *locals, 1.207 address addr, int offset) { 1.208 - tag_locals(locals, frame::TagValue, offset); 1.209 - tag_locals(locals, frame::TagValue, offset+1); 1.210 ((VMJavaVal64*)&locals[Interpreter::local_index_at(-(offset+1))])->d = ((VMJavaVal64*)addr)->d; 1.211 } 1.212 void BytecodeInterpreter::set_locals_long_from_addr(intptr_t *locals, 1.213 address addr, int offset) { 1.214 - tag_locals(locals, frame::TagValue, offset); 1.215 - tag_locals(locals, frame::TagValue, offset+1); 1.216 ((VMJavaVal64*)&locals[Interpreter::local_index_at(-(offset+1))])->l = ((VMJavaVal64*)addr)->l; 1.217 } 1.218 1.219 void BytecodeInterpreter::astore(intptr_t* tos, int stack_offset, 1.220 intptr_t* locals, int locals_offset) { 1.221 - // Copy tag from stack to locals. astore's operand can be returnAddress 1.222 - // and may not be TagReference 1.223 - if (TaggedStackInterpreter) { 1.224 - frame::Tag t = (frame::Tag) tos[Interpreter::expr_tag_index_at(-stack_offset)]; 1.225 - locals[Interpreter::local_tag_index_at(-locals_offset)] = (intptr_t)t; 1.226 - } 1.227 intptr_t value = tos[Interpreter::expr_index_at(-stack_offset)]; 1.228 locals[Interpreter::local_index_at(-locals_offset)] = value; 1.229 } 1.230 @@ -2912,10 +2834,6 @@ 1.231 1.232 void BytecodeInterpreter::copy_stack_slot(intptr_t *tos, int from_offset, 1.233 int to_offset) { 1.234 - if (TaggedStackInterpreter) { 1.235 - tos[Interpreter::expr_tag_index_at(-to_offset)] = 1.236 - (intptr_t)tos[Interpreter::expr_tag_index_at(-from_offset)]; 1.237 - } 1.238 tos[Interpreter::expr_index_at(-to_offset)] = 1.239 (intptr_t)tos[Interpreter::expr_index_at(-from_offset)]; 1.240 } 1.241 @@ -2964,16 +2882,9 @@ 1.242 void BytecodeInterpreter::swap(intptr_t *tos) { 1.243 // swap top two elements 1.244 intptr_t val = tos[Interpreter::expr_index_at(1)]; 1.245 - frame::Tag t; 1.246 - if (TaggedStackInterpreter) { 1.247 - t = (frame::Tag) tos[Interpreter::expr_tag_index_at(1)]; 1.248 - } 1.249 // Copy -2 entry to -1 1.250 copy_stack_slot(tos, -2, -1); 1.251 // Store saved -1 entry into -2 1.252 - if (TaggedStackInterpreter) { 1.253 - tos[Interpreter::expr_tag_index_at(2)] = (intptr_t)t; 1.254 - } 1.255 tos[Interpreter::expr_index_at(2)] = val; 1.256 } 1.257 // --------------------------------------------------------------------------------