| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 "src/interpreter/bytecodes.h" | 5 #include "src/interpreter/bytecodes.h" |
| 6 | 6 |
| 7 #include "src/frames.h" | 7 #include "src/frames.h" |
| 8 #include "src/interpreter/bytecode-traits.h" | 8 #include "src/interpreter/bytecode-traits.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 // static | 484 // static |
| 485 std::ostream& Bytecodes::Decode(std::ostream& os, const uint8_t* bytecode_start, | 485 std::ostream& Bytecodes::Decode(std::ostream& os, const uint8_t* bytecode_start, |
| 486 int parameter_count) { | 486 int parameter_count) { |
| 487 Vector<char> buf = Vector<char>::New(50); | 487 Vector<char> buf = Vector<char>::New(50); |
| 488 | 488 |
| 489 Bytecode bytecode = Bytecodes::FromByte(bytecode_start[0]); | 489 Bytecode bytecode = Bytecodes::FromByte(bytecode_start[0]); |
| 490 int prefix_offset = 0; | 490 int prefix_offset = 0; |
| 491 OperandScale operand_scale = OperandScale::kSingle; | 491 OperandScale operand_scale = OperandScale::kSingle; |
| 492 if (IsPrefixScalingBytecode(bytecode)) { | 492 if (IsPrefixScalingBytecode(bytecode)) { |
| 493 prefix_offset = 1; | 493 prefix_offset = 1; |
| 494 operand_scale = Bytecodes::PrefixBytecodeToOperandScale(bytecode); |
| 494 bytecode = Bytecodes::FromByte(bytecode_start[1]); | 495 bytecode = Bytecodes::FromByte(bytecode_start[1]); |
| 495 } | 496 } |
| 496 int bytecode_size = Bytecodes::Size(bytecode, operand_scale); | 497 int bytecode_size = Bytecodes::Size(bytecode, operand_scale); |
| 497 for (int i = 0; i < prefix_offset + bytecode_size; i++) { | 498 for (int i = 0; i < prefix_offset + bytecode_size; i++) { |
| 498 SNPrintF(buf, "%02x ", bytecode_start[i]); | 499 SNPrintF(buf, "%02x ", bytecode_start[i]); |
| 499 os << buf.start(); | 500 os << buf.start(); |
| 500 } | 501 } |
| 501 const int kBytecodeColumnSize = 6; | 502 const int kBytecodeColumnSize = 6; |
| 502 for (int i = prefix_offset + bytecode_size; i < kBytecodeColumnSize; i++) { | 503 for (int i = prefix_offset + bytecode_size; i < kBytecodeColumnSize; i++) { |
| 503 os << " "; | 504 os << " "; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 } else { | 677 } else { |
| 677 std::ostringstream s; | 678 std::ostringstream s; |
| 678 s << "r" << index(); | 679 s << "r" << index(); |
| 679 return s.str(); | 680 return s.str(); |
| 680 } | 681 } |
| 681 } | 682 } |
| 682 | 683 |
| 683 } // namespace interpreter | 684 } // namespace interpreter |
| 684 } // namespace internal | 685 } // namespace internal |
| 685 } // namespace v8 | 686 } // namespace v8 |
| OLD | NEW |