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-array-writer.h" | 5 #include "src/interpreter/bytecode-array-writer.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/interpreter/bytecode-label.h" | 8 #include "src/interpreter/bytecode-label.h" |
9 #include "src/interpreter/bytecode-register.h" | 9 #include "src/interpreter/bytecode-register.h" |
10 #include "src/interpreter/constant-array-builder.h" | 10 #include "src/interpreter/constant-array-builder.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Now treat as if the label will only be back referred to. | 87 // Now treat as if the label will only be back referred to. |
88 } | 88 } |
89 label->bind_to(target.offset()); | 89 label->bind_to(target.offset()); |
90 } | 90 } |
91 | 91 |
92 void BytecodeArrayWriter::UpdateSourcePositionTable( | 92 void BytecodeArrayWriter::UpdateSourcePositionTable( |
93 const BytecodeNode* const node) { | 93 const BytecodeNode* const node) { |
94 int bytecode_offset = static_cast<int>(bytecodes()->size()); | 94 int bytecode_offset = static_cast<int>(bytecodes()->size()); |
95 const BytecodeSourceInfo& source_info = node->source_info(); | 95 const BytecodeSourceInfo& source_info = node->source_info(); |
96 if (source_info.is_valid()) { | 96 if (source_info.is_valid()) { |
97 source_position_table_builder()->AddPosition(bytecode_offset, | 97 source_position_table_builder()->AddPosition( |
98 source_info.source_position(), | 98 bytecode_offset, SourcePosition(source_info.source_position()), |
99 source_info.is_statement()); | 99 source_info.is_statement()); |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 void BytecodeArrayWriter::EmitBytecode(const BytecodeNode* const node) { | 103 void BytecodeArrayWriter::EmitBytecode(const BytecodeNode* const node) { |
104 DCHECK_NE(node->bytecode(), Bytecode::kIllegal); | 104 DCHECK_NE(node->bytecode(), Bytecode::kIllegal); |
105 | 105 |
106 Bytecode bytecode = node->bytecode(); | 106 Bytecode bytecode = node->bytecode(); |
107 OperandScale operand_scale = node->operand_scale(); | 107 OperandScale operand_scale = node->operand_scale(); |
108 | 108 |
109 if (operand_scale != OperandScale::kSingle) { | 109 if (operand_scale != OperandScale::kSingle) { |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 node->set_bytecode(node->bytecode(), k32BitJumpPlaceholder); | 317 node->set_bytecode(node->bytecode(), k32BitJumpPlaceholder); |
318 break; | 318 break; |
319 } | 319 } |
320 } | 320 } |
321 EmitBytecode(node); | 321 EmitBytecode(node); |
322 } | 322 } |
323 | 323 |
324 } // namespace interpreter | 324 } // namespace interpreter |
325 } // namespace internal | 325 } // namespace internal |
326 } // namespace v8 | 326 } // namespace v8 |
OLD | NEW |