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

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

Issue 2147883003: Revert of Reland 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 | « src/v8.gyp ('k') | test/cctest/cctest.gyp » ('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 kRaxDwarfCode = 0;
11 static const int kRbpDwarfCode = 6;
12 static const int kRspDwarfCode = 7;
13 static const int kRipDwarfCode = 16;
14
15 STATIC_CONST_MEMBER_DEFINITION const int
16 EhFrameConstants::kCodeAlignmentFactor = 1;
17
18 STATIC_CONST_MEMBER_DEFINITION const int
19 EhFrameConstants::kDataAlignmentFactor = -8;
20
21 void EhFrameWriter::WriteReturnAddressRegisterCode() {
22 WriteULeb128(kRipDwarfCode);
23 }
24
25 void EhFrameWriter::WriteInitialStateInCie() {
26 SetBaseAddressRegisterAndOffset(rsp, kPointerSize);
27 // x64 rip (r16) has no Register instance associated.
28 RecordRegisterSavedToStack(kRipDwarfCode, -kPointerSize);
29 }
30
31 // static
32 int EhFrameWriter::RegisterToDwarfCode(Register name) {
33 switch (name.code()) {
34 case Register::kCode_rbp:
35 return kRbpDwarfCode;
36 case Register::kCode_rsp:
37 return kRspDwarfCode;
38 case Register::kCode_rax:
39 return kRaxDwarfCode;
40 default:
41 UNIMPLEMENTED();
42 return -1;
43 }
44 }
45
46 #ifdef ENABLE_DISASSEMBLER
47
48 // static
49 const char* EhFrameDisassembler::DwarfRegisterCodeToString(int code) {
50 switch (code) {
51 case kRbpDwarfCode:
52 return "rbp";
53 case kRspDwarfCode:
54 return "rsp";
55 case kRipDwarfCode:
56 return "rip";
57 default:
58 UNIMPLEMENTED();
59 return nullptr;
60 }
61 }
62
63 #endif
64
65 } // namespace internal
66 } // namespace v8
OLDNEW
« no previous file with comments | « src/v8.gyp ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698