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

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

Issue 2143033002: Revert of Implement .eh_frame writer and disassembler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@eh-frame-base
Patch Set: 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 STATIC_CONST_MEMBER_DEFINITION const int
16 EhFrameConstants::kCodeAlignmentFactor = 4;
17
18 STATIC_CONST_MEMBER_DEFINITION const int
19 EhFrameConstants::kDataAlignmentFactor = -4;
20
21 void EhFrameWriter::WriteReturnAddressRegisterCode() {
22 WriteULeb128(kLrDwarfCode);
23 }
24
25 void EhFrameWriter::WriteInitialStateInCie() {
26 SetBaseAddressRegisterAndOffset(fp, 0);
27 RecordRegisterNotModified(lr);
28 }
29
30 // static
31 int EhFrameWriter::RegisterToDwarfCode(Register name) {
32 switch (name.code()) {
33 case Register::kCode_fp:
34 return kFpDwarfCode;
35 case Register::kCode_sp:
36 return kSpDwarfCode;
37 case Register::kCode_lr:
38 return kLrDwarfCode;
39 case Register::kCode_r0:
40 return kR0DwarfCode;
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 kSpDwarfCode:
55 return "sp";
56 case kLrDwarfCode:
57 return "lr";
58 default:
59 UNIMPLEMENTED();
60 return nullptr;
61 }
62 }
63
64 #endif
65
66 } // namespace internal
67 } // 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