< prev index next >

src/hotspot/share/interpreter/templateInterpreter.cpp

Print this page




 179   }
 180   return true;
 181 }
 182 
 183 address    TemplateInterpreter::_remove_activation_entry                    = NULL;
 184 address    TemplateInterpreter::_remove_activation_preserving_args_entry    = NULL;
 185 
 186 
 187 address    TemplateInterpreter::_throw_ArrayIndexOutOfBoundsException_entry = NULL;
 188 address    TemplateInterpreter::_throw_ArrayStoreException_entry            = NULL;
 189 address    TemplateInterpreter::_throw_ArithmeticException_entry            = NULL;
 190 address    TemplateInterpreter::_throw_ClassCastException_entry             = NULL;
 191 address    TemplateInterpreter::_throw_NullPointerException_entry           = NULL;
 192 address    TemplateInterpreter::_throw_StackOverflowError_entry             = NULL;
 193 address    TemplateInterpreter::_throw_exception_entry                      = NULL;
 194 
 195 #ifndef PRODUCT
 196 EntryPoint TemplateInterpreter::_trace_code;
 197 #endif // !PRODUCT
 198 EntryPoint TemplateInterpreter::_return_entry[TemplateInterpreter::number_of_return_entries];

 199 EntryPoint TemplateInterpreter::_earlyret_entry;
 200 EntryPoint TemplateInterpreter::_deopt_entry [TemplateInterpreter::number_of_deopt_entries ];
 201 address    TemplateInterpreter::_deopt_reexecute_return_entry;
 202 EntryPoint TemplateInterpreter::_safept_entry;
 203 
 204 address TemplateInterpreter::_invoke_return_entry[TemplateInterpreter::number_of_return_addrs];

 205 address TemplateInterpreter::_invokeinterface_return_entry[TemplateInterpreter::number_of_return_addrs];
 206 address TemplateInterpreter::_invokedynamic_return_entry[TemplateInterpreter::number_of_return_addrs];
 207 
 208 DispatchTable TemplateInterpreter::_active_table;
 209 DispatchTable TemplateInterpreter::_normal_table;
 210 DispatchTable TemplateInterpreter::_safept_table;
 211 address    TemplateInterpreter::_wentry_point[DispatchTable::length];
 212 
 213 
 214 //------------------------------------------------------------------------------------------------------------------------
 215 // Entry points
 216 
 217 /**
 218  * Returns the return entry table for the given invoke bytecode.
 219  */
 220 address* TemplateInterpreter::invoke_return_entry_table_for(Bytecodes::Code code) {
 221   switch (code) {
 222   case Bytecodes::_invokestatic:
 223   case Bytecodes::_invokespecial:
 224   case Bytecodes::_invokevirtual:
 225   case Bytecodes::_invokehandle:
 226     return Interpreter::invoke_return_entry_table();
 227   case Bytecodes::_invokeinterface:
 228     return Interpreter::invokeinterface_return_entry_table();
 229   case Bytecodes::_invokedynamic:
 230     return Interpreter::invokedynamic_return_entry_table();
 231   default:
 232     fatal("invalid bytecode: %s", Bytecodes::name(code));
 233     return NULL;
 234   }
 235 }
 236 
 237 /**
 238  * Returns the return entry address for the given top-of-stack state and bytecode.
 239  */
 240 address TemplateInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) {




 241   guarantee(0 <= length && length < Interpreter::number_of_return_entries, "illegal length");
 242   const int index = TosState_as_index(state);
 243   switch (code) {
 244   case Bytecodes::_invokestatic:
 245   case Bytecodes::_invokespecial:
 246   case Bytecodes::_invokevirtual:
 247   case Bytecodes::_invokehandle:
 248     return _invoke_return_entry[index];
 249   case Bytecodes::_invokeinterface:
 250     return _invokeinterface_return_entry[index];
 251   case Bytecodes::_invokedynamic:
 252     return _invokedynamic_return_entry[index];
 253   default:
 254     assert(!Bytecodes::is_invoke(code), "invoke instructions should be handled separately: %s", Bytecodes::name(code));
 255     address entry = _return_entry[length].entry(state);
 256     vmassert(entry != NULL, "unsupported return entry requested, length=%d state=%d", length, index);
 257     return entry;
 258   }
 259 }
 260 
 261 
 262 address TemplateInterpreter::deopt_entry(TosState state, int length) {
 263   guarantee(0 <= length && length < Interpreter::number_of_deopt_entries, "illegal length");
 264   address entry = _deopt_entry[length].entry(state);
 265   vmassert(entry != NULL, "unsupported deopt entry requested, length=%d state=%d", length, TosState_as_index(state));
 266   return entry;
 267 }
 268 
 269 //------------------------------------------------------------------------------------------------------------------------
 270 // Suport for invokes
 271 
 272 int TemplateInterpreter::TosState_as_index(TosState state) {
 273   assert( state < number_of_states , "Invalid state in TosState_as_index");
 274   assert(0 <= (int)state && (int)state < TemplateInterpreter::number_of_return_addrs, "index out of bounds");
 275   return (int)state;




 179   }
 180   return true;
 181 }
 182 
 183 address    TemplateInterpreter::_remove_activation_entry                    = NULL;
 184 address    TemplateInterpreter::_remove_activation_preserving_args_entry    = NULL;
 185 
 186 
 187 address    TemplateInterpreter::_throw_ArrayIndexOutOfBoundsException_entry = NULL;
 188 address    TemplateInterpreter::_throw_ArrayStoreException_entry            = NULL;
 189 address    TemplateInterpreter::_throw_ArithmeticException_entry            = NULL;
 190 address    TemplateInterpreter::_throw_ClassCastException_entry             = NULL;
 191 address    TemplateInterpreter::_throw_NullPointerException_entry           = NULL;
 192 address    TemplateInterpreter::_throw_StackOverflowError_entry             = NULL;
 193 address    TemplateInterpreter::_throw_exception_entry                      = NULL;
 194 
 195 #ifndef PRODUCT
 196 EntryPoint TemplateInterpreter::_trace_code;
 197 #endif // !PRODUCT
 198 EntryPoint TemplateInterpreter::_return_entry[TemplateInterpreter::number_of_return_entries];
 199 EntryPoint TemplateInterpreter::_return_entryX[TemplateInterpreter::number_of_return_entries];
 200 EntryPoint TemplateInterpreter::_earlyret_entry;
 201 EntryPoint TemplateInterpreter::_deopt_entry [TemplateInterpreter::number_of_deopt_entries ];
 202 address    TemplateInterpreter::_deopt_reexecute_return_entry;
 203 EntryPoint TemplateInterpreter::_safept_entry;
 204 
 205 address TemplateInterpreter::_invoke_return_entry[TemplateInterpreter::number_of_return_addrs];
 206 address TemplateInterpreter::_invoke_return_entryX[TemplateInterpreter::number_of_return_addrs];
 207 address TemplateInterpreter::_invokeinterface_return_entry[TemplateInterpreter::number_of_return_addrs];
 208 address TemplateInterpreter::_invokedynamic_return_entry[TemplateInterpreter::number_of_return_addrs];
 209 
 210 DispatchTable TemplateInterpreter::_active_table;
 211 DispatchTable TemplateInterpreter::_normal_table;
 212 DispatchTable TemplateInterpreter::_safept_table;
 213 address    TemplateInterpreter::_wentry_point[DispatchTable::length];
 214 
 215 
 216 //------------------------------------------------------------------------------------------------------------------------
 217 // Entry points
 218 
 219 /**
 220  * Returns the return entry table for the given invoke bytecode.
 221  */
 222 address* TemplateInterpreter::invoke_return_entry_table_for(Bytecodes::Code code) {
 223   switch (code) {
 224   case Bytecodes::_invokestatic:
 225   case Bytecodes::_invokespecial:
 226   case Bytecodes::_invokevirtual:
 227   case Bytecodes::_invokehandle:
 228     return Interpreter::invoke_return_entry_table();
 229   case Bytecodes::_invokeinterface:
 230     return Interpreter::invokeinterface_return_entry_table();
 231   case Bytecodes::_invokedynamic:
 232     return Interpreter::invokedynamic_return_entry_table();
 233   default:
 234     fatal("invalid bytecode: %s", Bytecodes::name(code));
 235     return NULL;
 236   }
 237 }
 238 
 239 /**
 240  * Returns the return entry address for the given top-of-stack state and bytecode.
 241  */
 242 address TemplateInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) {
 243   return return_entry(state, length, code, false);
 244 }
 245 
 246 address TemplateInterpreter::return_entry(TosState state, int length, Bytecodes::Code code, bool X) {
 247   guarantee(0 <= length && length < Interpreter::number_of_return_entries, "illegal length");
 248   const int index = TosState_as_index(state);
 249   switch (code) {
 250   case Bytecodes::_invokestatic:
 251   case Bytecodes::_invokespecial:
 252   case Bytecodes::_invokevirtual:
 253   case Bytecodes::_invokehandle:
 254     return X ? _invoke_return_entryX[index] : _invoke_return_entry[index];
 255   case Bytecodes::_invokeinterface:
 256     return _invokeinterface_return_entry[index];
 257   case Bytecodes::_invokedynamic:
 258     return _invokedynamic_return_entry[index];
 259   default:
 260     assert(!Bytecodes::is_invoke(code), "invoke instructions should be handled separately: %s", Bytecodes::name(code));
 261     address entry = (X ? _return_entryX[length] : _return_entry[length]).entry(state);
 262     vmassert(entry != NULL, "unsupported return entry requested, length=%d state=%d", length, index);
 263     return entry;
 264   }
 265 }
 266 
 267 
 268 address TemplateInterpreter::deopt_entry(TosState state, int length) {
 269   guarantee(0 <= length && length < Interpreter::number_of_deopt_entries, "illegal length");
 270   address entry = _deopt_entry[length].entry(state);
 271   vmassert(entry != NULL, "unsupported deopt entry requested, length=%d state=%d", length, TosState_as_index(state));
 272   return entry;
 273 }
 274 
 275 //------------------------------------------------------------------------------------------------------------------------
 276 // Suport for invokes
 277 
 278 int TemplateInterpreter::TosState_as_index(TosState state) {
 279   assert( state < number_of_states , "Invalid state in TosState_as_index");
 280   assert(0 <= (int)state && (int)state < TemplateInterpreter::number_of_return_addrs, "index out of bounds");
 281   return (int)state;


< prev index next >