| 102 | } |
| 103 | |
| 104 | static inline bool isFrameComplete(instruction_t* entry, instruction_t* ip) { |
| 105 | // Frame is fully constructed after rsp is decremented by the frame size. |
| 106 | // Check if there is such an instruction anywhere between |
| 107 | // the method entry and the current instruction pointer. |
| 108 | for (ip -= 4; ip >= entry; ip--) { |
| 109 | if (ip[0] == 0x48 && ip[2] == 0xec && (ip[1] & 0xfd) == 0x81) { // sub rsp, frame_size |
| 110 | return true; |
| 111 | } |
| 112 | } |
| 113 | return false; |
| 114 | } |
| 115 | |
| 116 | bool StackFrame::unwindPrologue(NMethod* nm, uintptr_t& pc, uintptr_t& sp, uintptr_t& fp) { |
| 117 | // 0: mov %eax,-0x14000(%rsp) |