72 73 CodeBlob* _cb; // CodeBlob that "owns" pc 74 enum deopt_state { 75 not_deoptimized, 76 is_deoptimized, 77 unknown 78 }; 79 80 deopt_state _deopt_state; 81 82 public: 83 // Constructors 84 frame(); 85 86 #ifndef PRODUCT 87 // This is a generic constructor which is only used by pns() in debug.cpp. 88 // pns (i.e. print native stack) uses this constructor to create a starting 89 // frame for stack walking. The implementation of this constructor is platform 90 // dependent (i.e. SPARC doesn't need an 'fp' argument an will ignore it) but 91 // we want to keep the signature generic because pns() is shared code. 92 frame(void* sp, void* fp, void* pc); 93 #endif 94 95 // Accessors 96 97 // pc: Returns the pc at which this frame will continue normally. 98 // It must point at the beginning of the next instruction to execute. 99 address pc() const { return _pc; } 100 101 // This returns the pc that if you were in the debugger you'd see. Not 102 // the idealized value in the frame object. This undoes the magic conversion 103 // that happens for deoptimized frames. In addition it makes the value the 104 // hardware would want to see in the native frame. The only user (at this point) 105 // is deoptimization. It likely no one else should ever use it. 106 address raw_pc() const; 107 108 void set_pc( address newpc ); 109 110 intptr_t* sp() const { return _sp; } 111 void set_sp( intptr_t* newsp ) { _sp = newsp; } 112 113 114 CodeBlob* cb() const { return _cb; } 115 116 // patching operations 117 void patch_pc(Thread* thread, address pc); 118 119 // Every frame needs to return a unique id which distinguishes it from all other frames. 120 // For sparc and ia32 use sp. ia64 can have memory frames that are empty so multiple frames 121 // will have identical sp values. For ia64 the bsp (fp) value will serve. No real frame 122 // should have an id() of NULL so it is a distinguishing value for an unmatchable frame. 123 // We also have relationals which allow comparing a frame to anoth frame's id() allow 124 // us to distinguish younger (more recent activation) from older (less recent activations) 125 // A NULL id is only valid when comparing for equality. 126 127 intptr_t* id(void) const; 128 bool is_younger(intptr_t* id) const; 129 bool is_older(intptr_t* id) const; 130 131 // testers 132 133 // Compares for strict equality. Rarely used or needed. 134 // It can return a different result than f1.id() == f2.id() 135 bool equal(frame other) const; 136 137 // type testers | 72 73 CodeBlob* _cb; // CodeBlob that "owns" pc 74 enum deopt_state { 75 not_deoptimized, 76 is_deoptimized, 77 unknown 78 }; 79 80 deopt_state _deopt_state; 81 82 public: 83 // Constructors 84 frame(); 85 86 #ifndef PRODUCT 87 // This is a generic constructor which is only used by pns() in debug.cpp. 88 // pns (i.e. print native stack) uses this constructor to create a starting 89 // frame for stack walking. The implementation of this constructor is platform 90 // dependent (i.e. SPARC doesn't need an 'fp' argument an will ignore it) but 91 // we want to keep the signature generic because pns() is shared code. 92 frame(Thread* thread, void* sp, void* fp, void* pc); 93 #endif 94 95 // Accessors 96 97 // pc: Returns the pc at which this frame will continue normally. 98 // It must point at the beginning of the next instruction to execute. 99 address pc() const { return _pc; } 100 101 // This returns the pc that if you were in the debugger you'd see. Not 102 // the idealized value in the frame object. This undoes the magic conversion 103 // that happens for deoptimized frames. In addition it makes the value the 104 // hardware would want to see in the native frame. The only user (at this point) 105 // is deoptimization. It likely no one else should ever use it. 106 address raw_pc(Thread* thread) const; 107 108 void set_pc(Thread* thread, address newpc); 109 110 intptr_t* sp() const { return _sp; } 111 void set_sp( intptr_t* newsp ) { _sp = newsp; } 112 113 114 CodeBlob* cb() const { return _cb; } 115 116 // patching operations 117 void patch_pc(Thread* thread, address pc); 118 119 address* raw_sender_pc_addr(); 120 void memento_mark(Thread* thread); 121 bool is_memento_marked(Thread* thread); 122 123 // Every frame needs to return a unique id which distinguishes it from all other frames. 124 // For sparc and ia32 use sp. ia64 can have memory frames that are empty so multiple frames 125 // will have identical sp values. For ia64 the bsp (fp) value will serve. No real frame 126 // should have an id() of NULL so it is a distinguishing value for an unmatchable frame. 127 // We also have relationals which allow comparing a frame to anoth frame's id() allow 128 // us to distinguish younger (more recent activation) from older (less recent activations) 129 // A NULL id is only valid when comparing for equality. 130 131 intptr_t* id(void) const; 132 bool is_younger(intptr_t* id) const; 133 bool is_older(intptr_t* id) const; 134 135 // testers 136 137 // Compares for strict equality. Rarely used or needed. 138 // It can return a different result than f1.id() == f2.id() 139 bool equal(frame other) const; 140 141 // type testers |