135 // References to generated stubs 136 static address _new_instance_Java; 137 static address _new_array_Java; 138 static address _new_array_nozero_Java; 139 static address _multianewarray2_Java; 140 static address _multianewarray3_Java; 141 static address _multianewarray4_Java; 142 static address _multianewarray5_Java; 143 static address _multianewarrayN_Java; 144 static address _g1_wb_pre_Java; 145 static address _g1_wb_post_Java; 146 static address _vtable_must_compile_Java; 147 static address _complete_monitor_locking_Java; 148 static address _rethrow_Java; 149 static address _monitor_notify_Java; 150 static address _monitor_notifyAll_Java; 151 152 static address _slow_arraycopy_Java; 153 static address _register_finalizer_Java; 154 155 # ifdef ENABLE_ZAP_DEAD_LOCALS 156 static address _zap_dead_Java_locals_Java; 157 static address _zap_dead_native_locals_Java; 158 # endif 159 160 161 // 162 // Implementation of runtime methods 163 // ================================= 164 165 // Allocate storage for a Java instance. 166 static void new_instance_C(Klass* instance_klass, JavaThread *thread); 167 168 // Allocate storage for a objArray or typeArray 169 static void new_array_C(Klass* array_klass, int len, JavaThread *thread); 170 static void new_array_nozero_C(Klass* array_klass, int len, JavaThread *thread); 171 172 // Post-slow-path-allocation, pre-initializing-stores step for 173 // implementing ReduceInitialCardMarks 174 static void new_store_pre_barrier(JavaThread* thread); 175 176 // Allocate storage for a multi-dimensional arrays 177 // Note: needs to be fixed for arbitrary number of dimensions 178 static void multianewarray2_C(Klass* klass, int len1, int len2, JavaThread *thread); 179 static void multianewarray3_C(Klass* klass, int len1, int len2, int len3, JavaThread *thread); 180 static void multianewarray4_C(Klass* klass, int len1, int len2, int len3, int len4, JavaThread *thread); 195 196 // Implicit exception support 197 static void throw_null_exception_C(JavaThread* thread); 198 199 // Exception handling 200 static address handle_exception_C (JavaThread* thread); 201 static address handle_exception_C_helper(JavaThread* thread, nmethod*& nm); 202 static address rethrow_C (oopDesc* exception, JavaThread *thread, address return_pc ); 203 static void deoptimize_caller_frame (JavaThread *thread); 204 static void deoptimize_caller_frame (JavaThread *thread, bool doit); 205 static bool is_deoptimized_caller_frame (JavaThread *thread); 206 207 // CodeBlob support 208 // =================================================================== 209 210 static ExceptionBlob* _exception_blob; 211 static void generate_exception_blob(); 212 213 static void register_finalizer(oopDesc* obj, JavaThread* thread); 214 215 // zaping dead locals, either from Java frames or from native frames 216 # ifdef ENABLE_ZAP_DEAD_LOCALS 217 static void zap_dead_Java_locals_C( JavaThread* thread); 218 static void zap_dead_native_locals_C( JavaThread* thread); 219 220 static void zap_dead_java_or_native_locals( JavaThread*, bool (*)(frame*)); 221 222 public: 223 static int ZapDeadCompiledLocals_count; 224 225 # endif 226 227 228 public: 229 230 static bool is_callee_saved_register(MachRegisterNumbers reg); 231 232 // One time only generate runtime code stubs. Returns true 233 // when runtime stubs have been generated successfully and 234 // false otherwise. 235 static bool generate(ciEnv* env); 236 237 // Returns the name of a stub 238 static const char* stub_name(address entry); 239 240 // access to runtime stubs entry points for java code 241 static address new_instance_Java() { return _new_instance_Java; } 242 static address new_array_Java() { return _new_array_Java; } 243 static address new_array_nozero_Java() { return _new_array_nozero_Java; } 244 static address multianewarray2_Java() { return _multianewarray2_Java; } 245 static address multianewarray3_Java() { return _multianewarray3_Java; } 246 static address multianewarray4_Java() { return _multianewarray4_Java; } 247 static address multianewarray5_Java() { return _multianewarray5_Java; } 248 static address multianewarrayN_Java() { return _multianewarrayN_Java; } 249 static address g1_wb_pre_Java() { return _g1_wb_pre_Java; } 250 static address g1_wb_post_Java() { return _g1_wb_post_Java; } 251 static address vtable_must_compile_stub() { return _vtable_must_compile_Java; } 252 static address complete_monitor_locking_Java() { return _complete_monitor_locking_Java; } 253 static address monitor_notify_Java() { return _monitor_notify_Java; } 254 static address monitor_notifyAll_Java() { return _monitor_notifyAll_Java; } 255 256 static address slow_arraycopy_Java() { return _slow_arraycopy_Java; } 257 static address register_finalizer_Java() { return _register_finalizer_Java; } 258 259 260 # ifdef ENABLE_ZAP_DEAD_LOCALS 261 static address zap_dead_locals_stub(bool is_native) { return is_native 262 ? _zap_dead_native_locals_Java 263 : _zap_dead_Java_locals_Java; } 264 static MachNode* node_to_call_zap_dead_locals(Node* n, int block_num, bool is_native); 265 # endif 266 267 static ExceptionBlob* exception_blob() { return _exception_blob; } 268 269 // Leaf routines helping with method data update 270 static void profile_receiver_type_C(DataLayout* data, oopDesc* receiver); 271 272 // Implicit exception support 273 static void throw_div0_exception_C (JavaThread* thread); 274 static void throw_stack_overflow_error_C(JavaThread* thread); 275 276 // Exception handling 277 static address rethrow_stub() { return _rethrow_Java; } 278 279 280 // Type functions 281 // ====================================================== 282 283 static const TypeFunc* new_instance_Type(); // object allocation (slow case) 284 static const TypeFunc* new_array_Type (); // [a]newarray (slow case) 285 static const TypeFunc* multianewarray_Type(int ndim); // multianewarray 286 static const TypeFunc* multianewarray2_Type(); // multianewarray 336 // leaf on stack replacement interpreter accessor types 337 static const TypeFunc* osr_end_Type(); 338 339 // leaf methodData routine types 340 static const TypeFunc* profile_receiver_type_Type(); 341 342 // leaf on stack replacement interpreter accessor types 343 static const TypeFunc* fetch_int_Type(); 344 static const TypeFunc* fetch_long_Type(); 345 static const TypeFunc* fetch_float_Type(); 346 static const TypeFunc* fetch_double_Type(); 347 static const TypeFunc* fetch_oop_Type(); 348 static const TypeFunc* fetch_monitor_Type(); 349 350 static const TypeFunc* register_finalizer_Type(); 351 352 // Dtrace support 353 static const TypeFunc* dtrace_method_entry_exit_Type(); 354 static const TypeFunc* dtrace_object_alloc_Type(); 355 356 # ifdef ENABLE_ZAP_DEAD_LOCALS 357 static const TypeFunc* zap_dead_locals_Type(); 358 # endif 359 360 private: 361 static NamedCounter * volatile _named_counters; 362 363 public: 364 // helper function which creates a named counter labeled with the 365 // if they are available 366 static NamedCounter* new_named_counter(JVMState* jvms, NamedCounter::CounterTag tag); 367 368 // dumps all the named counters 369 static void print_named_counters(); 370 371 }; 372 373 #endif // SHARE_VM_OPTO_RUNTIME_HPP | 135 // References to generated stubs 136 static address _new_instance_Java; 137 static address _new_array_Java; 138 static address _new_array_nozero_Java; 139 static address _multianewarray2_Java; 140 static address _multianewarray3_Java; 141 static address _multianewarray4_Java; 142 static address _multianewarray5_Java; 143 static address _multianewarrayN_Java; 144 static address _g1_wb_pre_Java; 145 static address _g1_wb_post_Java; 146 static address _vtable_must_compile_Java; 147 static address _complete_monitor_locking_Java; 148 static address _rethrow_Java; 149 static address _monitor_notify_Java; 150 static address _monitor_notifyAll_Java; 151 152 static address _slow_arraycopy_Java; 153 static address _register_finalizer_Java; 154 155 // 156 // Implementation of runtime methods 157 // ================================= 158 159 // Allocate storage for a Java instance. 160 static void new_instance_C(Klass* instance_klass, JavaThread *thread); 161 162 // Allocate storage for a objArray or typeArray 163 static void new_array_C(Klass* array_klass, int len, JavaThread *thread); 164 static void new_array_nozero_C(Klass* array_klass, int len, JavaThread *thread); 165 166 // Post-slow-path-allocation, pre-initializing-stores step for 167 // implementing ReduceInitialCardMarks 168 static void new_store_pre_barrier(JavaThread* thread); 169 170 // Allocate storage for a multi-dimensional arrays 171 // Note: needs to be fixed for arbitrary number of dimensions 172 static void multianewarray2_C(Klass* klass, int len1, int len2, JavaThread *thread); 173 static void multianewarray3_C(Klass* klass, int len1, int len2, int len3, JavaThread *thread); 174 static void multianewarray4_C(Klass* klass, int len1, int len2, int len3, int len4, JavaThread *thread); 189 190 // Implicit exception support 191 static void throw_null_exception_C(JavaThread* thread); 192 193 // Exception handling 194 static address handle_exception_C (JavaThread* thread); 195 static address handle_exception_C_helper(JavaThread* thread, nmethod*& nm); 196 static address rethrow_C (oopDesc* exception, JavaThread *thread, address return_pc ); 197 static void deoptimize_caller_frame (JavaThread *thread); 198 static void deoptimize_caller_frame (JavaThread *thread, bool doit); 199 static bool is_deoptimized_caller_frame (JavaThread *thread); 200 201 // CodeBlob support 202 // =================================================================== 203 204 static ExceptionBlob* _exception_blob; 205 static void generate_exception_blob(); 206 207 static void register_finalizer(oopDesc* obj, JavaThread* thread); 208 209 public: 210 211 static bool is_callee_saved_register(MachRegisterNumbers reg); 212 213 // One time only generate runtime code stubs. Returns true 214 // when runtime stubs have been generated successfully and 215 // false otherwise. 216 static bool generate(ciEnv* env); 217 218 // Returns the name of a stub 219 static const char* stub_name(address entry); 220 221 // access to runtime stubs entry points for java code 222 static address new_instance_Java() { return _new_instance_Java; } 223 static address new_array_Java() { return _new_array_Java; } 224 static address new_array_nozero_Java() { return _new_array_nozero_Java; } 225 static address multianewarray2_Java() { return _multianewarray2_Java; } 226 static address multianewarray3_Java() { return _multianewarray3_Java; } 227 static address multianewarray4_Java() { return _multianewarray4_Java; } 228 static address multianewarray5_Java() { return _multianewarray5_Java; } 229 static address multianewarrayN_Java() { return _multianewarrayN_Java; } 230 static address g1_wb_pre_Java() { return _g1_wb_pre_Java; } 231 static address g1_wb_post_Java() { return _g1_wb_post_Java; } 232 static address vtable_must_compile_stub() { return _vtable_must_compile_Java; } 233 static address complete_monitor_locking_Java() { return _complete_monitor_locking_Java; } 234 static address monitor_notify_Java() { return _monitor_notify_Java; } 235 static address monitor_notifyAll_Java() { return _monitor_notifyAll_Java; } 236 237 static address slow_arraycopy_Java() { return _slow_arraycopy_Java; } 238 static address register_finalizer_Java() { return _register_finalizer_Java; } 239 240 static ExceptionBlob* exception_blob() { return _exception_blob; } 241 242 // Leaf routines helping with method data update 243 static void profile_receiver_type_C(DataLayout* data, oopDesc* receiver); 244 245 // Implicit exception support 246 static void throw_div0_exception_C (JavaThread* thread); 247 static void throw_stack_overflow_error_C(JavaThread* thread); 248 249 // Exception handling 250 static address rethrow_stub() { return _rethrow_Java; } 251 252 253 // Type functions 254 // ====================================================== 255 256 static const TypeFunc* new_instance_Type(); // object allocation (slow case) 257 static const TypeFunc* new_array_Type (); // [a]newarray (slow case) 258 static const TypeFunc* multianewarray_Type(int ndim); // multianewarray 259 static const TypeFunc* multianewarray2_Type(); // multianewarray 309 // leaf on stack replacement interpreter accessor types 310 static const TypeFunc* osr_end_Type(); 311 312 // leaf methodData routine types 313 static const TypeFunc* profile_receiver_type_Type(); 314 315 // leaf on stack replacement interpreter accessor types 316 static const TypeFunc* fetch_int_Type(); 317 static const TypeFunc* fetch_long_Type(); 318 static const TypeFunc* fetch_float_Type(); 319 static const TypeFunc* fetch_double_Type(); 320 static const TypeFunc* fetch_oop_Type(); 321 static const TypeFunc* fetch_monitor_Type(); 322 323 static const TypeFunc* register_finalizer_Type(); 324 325 // Dtrace support 326 static const TypeFunc* dtrace_method_entry_exit_Type(); 327 static const TypeFunc* dtrace_object_alloc_Type(); 328 329 private: 330 static NamedCounter * volatile _named_counters; 331 332 public: 333 // helper function which creates a named counter labeled with the 334 // if they are available 335 static NamedCounter* new_named_counter(JVMState* jvms, NamedCounter::CounterTag tag); 336 337 // dumps all the named counters 338 static void print_named_counters(); 339 340 }; 341 342 #endif // SHARE_VM_OPTO_RUNTIME_HPP |