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

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

Issue 659663005: Make disassembler string tables read-only. (Closed)
Patch Set: Created 6 years, 2 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 | « no previous file | src/arm64/disasm-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
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 // A Disassembler object is used to disassemble a block of code instruction by 5 // A Disassembler object is used to disassemble a block of code instruction by
6 // instruction. The default implementation of the NameConverter object can be 6 // instruction. The default implementation of the NameConverter object can be
7 // overriden to modify register names or to do symbol lookup on addresses. 7 // overriden to modify register names or to do symbol lookup on addresses.
8 // 8 //
9 // The example below will disassemble a block of code and print it to stdout. 9 // The example below will disassemble a block of code and print it to stdout.
10 // 10 //
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 while (cur != '\0' && (out_buffer_pos_ < (out_buffer_.length() - 1))) { 141 while (cur != '\0' && (out_buffer_pos_ < (out_buffer_.length() - 1))) {
142 PrintChar(cur); 142 PrintChar(cur);
143 cur = *str++; 143 cur = *str++;
144 } 144 }
145 out_buffer_[out_buffer_pos_] = 0; 145 out_buffer_[out_buffer_pos_] = 0;
146 } 146 }
147 147
148 148
149 // These condition names are defined in a way to match the native disassembler 149 // These condition names are defined in a way to match the native disassembler
150 // formatting. See for example the command "objdump -d <binary file>". 150 // formatting. See for example the command "objdump -d <binary file>".
151 static const char* cond_names[kNumberOfConditions] = { 151 static const char* const cond_names[kNumberOfConditions] = {
152 "eq", "ne", "cs" , "cc" , "mi" , "pl" , "vs" , "vc" , 152 "eq", "ne", "cs" , "cc" , "mi" , "pl" , "vs" , "vc" ,
153 "hi", "ls", "ge", "lt", "gt", "le", "", "invalid", 153 "hi", "ls", "ge", "lt", "gt", "le", "", "invalid",
154 }; 154 };
155 155
156 156
157 // Print the condition guarding the instruction. 157 // Print the condition guarding the instruction.
158 void Decoder::PrintCondition(Instruction* instr) { 158 void Decoder::PrintCondition(Instruction* instr) {
159 Print(cond_names[instr->ConditionValue()]); 159 Print(cond_names[instr->ConditionValue()]);
160 } 160 }
161 161
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 v8::internal::PrintF( 1792 v8::internal::PrintF(
1793 f, "%p %08x %s\n", 1793 f, "%p %08x %s\n",
1794 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); 1794 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
1795 } 1795 }
1796 } 1796 }
1797 1797
1798 1798
1799 } // namespace disasm 1799 } // namespace disasm
1800 1800
1801 #endif // V8_TARGET_ARCH_ARM 1801 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/disasm-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698