OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "src/x64/eh-frame-x64.h" |
| 6 |
| 7 namespace v8 { |
| 8 namespace internal { |
| 9 |
| 10 static const int kRbpDwarfCode = 6; |
| 11 static const int kRspDwarfCode = 7; |
| 12 static const int kRipDwarfCode = 16; |
| 13 |
| 14 const char* DwarfRegisterCodeToString(int code) { |
| 15 switch (code) { |
| 16 case kRbpDwarfCode: |
| 17 return "rbp"; |
| 18 case kRspDwarfCode: |
| 19 return "rsp"; |
| 20 case kRipDwarfCode: |
| 21 return "rip"; |
| 22 default: |
| 23 UNIMPLEMENTED(); |
| 24 return nullptr; |
| 25 } |
| 26 } |
| 27 |
| 28 int RegisterToDwarfCode(Register name) { |
| 29 switch (name.reg_code) { |
| 30 case Register::kCode_rbp: |
| 31 return kRbpDwarfCode; |
| 32 case Register::kCode_rsp: |
| 33 return kRspDwarfCode; |
| 34 default: |
| 35 UNIMPLEMENTED(); |
| 36 return -1; |
| 37 } |
| 38 } |
| 39 |
| 40 } // namespace internal |
| 41 } // namespace v8 |
OLD | NEW |