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

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

Issue 1877453002: Fix printf formats (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handle ptrdiff_t format, which seems to make MSVC barf Created 4 years, 8 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/x64/disasm-x64.cc ('k') | test/cctest/heap/test-heap.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 #include <assert.h> 5 #include <assert.h>
6 #include <stdarg.h> 6 #include <stdarg.h>
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #if V8_TARGET_ARCH_X87 9 #if V8_TARGET_ARCH_X87
10 10
11 #include "src/base/compiler-specific.h"
11 #include "src/disasm.h" 12 #include "src/disasm.h"
12 13
13 namespace disasm { 14 namespace disasm {
14 15
15 enum OperandOrder { 16 enum OperandOrder {
16 UNSET_OP_ORDER = 0, 17 UNSET_OP_ORDER = 0,
17 REG_OPER_OP_ORDER, 18 REG_OPER_OP_ORDER,
18 OPER_REG_OP_ORDER 19 OPER_REG_OP_ORDER
19 }; 20 };
20 21
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 int F7Instruction(byte* data); 319 int F7Instruction(byte* data);
319 int D1D3C1Instruction(byte* data); 320 int D1D3C1Instruction(byte* data);
320 int JumpShort(byte* data); 321 int JumpShort(byte* data);
321 int JumpConditional(byte* data, const char* comment); 322 int JumpConditional(byte* data, const char* comment);
322 int JumpConditionalShort(byte* data, const char* comment); 323 int JumpConditionalShort(byte* data, const char* comment);
323 int SetCC(byte* data); 324 int SetCC(byte* data);
324 int CMov(byte* data); 325 int CMov(byte* data);
325 int FPUInstruction(byte* data); 326 int FPUInstruction(byte* data);
326 int MemoryFPUInstruction(int escape_opcode, int regop, byte* modrm_start); 327 int MemoryFPUInstruction(int escape_opcode, int regop, byte* modrm_start);
327 int RegisterFPUInstruction(int escape_opcode, byte modrm_byte); 328 int RegisterFPUInstruction(int escape_opcode, byte modrm_byte);
328 void AppendToBuffer(const char* format, ...); 329 PRINTF_FORMAT(2, 3) void AppendToBuffer(const char* format, ...);
329
330 330
331 void UnimplementedInstruction() { 331 void UnimplementedInstruction() {
332 if (abort_on_unimplemented_) { 332 if (abort_on_unimplemented_) {
333 UNIMPLEMENTED(); 333 UNIMPLEMENTED();
334 } else { 334 } else {
335 AppendToBuffer("'Unimplemented Instruction'"); 335 AppendToBuffer("'Unimplemented Instruction'");
336 } 336 }
337 } 337 }
338 }; 338 };
339 339
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 data++; 941 data++;
942 } else if (*data == 0x2E /*cs*/) { 942 } else if (*data == 0x2E /*cs*/) {
943 branch_hint = "predicted not taken"; 943 branch_hint = "predicted not taken";
944 data++; 944 data++;
945 } 945 }
946 bool processed = true; // Will be set to false if the current instruction 946 bool processed = true; // Will be set to false if the current instruction
947 // is not in 'instructions' table. 947 // is not in 'instructions' table.
948 const InstructionDesc& idesc = instruction_table_->Get(*data); 948 const InstructionDesc& idesc = instruction_table_->Get(*data);
949 switch (idesc.type) { 949 switch (idesc.type) {
950 case ZERO_OPERANDS_INSTR: 950 case ZERO_OPERANDS_INSTR:
951 AppendToBuffer(idesc.mnem); 951 AppendToBuffer("%s", idesc.mnem);
952 data++; 952 data++;
953 break; 953 break;
954 954
955 case TWO_OPERANDS_INSTR: 955 case TWO_OPERANDS_INSTR:
956 data++; 956 data++;
957 data += PrintOperands(idesc.mnem, idesc.op_order_, data); 957 data += PrintOperands(idesc.mnem, idesc.op_order_, data);
958 break; 958 break;
959 959
960 case JUMP_CONDITIONAL_SHORT_INSTR: 960 case JUMP_CONDITIONAL_SHORT_INSTR:
961 data += JumpConditionalShort(data, branch_hint); 961 data += JumpConditionalShort(data, branch_hint);
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
1817 fprintf(f, " "); 1817 fprintf(f, " ");
1818 } 1818 }
1819 fprintf(f, " %s\n", buffer.start()); 1819 fprintf(f, " %s\n", buffer.start());
1820 } 1820 }
1821 } 1821 }
1822 1822
1823 1823
1824 } // namespace disasm 1824 } // namespace disasm
1825 1825
1826 #endif // V8_TARGET_ARCH_X87 1826 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x64/disasm-x64.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698