224 intptr_t* sender_sp() const; 225 226 // Returns the real 'frame pointer' for the current frame. 227 // This is the value expected by the platform ABI when it defines a 228 // frame pointer register. It may differ from the effective value of 229 // the FP register when that register is used in the JVM for other 230 // purposes (like compiled frames on some platforms). 231 // On other platforms, it is defined so that the stack area used by 232 // this frame goes from real_fp() to sp(). 233 intptr_t* real_fp() const; 234 235 // Deoptimization info, if needed (platform dependent). 236 // Stored in the initial_info field of the unroll info, to be used by 237 // the platform dependent deoptimization blobs. 238 intptr_t *initial_deoptimization_info(); 239 240 // Interpreter frames: 241 242 private: 243 intptr_t** interpreter_frame_locals_addr() const; 244 intptr_t* interpreter_frame_bcx_addr() const; 245 intptr_t* interpreter_frame_mdx_addr() const; 246 247 public: 248 // Locals 249 250 // The _at version returns a pointer because the address is used for GC. 251 intptr_t* interpreter_frame_local_at(int index) const; 252 253 void interpreter_frame_set_locals(intptr_t* locs); 254 255 // byte code index/pointer (use these functions for unchecked frame access only!) 256 intptr_t interpreter_frame_bcx() const { return *interpreter_frame_bcx_addr(); } 257 void interpreter_frame_set_bcx(intptr_t bcx); 258 259 // byte code index 260 jint interpreter_frame_bci() const; 261 void interpreter_frame_set_bci(jint bci); 262 263 // byte code pointer 264 address interpreter_frame_bcp() const; 265 void interpreter_frame_set_bcp(address bcp); 266 267 // Unchecked access to the method data index/pointer. 268 // Only use this if you know what you are doing. 269 intptr_t interpreter_frame_mdx() const { return *interpreter_frame_mdx_addr(); } 270 void interpreter_frame_set_mdx(intptr_t mdx); 271 272 // method data pointer 273 address interpreter_frame_mdp() const; 274 void interpreter_frame_set_mdp(address dp); 275 276 // Find receiver out of caller's (compiled) argument list 277 oop retrieve_receiver(RegisterMap *reg_map); 278 279 // Return the monitor owner and BasicLock for compiled synchronized 280 // native methods so that biased locking can revoke the receiver's 281 // bias if necessary. This is also used by JVMTI's GetLocalInstance method 282 // (via VM_GetReceiver) to retrieve the receiver from a native wrapper frame. 283 BasicLock* get_native_monitor(); 284 oop get_native_receiver(); 285 286 // Find receiver for an invoke when arguments are just pushed on stack (i.e., callee stack-frame is 287 // not setup) 288 oop interpreter_callee_receiver(Symbol* signature) { return *interpreter_callee_receiver_addr(signature); } 289 290 291 oop* interpreter_callee_receiver_addr(Symbol* signature); 420 // Oops-do's 421 void oops_compiled_arguments_do(Symbol* signature, bool has_receiver, bool has_appendix, const RegisterMap* reg_map, OopClosure* f); 422 void oops_interpreted_do(OopClosure* f, CLDClosure* cld_f, const RegisterMap* map, bool query_oop_map_cache = true); 423 424 private: 425 void oops_interpreted_arguments_do(Symbol* signature, bool has_receiver, OopClosure* f); 426 427 // Iteration of oops 428 void oops_do_internal(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf, RegisterMap* map, bool use_interpreter_oop_map_cache); 429 void oops_entry_do(OopClosure* f, const RegisterMap* map); 430 void oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* map); 431 int adjust_offset(Method* method, int index); // helper for above fn 432 public: 433 // Memory management 434 void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf, RegisterMap* map) { oops_do_internal(f, cld_f, cf, map, true); } 435 void nmethods_do(CodeBlobClosure* cf); 436 437 // RedefineClasses support for finding live interpreted methods on the stack 438 void metadata_do(void f(Metadata*)); 439 440 void gc_prologue(); 441 void gc_epilogue(); 442 void pd_gc_epilog(); 443 444 # ifdef ENABLE_ZAP_DEAD_LOCALS 445 private: 446 class CheckValueClosure: public OopClosure { 447 public: 448 void do_oop(oop* p); 449 void do_oop(narrowOop* p) { ShouldNotReachHere(); } 450 }; 451 static CheckValueClosure _check_value; 452 453 class CheckOopClosure: public OopClosure { 454 public: 455 void do_oop(oop* p); 456 void do_oop(narrowOop* p) { ShouldNotReachHere(); } 457 }; 458 static CheckOopClosure _check_oop; 459 460 static void check_derived_oop(oop* base, oop* derived); 461 462 class ZapDeadClosure: public OopClosure { 463 public: 464 void do_oop(oop* p); 465 void do_oop(narrowOop* p) { ShouldNotReachHere(); } 466 }; 467 static ZapDeadClosure _zap_dead; 468 469 public: 470 // Zapping 471 void zap_dead_locals (JavaThread* thread, const RegisterMap* map); 472 void zap_dead_interpreted_locals(JavaThread* thread, const RegisterMap* map); 473 void zap_dead_compiled_locals (JavaThread* thread, const RegisterMap* map); 474 void zap_dead_entry_locals (JavaThread* thread, const RegisterMap* map); 475 void zap_dead_deoptimized_locals(JavaThread* thread, const RegisterMap* map); 476 # endif 477 // Verification 478 void verify(const RegisterMap* map); 479 static bool verify_return_pc(address x); 480 static bool is_bci(intptr_t bcx); 481 // Usage: 482 // assert(frame::verify_return_pc(return_address), "must be a return pc"); 483 484 int pd_oop_map_offset_adjustment() const; 485 486 #ifdef TARGET_ARCH_x86 487 # include "frame_x86.hpp" 488 #endif 489 #ifdef TARGET_ARCH_sparc 490 # include "frame_sparc.hpp" 491 #endif 492 #ifdef TARGET_ARCH_zero 493 # include "frame_zero.hpp" 494 #endif 495 #ifdef TARGET_ARCH_arm 496 # include "frame_arm.hpp" 497 #endif 498 #ifdef TARGET_ARCH_ppc 499 # include "frame_ppc.hpp" 500 #endif | 224 intptr_t* sender_sp() const; 225 226 // Returns the real 'frame pointer' for the current frame. 227 // This is the value expected by the platform ABI when it defines a 228 // frame pointer register. It may differ from the effective value of 229 // the FP register when that register is used in the JVM for other 230 // purposes (like compiled frames on some platforms). 231 // On other platforms, it is defined so that the stack area used by 232 // this frame goes from real_fp() to sp(). 233 intptr_t* real_fp() const; 234 235 // Deoptimization info, if needed (platform dependent). 236 // Stored in the initial_info field of the unroll info, to be used by 237 // the platform dependent deoptimization blobs. 238 intptr_t *initial_deoptimization_info(); 239 240 // Interpreter frames: 241 242 private: 243 intptr_t** interpreter_frame_locals_addr() const; 244 intptr_t* interpreter_frame_bcp_addr() const; 245 intptr_t* interpreter_frame_mdp_addr() const; 246 247 public: 248 // Locals 249 250 // The _at version returns a pointer because the address is used for GC. 251 intptr_t* interpreter_frame_local_at(int index) const; 252 253 void interpreter_frame_set_locals(intptr_t* locs); 254 255 // byte code index 256 jint interpreter_frame_bci() const; 257 258 // byte code pointer 259 address interpreter_frame_bcp() const; 260 void interpreter_frame_set_bcp(address bcp); 261 262 // method data pointer 263 address interpreter_frame_mdp() const; 264 void interpreter_frame_set_mdp(address dp); 265 266 // Find receiver out of caller's (compiled) argument list 267 oop retrieve_receiver(RegisterMap *reg_map); 268 269 // Return the monitor owner and BasicLock for compiled synchronized 270 // native methods so that biased locking can revoke the receiver's 271 // bias if necessary. This is also used by JVMTI's GetLocalInstance method 272 // (via VM_GetReceiver) to retrieve the receiver from a native wrapper frame. 273 BasicLock* get_native_monitor(); 274 oop get_native_receiver(); 275 276 // Find receiver for an invoke when arguments are just pushed on stack (i.e., callee stack-frame is 277 // not setup) 278 oop interpreter_callee_receiver(Symbol* signature) { return *interpreter_callee_receiver_addr(signature); } 279 280 281 oop* interpreter_callee_receiver_addr(Symbol* signature); 410 // Oops-do's 411 void oops_compiled_arguments_do(Symbol* signature, bool has_receiver, bool has_appendix, const RegisterMap* reg_map, OopClosure* f); 412 void oops_interpreted_do(OopClosure* f, CLDClosure* cld_f, const RegisterMap* map, bool query_oop_map_cache = true); 413 414 private: 415 void oops_interpreted_arguments_do(Symbol* signature, bool has_receiver, OopClosure* f); 416 417 // Iteration of oops 418 void oops_do_internal(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf, RegisterMap* map, bool use_interpreter_oop_map_cache); 419 void oops_entry_do(OopClosure* f, const RegisterMap* map); 420 void oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* map); 421 int adjust_offset(Method* method, int index); // helper for above fn 422 public: 423 // Memory management 424 void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf, RegisterMap* map) { oops_do_internal(f, cld_f, cf, map, true); } 425 void nmethods_do(CodeBlobClosure* cf); 426 427 // RedefineClasses support for finding live interpreted methods on the stack 428 void metadata_do(void f(Metadata*)); 429 430 # ifdef ENABLE_ZAP_DEAD_LOCALS 431 private: 432 class CheckValueClosure: public OopClosure { 433 public: 434 void do_oop(oop* p); 435 void do_oop(narrowOop* p) { ShouldNotReachHere(); } 436 }; 437 static CheckValueClosure _check_value; 438 439 class CheckOopClosure: public OopClosure { 440 public: 441 void do_oop(oop* p); 442 void do_oop(narrowOop* p) { ShouldNotReachHere(); } 443 }; 444 static CheckOopClosure _check_oop; 445 446 static void check_derived_oop(oop* base, oop* derived); 447 448 class ZapDeadClosure: public OopClosure { 449 public: 450 void do_oop(oop* p); 451 void do_oop(narrowOop* p) { ShouldNotReachHere(); } 452 }; 453 static ZapDeadClosure _zap_dead; 454 455 public: 456 // Zapping 457 void zap_dead_locals (JavaThread* thread, const RegisterMap* map); 458 void zap_dead_interpreted_locals(JavaThread* thread, const RegisterMap* map); 459 void zap_dead_compiled_locals (JavaThread* thread, const RegisterMap* map); 460 void zap_dead_entry_locals (JavaThread* thread, const RegisterMap* map); 461 void zap_dead_deoptimized_locals(JavaThread* thread, const RegisterMap* map); 462 # endif 463 // Verification 464 void verify(const RegisterMap* map); 465 static bool verify_return_pc(address x); 466 // Usage: 467 // assert(frame::verify_return_pc(return_address), "must be a return pc"); 468 469 int pd_oop_map_offset_adjustment() const; 470 471 #ifdef TARGET_ARCH_x86 472 # include "frame_x86.hpp" 473 #endif 474 #ifdef TARGET_ARCH_sparc 475 # include "frame_sparc.hpp" 476 #endif 477 #ifdef TARGET_ARCH_zero 478 # include "frame_zero.hpp" 479 #endif 480 #ifdef TARGET_ARCH_arm 481 # include "frame_arm.hpp" 482 #endif 483 #ifdef TARGET_ARCH_ppc 484 # include "frame_ppc.hpp" 485 #endif |