diff options
author | David Srbecky <dsrbecky@google.com> | 2015-04-07 19:46:22 +0100 |
---|---|---|
committer | David Srbecky <dsrbecky@google.com> | 2015-04-07 20:07:58 +0100 |
commit | 8c57831b2b07185ee1986b9af68a351e1ca584c3 (patch) | |
tree | 862c57e602dff367ca141d3a86235b48bf47bf17 /compiler/utils | |
parent | caff30245889729f102af87e79705893401251ef (diff) | |
download | art-8c57831b2b07185ee1986b9af68a351e1ca584c3.zip art-8c57831b2b07185ee1986b9af68a351e1ca584c3.tar.gz art-8c57831b2b07185ee1986b9af68a351e1ca584c3.tar.bz2 |
Remove the old CFI infrastructure.
Change-Id: I12a17a8a1c39ffccaa499c328ebac36e4d74dc4e
Diffstat (limited to 'compiler/utils')
-rw-r--r-- | compiler/utils/assembler.h | 6 | ||||
-rw-r--r-- | compiler/utils/dwarf_cfi.cc | 156 | ||||
-rw-r--r-- | compiler/utils/dwarf_cfi.h | 95 | ||||
-rw-r--r-- | compiler/utils/x86/assembler_x86.cc | 61 | ||||
-rw-r--r-- | compiler/utils/x86/assembler_x86.h | 11 | ||||
-rw-r--r-- | compiler/utils/x86/managed_register_x86.h | 8 | ||||
-rw-r--r-- | compiler/utils/x86_64/assembler_x86_64.cc | 41 | ||||
-rw-r--r-- | compiler/utils/x86_64/assembler_x86_64.h | 11 | ||||
-rw-r--r-- | compiler/utils/x86_64/managed_register_x86_64.h | 15 |
9 files changed, 13 insertions, 391 deletions
diff --git a/compiler/utils/assembler.h b/compiler/utils/assembler.h index 923ecdb..323f93c 100644 --- a/compiler/utils/assembler.h +++ b/compiler/utils/assembler.h @@ -504,12 +504,6 @@ class Assembler { // and branch to a ExceptionSlowPath if it is. virtual void ExceptionPoll(ManagedRegister scratch, size_t stack_adjust) = 0; - virtual void InitializeFrameDescriptionEntry() {} - virtual void FinalizeFrameDescriptionEntry() {} - // Give a vector containing FDE data, or null if not used. Note: the assembler must take care - // of handling the lifecycle. - virtual std::vector<uint8_t>* GetFrameDescriptionEntry() { return nullptr; } - virtual ~Assembler() {} protected: diff --git a/compiler/utils/dwarf_cfi.cc b/compiler/utils/dwarf_cfi.cc deleted file mode 100644 index a7e09c6..0000000 --- a/compiler/utils/dwarf_cfi.cc +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "leb128.h" -#include "utils.h" - -#include "dwarf_cfi.h" - -namespace art { - -void DW_CFA_advance_loc(std::vector<uint8_t>* buf, uint32_t increment) { - if (increment < 64) { - // Encoding in opcode. - buf->push_back(0x1 << 6 | increment); - } else if (increment < 256) { - // Single byte delta. - buf->push_back(0x02); - buf->push_back(increment); - } else if (increment < 256 * 256) { - // Two byte delta. - buf->push_back(0x03); - buf->push_back(increment & 0xff); - buf->push_back((increment >> 8) & 0xff); - } else { - // Four byte delta. - buf->push_back(0x04); - Push32(buf, increment); - } -} - -void DW_CFA_offset_extended_sf(std::vector<uint8_t>* buf, int reg, int32_t offset) { - buf->push_back(0x11); - EncodeUnsignedLeb128(reg, buf); - EncodeSignedLeb128(offset, buf); -} - -void DW_CFA_offset(std::vector<uint8_t>* buf, int reg, uint32_t offset) { - buf->push_back((0x2 << 6) | reg); - EncodeUnsignedLeb128(offset, buf); -} - -void DW_CFA_def_cfa_offset(std::vector<uint8_t>* buf, int32_t offset) { - buf->push_back(0x0e); - EncodeUnsignedLeb128(offset, buf); -} - -void DW_CFA_remember_state(std::vector<uint8_t>* buf) { - buf->push_back(0x0a); -} - -void DW_CFA_restore_state(std::vector<uint8_t>* buf) { - buf->push_back(0x0b); -} - -void WriteFDEHeader(std::vector<uint8_t>* buf, bool is_64bit) { - // 'length' (filled in by other functions). - if (is_64bit) { - Push32(buf, 0xffffffff); // Indicates 64bit - Push32(buf, 0); - Push32(buf, 0); - } else { - Push32(buf, 0); - } - - // 'CIE_pointer' (filled in by linker). - if (is_64bit) { - Push32(buf, 0); - Push32(buf, 0); - } else { - Push32(buf, 0); - } - - // 'initial_location' (filled in by linker). - if (is_64bit) { - Push32(buf, 0); - Push32(buf, 0); - } else { - Push32(buf, 0); - } - - // 'address_range' (filled in by other functions). - if (is_64bit) { - Push32(buf, 0); - Push32(buf, 0); - } else { - Push32(buf, 0); - } - - // Augmentation length: 0 - buf->push_back(0); -} - -void WriteFDEAddressRange(std::vector<uint8_t>* buf, uint64_t data, bool is_64bit) { - const size_t kOffsetOfAddressRange = is_64bit? 28 : 12; - CHECK(buf->size() >= kOffsetOfAddressRange + (is_64bit? 8 : 4)); - - uint8_t *p = buf->data() + kOffsetOfAddressRange; - if (is_64bit) { - p[0] = data; - p[1] = data >> 8; - p[2] = data >> 16; - p[3] = data >> 24; - p[4] = data >> 32; - p[5] = data >> 40; - p[6] = data >> 48; - p[7] = data >> 56; - } else { - p[0] = data; - p[1] = data >> 8; - p[2] = data >> 16; - p[3] = data >> 24; - } -} - -void WriteCFILength(std::vector<uint8_t>* buf, bool is_64bit) { - uint64_t length = is_64bit ? buf->size() - 12 : buf->size() - 4; - DCHECK_EQ((length & 0x3), 0U); - - uint8_t *p = is_64bit? buf->data() + 4 : buf->data(); - if (is_64bit) { - p[0] = length; - p[1] = length >> 8; - p[2] = length >> 16; - p[3] = length >> 24; - p[4] = length >> 32; - p[5] = length >> 40; - p[6] = length >> 48; - p[7] = length >> 56; - } else { - p[0] = length; - p[1] = length >> 8; - p[2] = length >> 16; - p[3] = length >> 24; - } -} - -void PadCFI(std::vector<uint8_t>* buf) { - while (buf->size() & 0x3) { - buf->push_back(0); - } -} - -} // namespace art diff --git a/compiler/utils/dwarf_cfi.h b/compiler/utils/dwarf_cfi.h deleted file mode 100644 index 0c8b151..0000000 --- a/compiler/utils/dwarf_cfi.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_COMPILER_UTILS_DWARF_CFI_H_ -#define ART_COMPILER_UTILS_DWARF_CFI_H_ - -#include <vector> - -namespace art { - -/** - * @brief Enter a 'DW_CFA_advance_loc' into an FDE buffer - * @param buf FDE buffer. - * @param increment Amount by which to increase the current location. - */ -void DW_CFA_advance_loc(std::vector<uint8_t>* buf, uint32_t increment); - -/** - * @brief Enter a 'DW_CFA_offset_extended_sf' into an FDE buffer - * @param buf FDE buffer. - * @param reg Register number. - * @param offset Offset of register address from CFA. - */ -void DW_CFA_offset_extended_sf(std::vector<uint8_t>* buf, int reg, int32_t offset); - -/** - * @brief Enter a 'DW_CFA_offset' into an FDE buffer - * @param buf FDE buffer. - * @param reg Register number. - * @param offset Offset of register address from CFA. - */ -void DW_CFA_offset(std::vector<uint8_t>* buf, int reg, uint32_t offset); - -/** - * @brief Enter a 'DW_CFA_def_cfa_offset' into an FDE buffer - * @param buf FDE buffer. - * @param offset New offset of CFA. - */ -void DW_CFA_def_cfa_offset(std::vector<uint8_t>* buf, int32_t offset); - -/** - * @brief Enter a 'DW_CFA_remember_state' into an FDE buffer - * @param buf FDE buffer. - */ -void DW_CFA_remember_state(std::vector<uint8_t>* buf); - -/** - * @brief Enter a 'DW_CFA_restore_state' into an FDE buffer - * @param buf FDE buffer. - */ -void DW_CFA_restore_state(std::vector<uint8_t>* buf); - -/** - * @brief Write FDE header into an FDE buffer - * @param buf FDE buffer. - * @param is_64bit If FDE is for 64bit application. - */ -void WriteFDEHeader(std::vector<uint8_t>* buf, bool is_64bit); - -/** - * @brief Set 'address_range' field of an FDE buffer - * @param buf FDE buffer. - * @param data Data value. - * @param is_64bit If FDE is for 64bit application. - */ -void WriteFDEAddressRange(std::vector<uint8_t>* buf, uint64_t data, bool is_64bit); - -/** - * @brief Set 'length' field of an FDE buffer - * @param buf FDE buffer. - * @param is_64bit If FDE is for 64bit application. - */ -void WriteCFILength(std::vector<uint8_t>* buf, bool is_64bit); - -/** - * @brief Pad an FDE buffer with 0 until its size is a multiple of 4 - * @param buf FDE buffer. - */ -void PadCFI(std::vector<uint8_t>* buf); -} // namespace art - -#endif // ART_COMPILER_UTILS_DWARF_CFI_H_ diff --git a/compiler/utils/x86/assembler_x86.cc b/compiler/utils/x86/assembler_x86.cc index b3a1376..4b71412 100644 --- a/compiler/utils/x86/assembler_x86.cc +++ b/compiler/utils/x86/assembler_x86.cc @@ -20,7 +20,6 @@ #include "entrypoints/quick/quick_entrypoints.h" #include "memory_region.h" #include "thread.h" -#include "utils/dwarf_cfi.h" namespace art { namespace x86 { @@ -1631,69 +1630,32 @@ void X86Assembler::EmitGenericShift(int reg_or_opcode, EmitOperand(reg_or_opcode, Operand(operand)); } -void X86Assembler::InitializeFrameDescriptionEntry() { - WriteFDEHeader(&cfi_info_, false /* is_64bit */); -} - -void X86Assembler::FinalizeFrameDescriptionEntry() { - WriteFDEAddressRange(&cfi_info_, buffer_.Size(), false /* is_64bit */); - PadCFI(&cfi_info_); - WriteCFILength(&cfi_info_, false /* is_64bit */); -} - constexpr size_t kFramePointerSize = 4; void X86Assembler::BuildFrame(size_t frame_size, ManagedRegister method_reg, const std::vector<ManagedRegister>& spill_regs, const ManagedRegisterEntrySpills& entry_spills) { - cfi_cfa_offset_ = kFramePointerSize; // Only return address on stack - cfi_pc_ = buffer_.Size(); // Nothing emitted yet - DCHECK_EQ(cfi_pc_, 0U); - - uint32_t reg_offset = 1; + DCHECK_EQ(buffer_.Size(), 0U); // Nothing emitted yet. CHECK_ALIGNED(frame_size, kStackAlignment); int gpr_count = 0; for (int i = spill_regs.size() - 1; i >= 0; --i) { - x86::X86ManagedRegister spill = spill_regs.at(i).AsX86(); - DCHECK(spill.IsCpuRegister()); - pushl(spill.AsCpuRegister()); + Register spill = spill_regs.at(i).AsX86().AsCpuRegister(); + pushl(spill); gpr_count++; - - // DW_CFA_advance_loc - DW_CFA_advance_loc(&cfi_info_, buffer_.Size() - cfi_pc_); - cfi_pc_ = buffer_.Size(); - // DW_CFA_def_cfa_offset - cfi_cfa_offset_ += kFramePointerSize; - DW_CFA_def_cfa_offset(&cfi_info_, cfi_cfa_offset_); - // DW_CFA_offset reg offset - reg_offset++; - DW_CFA_offset(&cfi_info_, spill_regs.at(i).AsX86().DWARFRegId(), reg_offset); } - // return address then method on stack + // return address then method on stack. int32_t adjust = frame_size - (gpr_count * kFramePointerSize) - sizeof(StackReference<mirror::ArtMethod>) /*method*/ - kFramePointerSize /*return address*/; addl(ESP, Immediate(-adjust)); - // DW_CFA_advance_loc - DW_CFA_advance_loc(&cfi_info_, buffer_.Size() - cfi_pc_); - cfi_pc_ = buffer_.Size(); - // DW_CFA_def_cfa_offset - cfi_cfa_offset_ += adjust; - DW_CFA_def_cfa_offset(&cfi_info_, cfi_cfa_offset_); - pushl(method_reg.AsX86().AsCpuRegister()); - // DW_CFA_advance_loc - DW_CFA_advance_loc(&cfi_info_, buffer_.Size() - cfi_pc_); - cfi_pc_ = buffer_.Size(); - // DW_CFA_def_cfa_offset - cfi_cfa_offset_ += kFramePointerSize; - DW_CFA_def_cfa_offset(&cfi_info_, cfi_cfa_offset_); for (size_t i = 0; i < entry_spills.size(); ++i) { ManagedRegisterSpill spill = entry_spills.at(i); if (spill.AsX86().IsCpuRegister()) { - movl(Address(ESP, frame_size + spill.getSpillOffset()), spill.AsX86().AsCpuRegister()); + int offset = frame_size + spill.getSpillOffset(); + movl(Address(ESP, offset), spill.AsX86().AsCpuRegister()); } else { DCHECK(spill.AsX86().IsXmmRegister()); if (spill.getSize() == 8) { @@ -1709,8 +1671,9 @@ void X86Assembler::BuildFrame(size_t frame_size, ManagedRegister method_reg, void X86Assembler::RemoveFrame(size_t frame_size, const std::vector<ManagedRegister>& spill_regs) { CHECK_ALIGNED(frame_size, kStackAlignment); - addl(ESP, Immediate(frame_size - (spill_regs.size() * kFramePointerSize) - - sizeof(StackReference<mirror::ArtMethod>))); + int adjust = frame_size - (spill_regs.size() * kFramePointerSize) - + sizeof(StackReference<mirror::ArtMethod>); + addl(ESP, Immediate(adjust)); for (size_t i = 0; i < spill_regs.size(); ++i) { x86::X86ManagedRegister spill = spill_regs.at(i).AsX86(); DCHECK(spill.IsCpuRegister()); @@ -1722,12 +1685,6 @@ void X86Assembler::RemoveFrame(size_t frame_size, void X86Assembler::IncreaseFrameSize(size_t adjust) { CHECK_ALIGNED(adjust, kStackAlignment); addl(ESP, Immediate(-adjust)); - // DW_CFA_advance_loc - DW_CFA_advance_loc(&cfi_info_, buffer_.Size() - cfi_pc_); - cfi_pc_ = buffer_.Size(); - // DW_CFA_def_cfa_offset - cfi_cfa_offset_ += adjust; - DW_CFA_def_cfa_offset(&cfi_info_, cfi_cfa_offset_); } void X86Assembler::DecreaseFrameSize(size_t adjust) { diff --git a/compiler/utils/x86/assembler_x86.h b/compiler/utils/x86/assembler_x86.h index bdf8843..046df02 100644 --- a/compiler/utils/x86/assembler_x86.h +++ b/compiler/utils/x86/assembler_x86.h @@ -205,7 +205,7 @@ class Address : public Operand { class X86Assembler FINAL : public Assembler { public: - explicit X86Assembler() : cfi_cfa_offset_(0), cfi_pc_(0) {} + explicit X86Assembler() {} virtual ~X86Assembler() {} /* @@ -599,12 +599,6 @@ class X86Assembler FINAL : public Assembler { // and branch to a ExceptionSlowPath if it is. void ExceptionPoll(ManagedRegister scratch, size_t stack_adjust) OVERRIDE; - void InitializeFrameDescriptionEntry() OVERRIDE; - void FinalizeFrameDescriptionEntry() OVERRIDE; - std::vector<uint8_t>* GetFrameDescriptionEntry() OVERRIDE { - return &cfi_info_; - } - private: inline void EmitUint8(uint8_t value); inline void EmitInt32(int32_t value); @@ -623,9 +617,6 @@ class X86Assembler FINAL : public Assembler { void EmitGenericShift(int rm, Register reg, const Immediate& imm); void EmitGenericShift(int rm, Register operand, Register shifter); - std::vector<uint8_t> cfi_info_; - uint32_t cfi_cfa_offset_, cfi_pc_; - DISALLOW_COPY_AND_ASSIGN(X86Assembler); }; diff --git a/compiler/utils/x86/managed_register_x86.h b/compiler/utils/x86/managed_register_x86.h index 5d46ee2..09d2b49 100644 --- a/compiler/utils/x86/managed_register_x86.h +++ b/compiler/utils/x86/managed_register_x86.h @@ -88,14 +88,6 @@ const int kNumberOfAllocIds = kNumberOfCpuAllocIds + kNumberOfXmmAllocIds + // There is a one-to-one mapping between ManagedRegister and register id. class X86ManagedRegister : public ManagedRegister { public: - int DWARFRegId() const { - CHECK(IsCpuRegister()); - // For all the X86 registers we care about: - // EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI, - // DWARF register id is the same as id_. - return static_cast<int>(id_); - } - ByteRegister AsByteRegister() const { CHECK(IsCpuRegister()); CHECK_LT(AsCpuRegister(), ESP); // ESP, EBP, ESI and EDI cannot be encoded as byte registers. diff --git a/compiler/utils/x86_64/assembler_x86_64.cc b/compiler/utils/x86_64/assembler_x86_64.cc index e82d90c..25d24fb 100644 --- a/compiler/utils/x86_64/assembler_x86_64.cc +++ b/compiler/utils/x86_64/assembler_x86_64.cc @@ -20,7 +20,6 @@ #include "entrypoints/quick/quick_entrypoints.h" #include "memory_region.h" #include "thread.h" -#include "utils/dwarf_cfi.h" namespace art { namespace x86_64 { @@ -2168,26 +2167,12 @@ void X86_64Assembler::EmitOptionalByteRegNormalizingRex32(CpuRegister dst, const } } -void X86_64Assembler::InitializeFrameDescriptionEntry() { - WriteFDEHeader(&cfi_info_, true /* is_64bit */); -} - -void X86_64Assembler::FinalizeFrameDescriptionEntry() { - WriteFDEAddressRange(&cfi_info_, buffer_.Size(), true /* is_64bit */); - PadCFI(&cfi_info_); - WriteCFILength(&cfi_info_, true /* is_64bit */); -} - constexpr size_t kFramePointerSize = 8; void X86_64Assembler::BuildFrame(size_t frame_size, ManagedRegister method_reg, const std::vector<ManagedRegister>& spill_regs, const ManagedRegisterEntrySpills& entry_spills) { - cfi_cfa_offset_ = kFramePointerSize; // Only return address on stack - cfi_pc_ = buffer_.Size(); // Nothing emitted yet - DCHECK_EQ(cfi_pc_, 0U); - - uint32_t reg_offset = 1; + DCHECK_EQ(buffer_.Size(), 0U); // Nothing emitted yet. CHECK_ALIGNED(frame_size, kStackAlignment); int gpr_count = 0; for (int i = spill_regs.size() - 1; i >= 0; --i) { @@ -2195,29 +2180,13 @@ void X86_64Assembler::BuildFrame(size_t frame_size, ManagedRegister method_reg, if (spill.IsCpuRegister()) { pushq(spill.AsCpuRegister()); gpr_count++; - - // DW_CFA_advance_loc - DW_CFA_advance_loc(&cfi_info_, buffer_.Size() - cfi_pc_); - cfi_pc_ = buffer_.Size(); - // DW_CFA_def_cfa_offset - cfi_cfa_offset_ += kFramePointerSize; - DW_CFA_def_cfa_offset(&cfi_info_, cfi_cfa_offset_); - // DW_CFA_offset reg offset - reg_offset++; - DW_CFA_offset(&cfi_info_, spill.DWARFRegId(), reg_offset); } } - // return address then method on stack + // return address then method on stack. int64_t rest_of_frame = static_cast<int64_t>(frame_size) - (gpr_count * kFramePointerSize) - kFramePointerSize /*return address*/; subq(CpuRegister(RSP), Immediate(rest_of_frame)); - // DW_CFA_advance_loc - DW_CFA_advance_loc(&cfi_info_, buffer_.Size() - cfi_pc_); - cfi_pc_ = buffer_.Size(); - // DW_CFA_def_cfa_offset - cfi_cfa_offset_ += rest_of_frame; - DW_CFA_def_cfa_offset(&cfi_info_, cfi_cfa_offset_); // spill xmms int64_t offset = rest_of_frame; @@ -2282,12 +2251,6 @@ void X86_64Assembler::RemoveFrame(size_t frame_size, void X86_64Assembler::IncreaseFrameSize(size_t adjust) { CHECK_ALIGNED(adjust, kStackAlignment); addq(CpuRegister(RSP), Immediate(-static_cast<int64_t>(adjust))); - // DW_CFA_advance_loc - DW_CFA_advance_loc(&cfi_info_, buffer_.Size() - cfi_pc_); - cfi_pc_ = buffer_.Size(); - // DW_CFA_def_cfa_offset - cfi_cfa_offset_ += adjust; - DW_CFA_def_cfa_offset(&cfi_info_, cfi_cfa_offset_); } void X86_64Assembler::DecreaseFrameSize(size_t adjust) { diff --git a/compiler/utils/x86_64/assembler_x86_64.h b/compiler/utils/x86_64/assembler_x86_64.h index 39f781c..bcc8e62 100644 --- a/compiler/utils/x86_64/assembler_x86_64.h +++ b/compiler/utils/x86_64/assembler_x86_64.h @@ -244,7 +244,7 @@ class Address : public Operand { class X86_64Assembler FINAL : public Assembler { public: - X86_64Assembler() : cfi_cfa_offset_(0), cfi_pc_(0) {} + X86_64Assembler() {} virtual ~X86_64Assembler() {} /* @@ -663,12 +663,6 @@ class X86_64Assembler FINAL : public Assembler { // and branch to a ExceptionSlowPath if it is. void ExceptionPoll(ManagedRegister scratch, size_t stack_adjust) OVERRIDE; - void InitializeFrameDescriptionEntry() OVERRIDE; - void FinalizeFrameDescriptionEntry() OVERRIDE; - std::vector<uint8_t>* GetFrameDescriptionEntry() OVERRIDE { - return &cfi_info_; - } - private: void EmitUint8(uint8_t value); void EmitInt32(int32_t value); @@ -714,9 +708,6 @@ class X86_64Assembler FINAL : public Assembler { void EmitOptionalByteRegNormalizingRex32(CpuRegister dst, CpuRegister src); void EmitOptionalByteRegNormalizingRex32(CpuRegister dst, const Operand& operand); - std::vector<uint8_t> cfi_info_; - uint32_t cfi_cfa_offset_, cfi_pc_; - DISALLOW_COPY_AND_ASSIGN(X86_64Assembler); }; diff --git a/compiler/utils/x86_64/managed_register_x86_64.h b/compiler/utils/x86_64/managed_register_x86_64.h index 3a96ad0..822659f 100644 --- a/compiler/utils/x86_64/managed_register_x86_64.h +++ b/compiler/utils/x86_64/managed_register_x86_64.h @@ -87,21 +87,6 @@ const int kNumberOfAllocIds = kNumberOfCpuAllocIds + kNumberOfXmmAllocIds + // There is a one-to-one mapping between ManagedRegister and register id. class X86_64ManagedRegister : public ManagedRegister { public: - int DWARFRegId() const { - CHECK(IsCpuRegister()); - switch (id_) { - case RAX: return 0; - case RDX: return 1; - case RCX: return 2; - case RBX: return 3; - case RSI: return 4; - case RDI: return 5; - case RBP: return 6; - case RSP: return 7; - default: return static_cast<int>(id_); // R8 ~ R15 - } - } - CpuRegister AsCpuRegister() const { CHECK(IsCpuRegister()); return CpuRegister(static_cast<Register>(id_)); |