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

Side by Side Diff: src/arm/eh-frame-arm.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 | « BUILD.gn ('k') | src/arm64/eh-frame-arm64.cc » ('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 kR0DwarfCode = 0;
11 static const int kFpDwarfCode = 11;
12 static const int kSpDwarfCode = 13;
13 static const int kLrDwarfCode = 14;
14
15 const int EhFrameConstants::kCodeAlignmentFactor = 4;
16 const int EhFrameConstants::kDataAlignmentFactor = -4;
17
18 void EhFrameWriter::WriteReturnAddressRegisterCode() {
19 WriteULeb128(kLrDwarfCode);
20 }
21
22 void EhFrameWriter::WriteInitialStateInCie() {
23 SetBaseAddressRegisterAndOffset(fp, 0);
24 RecordRegisterNotModified(lr);
25 }
26
27 // static
28 int EhFrameWriter::RegisterToDwarfCode(Register name) {
29 switch (name.code()) {
30 case Register::kCode_fp:
31 return kFpDwarfCode;
32 case Register::kCode_sp:
33 return kSpDwarfCode;
34 case Register::kCode_lr:
35 return kLrDwarfCode;
36 case Register::kCode_r0:
37 return kR0DwarfCode;
38 default:
39 UNIMPLEMENTED();
40 return -1;
41 }
42 }
43
44 #ifdef ENABLE_DISASSEMBLER
45
46 // static
47 const char* EhFrameDisassembler::DwarfRegisterCodeToString(int code) {
48 switch (code) {
49 case kFpDwarfCode:
50 return "fp";
51 case kSpDwarfCode:
52 return "sp";
53 case kLrDwarfCode:
54 return "lr";
55 default:
56 UNIMPLEMENTED();
57 return nullptr;
58 }
59 }
60
61 #endif
62
63 } // namespace internal
64 } // namespace v8
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/arm64/eh-frame-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698