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/bytecode-pipeline.h" | 5 #include "src/interpreter/bytecode-pipeline.h" |
6 | 6 |
7 #include <iomanip> | 7 #include <iomanip> |
8 #include "src/source-position-table.h" | 8 #include "src/source-position-table.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 namespace interpreter { | 12 namespace interpreter { |
13 | 13 |
14 BytecodeNode::BytecodeNode(const BytecodeNode& other) { | |
15 memcpy(this, &other, sizeof(other)); | |
16 } | |
17 | |
18 BytecodeNode& BytecodeNode::operator=(const BytecodeNode& other) { | |
19 memcpy(this, &other, sizeof(other)); | |
20 return *this; | |
21 } | |
22 | |
23 void BytecodeNode::Clone(const BytecodeNode* const other) { | |
24 memcpy(this, other, sizeof(*other)); | |
25 } | |
26 | |
27 void BytecodeNode::Print(std::ostream& os) const { | 14 void BytecodeNode::Print(std::ostream& os) const { |
28 #ifdef DEBUG | 15 #ifdef DEBUG |
29 std::ios saved_state(nullptr); | 16 std::ios saved_state(nullptr); |
30 saved_state.copyfmt(os); | 17 saved_state.copyfmt(os); |
31 os << Bytecodes::ToString(bytecode_); | 18 os << Bytecodes::ToString(bytecode_); |
32 | 19 |
33 for (int i = 0; i < operand_count(); ++i) { | 20 for (int i = 0; i < operand_count(); ++i) { |
34 os << ' ' << std::setw(8) << std::setfill('0') << std::hex << operands_[i]; | 21 os << ' ' << std::setw(8) << std::setfill('0') << std::hex << operands_[i]; |
35 } | 22 } |
36 os.copyfmt(saved_state); | 23 os.copyfmt(saved_state); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 56 } |
70 | 57 |
71 std::ostream& operator<<(std::ostream& os, const BytecodeNode& node) { | 58 std::ostream& operator<<(std::ostream& os, const BytecodeNode& node) { |
72 node.Print(os); | 59 node.Print(os); |
73 return os; | 60 return os; |
74 } | 61 } |
75 | 62 |
76 } // namespace interpreter | 63 } // namespace interpreter |
77 } // namespace internal | 64 } // namespace internal |
78 } // namespace v8 | 65 } // namespace v8 |
OLD | NEW |