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

Side by Side Diff: src/arm64/disasm-arm64.cc

Issue 328343003: Remove dependency on Vector from platform files (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/disasm-arm.cc ('k') | src/ast.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <assert.h> 5 #include <assert.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <stdarg.h> 7 #include <stdarg.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "src/v8.h" 10 #include "src/v8.h"
(...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after
1727 GetOutput()); 1727 GetOutput());
1728 } 1728 }
1729 1729
1730 } } // namespace v8::internal 1730 } } // namespace v8::internal
1731 1731
1732 1732
1733 namespace disasm { 1733 namespace disasm {
1734 1734
1735 1735
1736 const char* NameConverter::NameOfAddress(byte* addr) const { 1736 const char* NameConverter::NameOfAddress(byte* addr) const {
1737 v8::internal::OS::SNPrintF(tmp_buffer_, "%p", addr); 1737 v8::internal::SNPrintF(tmp_buffer_, "%p", addr);
1738 return tmp_buffer_.start(); 1738 return tmp_buffer_.start();
1739 } 1739 }
1740 1740
1741 1741
1742 const char* NameConverter::NameOfConstant(byte* addr) const { 1742 const char* NameConverter::NameOfConstant(byte* addr) const {
1743 return NameOfAddress(addr); 1743 return NameOfAddress(addr);
1744 } 1744 }
1745 1745
1746 1746
1747 const char* NameConverter::NameOfCPURegister(int reg) const { 1747 const char* NameConverter::NameOfCPURegister(int reg) const {
1748 unsigned ureg = reg; // Avoid warnings about signed/unsigned comparisons. 1748 unsigned ureg = reg; // Avoid warnings about signed/unsigned comparisons.
1749 if (ureg >= v8::internal::kNumberOfRegisters) { 1749 if (ureg >= v8::internal::kNumberOfRegisters) {
1750 return "noreg"; 1750 return "noreg";
1751 } 1751 }
1752 if (ureg == v8::internal::kZeroRegCode) { 1752 if (ureg == v8::internal::kZeroRegCode) {
1753 return "xzr"; 1753 return "xzr";
1754 } 1754 }
1755 v8::internal::OS::SNPrintF(tmp_buffer_, "x%u", ureg); 1755 v8::internal::SNPrintF(tmp_buffer_, "x%u", ureg);
1756 return tmp_buffer_.start(); 1756 return tmp_buffer_.start();
1757 } 1757 }
1758 1758
1759 1759
1760 const char* NameConverter::NameOfByteCPURegister(int reg) const { 1760 const char* NameConverter::NameOfByteCPURegister(int reg) const {
1761 UNREACHABLE(); // ARM64 does not have the concept of a byte register 1761 UNREACHABLE(); // ARM64 does not have the concept of a byte register
1762 return "nobytereg"; 1762 return "nobytereg";
1763 } 1763 }
1764 1764
1765 1765
(...skipping 13 matching lines...) Expand all
1779 //------------------------------------------------------------------------------ 1779 //------------------------------------------------------------------------------
1780 1780
1781 class BufferDisassembler : public v8::internal::Disassembler { 1781 class BufferDisassembler : public v8::internal::Disassembler {
1782 public: 1782 public:
1783 explicit BufferDisassembler(v8::internal::Vector<char> out_buffer) 1783 explicit BufferDisassembler(v8::internal::Vector<char> out_buffer)
1784 : out_buffer_(out_buffer) { } 1784 : out_buffer_(out_buffer) { }
1785 1785
1786 ~BufferDisassembler() { } 1786 ~BufferDisassembler() { }
1787 1787
1788 virtual void ProcessOutput(v8::internal::Instruction* instr) { 1788 virtual void ProcessOutput(v8::internal::Instruction* instr) {
1789 v8::internal::OS::SNPrintF(out_buffer_, "%s", GetOutput()); 1789 v8::internal::SNPrintF(out_buffer_, "%s", GetOutput());
1790 } 1790 }
1791 1791
1792 private: 1792 private:
1793 v8::internal::Vector<char> out_buffer_; 1793 v8::internal::Vector<char> out_buffer_;
1794 }; 1794 };
1795 1795
1796 Disassembler::Disassembler(const NameConverter& converter) 1796 Disassembler::Disassembler(const NameConverter& converter)
1797 : converter_(converter) {} 1797 : converter_(converter) {}
1798 1798
1799 1799
(...skipping 23 matching lines...) Expand all
1823 decoder.AppendVisitor(&disasm); 1823 decoder.AppendVisitor(&disasm);
1824 1824
1825 for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) { 1825 for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) {
1826 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc)); 1826 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc));
1827 } 1827 }
1828 } 1828 }
1829 1829
1830 } // namespace disasm 1830 } // namespace disasm
1831 1831
1832 #endif // V8_TARGET_ARCH_ARM64 1832 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/disasm-arm.cc ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698