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

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

Issue 1381383002: PPC: Remove register index/code indirection (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « src/ppc/deoptimizer-ppc.cc ('k') | src/ppc/frames-ppc.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 109 }
110 110
111 111
112 // Print the register name according to the active name converter. 112 // Print the register name according to the active name converter.
113 void Decoder::PrintRegister(int reg) { 113 void Decoder::PrintRegister(int reg) {
114 Print(converter_.NameOfCPURegister(reg)); 114 Print(converter_.NameOfCPURegister(reg));
115 } 115 }
116 116
117 117
118 // Print the double FP register name according to the active name converter. 118 // Print the double FP register name according to the active name converter.
119 void Decoder::PrintDRegister(int reg) { Print(FPRegisters::Name(reg)); } 119 void Decoder::PrintDRegister(int reg) {
120 Print(DoubleRegister::from_code(reg).ToString());
121 }
120 122
121 123
122 // Print SoftwareInterrupt codes. Factoring this out reduces the complexity of 124 // Print SoftwareInterrupt codes. Factoring this out reduces the complexity of
123 // the FormatOption method. 125 // the FormatOption method.
124 void Decoder::PrintSoftwareInterrupt(SoftwareInterruptCodes svc) { 126 void Decoder::PrintSoftwareInterrupt(SoftwareInterruptCodes svc) {
125 switch (svc) { 127 switch (svc) {
126 case kCallRtRedirected: 128 case kCallRtRedirected:
127 Print("call rt redirected"); 129 Print("call rt redirected");
128 return; 130 return;
129 case kBreakpoint: 131 case kBreakpoint:
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 return tmp_buffer_.start(); 1344 return tmp_buffer_.start();
1343 } 1345 }
1344 1346
1345 1347
1346 const char* NameConverter::NameOfConstant(byte* addr) const { 1348 const char* NameConverter::NameOfConstant(byte* addr) const {
1347 return NameOfAddress(addr); 1349 return NameOfAddress(addr);
1348 } 1350 }
1349 1351
1350 1352
1351 const char* NameConverter::NameOfCPURegister(int reg) const { 1353 const char* NameConverter::NameOfCPURegister(int reg) const {
1352 return v8::internal::Registers::Name(reg); 1354 return v8::internal::Register::from_code(reg).ToString();
1353 } 1355 }
1354 1356
1355 const char* NameConverter::NameOfByteCPURegister(int reg) const { 1357 const char* NameConverter::NameOfByteCPURegister(int reg) const {
1356 UNREACHABLE(); // PPC does not have the concept of a byte register 1358 UNREACHABLE(); // PPC does not have the concept of a byte register
1357 return "nobytereg"; 1359 return "nobytereg";
1358 } 1360 }
1359 1361
1360 1362
1361 const char* NameConverter::NameOfXMMRegister(int reg) const { 1363 const char* NameConverter::NameOfXMMRegister(int reg) const {
1362 UNREACHABLE(); // PPC does not have any XMM registers 1364 UNREACHABLE(); // PPC does not have any XMM registers
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 pc += d.InstructionDecode(buffer, pc); 1402 pc += d.InstructionDecode(buffer, pc);
1401 v8::internal::PrintF(f, "%p %08x %s\n", prev_pc, 1403 v8::internal::PrintF(f, "%p %08x %s\n", prev_pc,
1402 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); 1404 *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
1403 } 1405 }
1404 } 1406 }
1405 1407
1406 1408
1407 } // namespace disasm 1409 } // namespace disasm
1408 1410
1409 #endif // V8_TARGET_ARCH_PPC 1411 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/ppc/deoptimizer-ppc.cc ('k') | src/ppc/frames-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698