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 { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 BytecodeNode::BytecodeNode(const BytecodeNode& other) { | 53 BytecodeNode::BytecodeNode(const BytecodeNode& other) { |
54 memcpy(this, &other, sizeof(other)); | 54 memcpy(this, &other, sizeof(other)); |
55 } | 55 } |
56 | 56 |
57 BytecodeNode& BytecodeNode::operator=(const BytecodeNode& other) { | 57 BytecodeNode& BytecodeNode::operator=(const BytecodeNode& other) { |
58 memcpy(this, &other, sizeof(other)); | 58 memcpy(this, &other, sizeof(other)); |
59 return *this; | 59 return *this; |
60 } | 60 } |
61 | 61 |
62 void BytecodeNode::set_bytecode(Bytecode bytecode) { | |
63 DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 0); | |
64 bytecode_ = bytecode; | |
65 } | |
66 | |
67 void BytecodeNode::set_bytecode(Bytecode bytecode, uint32_t operand0) { | |
68 DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 1); | |
69 bytecode_ = bytecode; | |
70 operands_[0] = operand0; | |
71 } | |
72 | |
73 void BytecodeNode::Clone(const BytecodeNode* const other) { | 62 void BytecodeNode::Clone(const BytecodeNode* const other) { |
74 memcpy(this, other, sizeof(*other)); | 63 memcpy(this, other, sizeof(*other)); |
75 } | 64 } |
76 | 65 |
77 void BytecodeNode::Print(std::ostream& os) const { | 66 void BytecodeNode::Print(std::ostream& os) const { |
78 #ifdef DEBUG | 67 #ifdef DEBUG |
79 std::ios saved_state(nullptr); | 68 std::ios saved_state(nullptr); |
80 saved_state.copyfmt(os); | 69 saved_state.copyfmt(os); |
81 os << Bytecodes::ToString(bytecode_); | 70 os << Bytecodes::ToString(bytecode_); |
82 | 71 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 } | 125 } |
137 | 126 |
138 std::ostream& operator<<(std::ostream& os, const BytecodeNode& node) { | 127 std::ostream& operator<<(std::ostream& os, const BytecodeNode& node) { |
139 node.Print(os); | 128 node.Print(os); |
140 return os; | 129 return os; |
141 } | 130 } |
142 | 131 |
143 } // namespace interpreter | 132 } // namespace interpreter |
144 } // namespace internal | 133 } // namespace internal |
145 } // namespace v8 | 134 } // namespace v8 |
OLD | NEW |