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

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

Issue 160174: X64: Add parentheses to buggy expression in disassembler. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 4 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 data += 2; 1343 data += 2;
1344 break; 1344 break;
1345 1345
1346 case 0xA1: // Fall through. 1346 case 0xA1: // Fall through.
1347 case 0xA3: 1347 case 0xA3:
1348 switch (operand_size()) { 1348 switch (operand_size()) {
1349 case DOUBLEWORD_SIZE: { 1349 case DOUBLEWORD_SIZE: {
1350 const char* memory_location = NameOfAddress( 1350 const char* memory_location = NameOfAddress(
1351 reinterpret_cast<byte*>( 1351 reinterpret_cast<byte*>(
1352 *reinterpret_cast<int32_t*>(data + 1))); 1352 *reinterpret_cast<int32_t*>(data + 1)));
1353 if (*data & 0x2 == 0x2) { // Opcode 0xA3 1353 if (*data == 0xA3) { // Opcode 0xA3
1354 AppendToBuffer("movzxlq rax,(%s)", memory_location); 1354 AppendToBuffer("movzxlq rax,(%s)", memory_location);
1355 } else { // Opcode 0xA1 1355 } else { // Opcode 0xA1
1356 AppendToBuffer("movzxlq (%s),rax", memory_location); 1356 AppendToBuffer("movzxlq (%s),rax", memory_location);
1357 } 1357 }
1358 data += 5; 1358 data += 5;
1359 break; 1359 break;
1360 } 1360 }
1361 case QUADWORD_SIZE: { 1361 case QUADWORD_SIZE: {
1362 // New x64 instruction mov rax,(imm_64). 1362 // New x64 instruction mov rax,(imm_64).
1363 const char* memory_location = NameOfAddress( 1363 const char* memory_location = NameOfAddress(
1364 *reinterpret_cast<byte**>(data + 1)); 1364 *reinterpret_cast<byte**>(data + 1));
1365 if (*data & 0x2 == 0x2) { // Opcode 0xA3 1365 if (*data == 0xA3) { // Opcode 0xA3
1366 AppendToBuffer("movq rax,(%s)", memory_location); 1366 AppendToBuffer("movq rax,(%s)", memory_location);
1367 } else { // Opcode 0xA1 1367 } else { // Opcode 0xA1
1368 AppendToBuffer("movq (%s),rax", memory_location); 1368 AppendToBuffer("movq (%s),rax", memory_location);
1369 } 1369 }
1370 data += 9; 1370 data += 9;
1371 break; 1371 break;
1372 } 1372 }
1373 default: 1373 default:
1374 UnimplementedInstruction(); 1374 UnimplementedInstruction();
1375 data += 2; 1375 data += 2;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 fprintf(f, "%02x", *bp); 1557 fprintf(f, "%02x", *bp);
1558 } 1558 }
1559 for (int i = 6 - (pc - prev_pc); i >= 0; i--) { 1559 for (int i = 6 - (pc - prev_pc); i >= 0; i--) {
1560 fprintf(f, " "); 1560 fprintf(f, " ");
1561 } 1561 }
1562 fprintf(f, " %s\n", buffer.start()); 1562 fprintf(f, " %s\n", buffer.start());
1563 } 1563 }
1564 } 1564 }
1565 1565
1566 } // namespace disasm 1566 } // namespace disasm
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698