103 static address _throw_WrongMethodType_entry; 104 static address _throw_NullPointerException_entry; 105 static address _throw_exception_entry; 106 107 static address _throw_StackOverflowError_entry; 108 109 static address _remove_activation_entry; // continuation address if an exception is not handled by current frame 110 #ifdef HOTSWAP 111 static address _remove_activation_preserving_args_entry; // continuation address when current frame is being popped 112 #endif // HOTSWAP 113 114 #ifndef PRODUCT 115 static EntryPoint _trace_code; 116 #endif // !PRODUCT 117 static EntryPoint _return_entry[number_of_return_entries]; // entry points to return to from a call 118 static EntryPoint _earlyret_entry; // entry point to return early from a call 119 static EntryPoint _deopt_entry[number_of_deopt_entries]; // entry points to return to from a deoptimization 120 static EntryPoint _continuation_entry; 121 static EntryPoint _safept_entry; 122 123 static address _return_3_addrs_by_index[number_of_return_addrs]; // for invokevirtual return entries 124 static address _return_5_addrs_by_index[number_of_return_addrs]; // for invokeinterface return entries 125 126 static DispatchTable _active_table; // the active dispatch table (used by the interpreter for dispatch) 127 static DispatchTable _normal_table; // the normal dispatch table (used to set the active table in normal mode) 128 static DispatchTable _safept_table; // the safepoint dispatch table (used to set the active table for safepoints) 129 static address _wentry_point[DispatchTable::length]; // wide instructions only (vtos tosca always) 130 131 132 public: 133 // Initialization/debugging 134 static void initialize(); 135 // this only returns whether a pc is within generated code for the interpreter. 136 static bool contains(address pc) { return _code != NULL && _code->contains(pc); } 137 138 public: 139 140 static address remove_activation_early_entry(TosState state) { return _earlyret_entry.entry(state); } 141 #ifdef HOTSWAP 142 static address remove_activation_preserving_args_entry() { return _remove_activation_preserving_args_entry; } 143 #endif // HOTSWAP 144 145 static address remove_activation_entry() { return _remove_activation_entry; } 146 static address throw_exception_entry() { return _throw_exception_entry; } 147 static address throw_ArithmeticException_entry() { return _throw_ArithmeticException_entry; } 148 static address throw_WrongMethodType_entry() { return _throw_WrongMethodType_entry; } 149 static address throw_NullPointerException_entry() { return _throw_NullPointerException_entry; } 150 static address throw_StackOverflowError_entry() { return _throw_StackOverflowError_entry; } 151 152 // Code generation 153 #ifndef PRODUCT 154 static address trace_code (TosState state) { return _trace_code.entry(state); } 155 #endif // !PRODUCT 156 static address continuation (TosState state) { return _continuation_entry.entry(state); } 157 static address* dispatch_table(TosState state) { return _active_table.table_for(state); } 158 static address* dispatch_table() { return _active_table.table_for(); } 159 static int distance_from_dispatch_table(TosState state){ return _active_table.distance_from(state); } 160 static address* normal_table(TosState state) { return _normal_table.table_for(state); } 161 static address* normal_table() { return _normal_table.table_for(); } 162 163 // Support for invokes 164 static address* return_3_addrs_by_index_table() { return _return_3_addrs_by_index; } 165 static address* return_5_addrs_by_index_table() { return _return_5_addrs_by_index; } 166 static int TosState_as_index(TosState state); // computes index into return_3_entry_by_index table 167 168 static address return_entry (TosState state, int length); 169 static address deopt_entry (TosState state, int length); 170 171 // Safepoint support 172 static void notice_safepoints(); // stops the thread when reaching a safepoint 173 static void ignore_safepoints(); // ignores safepoints 174 175 // Deoptimization support 176 // Compute the entry address for continuation after 177 static address deopt_continue_after_entry(Method* method, 178 address bcp, 179 int callee_parameters, 180 bool is_top_frame); 181 // Deoptimization should reexecute this bytecode 182 static bool bytecode_should_reexecute(Bytecodes::Code code); 183 // Compute the address for reexecution 184 static address deopt_reexecute_entry(Method* method, address bcp); 185 186 #ifdef TARGET_ARCH_x86 187 # include "templateInterpreter_x86.hpp" 188 #endif 189 #ifdef TARGET_ARCH_sparc | 103 static address _throw_WrongMethodType_entry; 104 static address _throw_NullPointerException_entry; 105 static address _throw_exception_entry; 106 107 static address _throw_StackOverflowError_entry; 108 109 static address _remove_activation_entry; // continuation address if an exception is not handled by current frame 110 #ifdef HOTSWAP 111 static address _remove_activation_preserving_args_entry; // continuation address when current frame is being popped 112 #endif // HOTSWAP 113 114 #ifndef PRODUCT 115 static EntryPoint _trace_code; 116 #endif // !PRODUCT 117 static EntryPoint _return_entry[number_of_return_entries]; // entry points to return to from a call 118 static EntryPoint _earlyret_entry; // entry point to return early from a call 119 static EntryPoint _deopt_entry[number_of_deopt_entries]; // entry points to return to from a deoptimization 120 static EntryPoint _continuation_entry; 121 static EntryPoint _safept_entry; 122 123 static address _invoke_return_entry[number_of_return_addrs]; // for invokevirtual return entries 124 static address _invokeinterface_return_entry[number_of_return_addrs]; // for invokeinterface return entries 125 static address _invokedynamic_return_entry[number_of_return_addrs]; // for invokedynamic return entries 126 127 static DispatchTable _active_table; // the active dispatch table (used by the interpreter for dispatch) 128 static DispatchTable _normal_table; // the normal dispatch table (used to set the active table in normal mode) 129 static DispatchTable _safept_table; // the safepoint dispatch table (used to set the active table for safepoints) 130 static address _wentry_point[DispatchTable::length]; // wide instructions only (vtos tosca always) 131 132 133 public: 134 // Initialization/debugging 135 static void initialize(); 136 // this only returns whether a pc is within generated code for the interpreter. 137 static bool contains(address pc) { return _code != NULL && _code->contains(pc); } 138 139 public: 140 141 static address remove_activation_early_entry(TosState state) { return _earlyret_entry.entry(state); } 142 #ifdef HOTSWAP 143 static address remove_activation_preserving_args_entry() { return _remove_activation_preserving_args_entry; } 144 #endif // HOTSWAP 145 146 static address remove_activation_entry() { return _remove_activation_entry; } 147 static address throw_exception_entry() { return _throw_exception_entry; } 148 static address throw_ArithmeticException_entry() { return _throw_ArithmeticException_entry; } 149 static address throw_WrongMethodType_entry() { return _throw_WrongMethodType_entry; } 150 static address throw_NullPointerException_entry() { return _throw_NullPointerException_entry; } 151 static address throw_StackOverflowError_entry() { return _throw_StackOverflowError_entry; } 152 153 // Code generation 154 #ifndef PRODUCT 155 static address trace_code (TosState state) { return _trace_code.entry(state); } 156 #endif // !PRODUCT 157 static address continuation (TosState state) { return _continuation_entry.entry(state); } 158 static address* dispatch_table(TosState state) { return _active_table.table_for(state); } 159 static address* dispatch_table() { return _active_table.table_for(); } 160 static int distance_from_dispatch_table(TosState state){ return _active_table.distance_from(state); } 161 static address* normal_table(TosState state) { return _normal_table.table_for(state); } 162 static address* normal_table() { return _normal_table.table_for(); } 163 164 // Support for invokes 165 static address* invoke_return_entry_table() { return _invoke_return_entry; } 166 static address* invokeinterface_return_entry_table() { return _invokeinterface_return_entry; } 167 static address* invokedynamic_return_entry_table() { return _invokedynamic_return_entry; } 168 static int TosState_as_index(TosState state); 169 170 static address* invoke_return_entry_table_for(Bytecodes::Code code); 171 172 static address deopt_entry(TosState state, int length); 173 static address return_entry(TosState state, int length, Bytecodes::Code code); 174 175 // Safepoint support 176 static void notice_safepoints(); // stops the thread when reaching a safepoint 177 static void ignore_safepoints(); // ignores safepoints 178 179 // Deoptimization support 180 // Compute the entry address for continuation after 181 static address deopt_continue_after_entry(Method* method, 182 address bcp, 183 int callee_parameters, 184 bool is_top_frame); 185 // Deoptimization should reexecute this bytecode 186 static bool bytecode_should_reexecute(Bytecodes::Code code); 187 // Compute the address for reexecution 188 static address deopt_reexecute_entry(Method* method, address bcp); 189 190 #ifdef TARGET_ARCH_x86 191 # include "templateInterpreter_x86.hpp" 192 #endif 193 #ifdef TARGET_ARCH_sparc |