Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: src/arm64/eh-frame-arm64.cc

Issue 2023503002: Reland Implement .eh_frame writer and disassembler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@eh-frame-base
Patch Set: Rebase on master. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm/eh-frame-arm.cc ('k') | src/codegen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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/eh-frame.h"
6
7 namespace v8 {
8 namespace internal {
9
10 static const int kX0DwarfCode = 0;
11 static const int kJsSpDwarfCode = 28;
12 static const int kFpDwarfCode = 29;
13 static const int kLrDwarfCode = 30;
14 static const int kCSpDwarfCode = 31;
15
16 const int EhFrameConstants::kCodeAlignmentFactor = 4;
17 const int EhFrameConstants::kDataAlignmentFactor = -8;
18
19 void EhFrameWriter::WriteReturnAddressRegisterCode() {
20 WriteULeb128(kLrDwarfCode);
21 }
22
23 void EhFrameWriter::WriteInitialStateInCie() {
24 SetBaseAddressRegisterAndOffset(x29, 0);
25 RecordRegisterNotModified(x30);
26 }
27
28 // static
29 int EhFrameWriter::RegisterToDwarfCode(Register name) {
30 switch (name.code()) {
31 case Register::kCode_x28:
32 return kJsSpDwarfCode;
33 case Register::kCode_x29:
34 return kFpDwarfCode;
35 case Register::kCode_x30:
36 return kLrDwarfCode;
37 case Register::kCode_x31:
38 return kCSpDwarfCode;
39 case Register::kCode_x0:
40 return kX0DwarfCode;
41 default:
42 UNIMPLEMENTED();
43 return -1;
44 }
45 }
46
47 #ifdef ENABLE_DISASSEMBLER
48
49 // static
50 const char* EhFrameDisassembler::DwarfRegisterCodeToString(int code) {
51 switch (code) {
52 case kFpDwarfCode:
53 return "fp";
54 case kLrDwarfCode:
55 return "lr";
56 case kJsSpDwarfCode:
57 return "jssp";
58 case kCSpDwarfCode:
59 return "csp"; // This could be zr as well
60 default:
61 UNIMPLEMENTED();
62 return nullptr;
63 }
64 }
65
66 #endif
67
68 } // namespace internal
69 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm/eh-frame-arm.cc ('k') | src/codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698