| 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 <iomanip> | 7 #include <iomanip> |
| 8 #include "src/interpreter/source-position-table.h" | 8 #include "src/interpreter/source-position-table.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 int bytecode_offset = static_cast<int>(bytecodes()->size()); | 34 int bytecode_offset = static_cast<int>(bytecodes()->size()); |
| 35 const BytecodeSourceInfo& source_info = node->source_info(); | 35 const BytecodeSourceInfo& source_info = node->source_info(); |
| 36 if (source_info.is_valid()) { | 36 if (source_info.is_valid()) { |
| 37 source_position_table_builder_->AddPosition(bytecode_offset, | 37 source_position_table_builder_->AddPosition(bytecode_offset, |
| 38 source_info.source_position(), | 38 source_info.source_position(), |
| 39 source_info.is_statement()); | 39 source_info.is_statement()); |
| 40 } | 40 } |
| 41 } | 41 } |
| 42 | 42 |
| 43 void BytecodeArrayWriter::EmitBytecode(const BytecodeNode* const node) { | 43 void BytecodeArrayWriter::EmitBytecode(const BytecodeNode* const node) { |
| 44 DCHECK_NE(node->bytecode(), Bytecode::kIllegal); |
| 45 |
| 44 OperandScale operand_scale = node->operand_scale(); | 46 OperandScale operand_scale = node->operand_scale(); |
| 45 if (operand_scale != OperandScale::kSingle) { | 47 if (operand_scale != OperandScale::kSingle) { |
| 46 Bytecode prefix = Bytecodes::OperandScaleToPrefixBytecode(operand_scale); | 48 Bytecode prefix = Bytecodes::OperandScaleToPrefixBytecode(operand_scale); |
| 47 bytecodes()->push_back(Bytecodes::ToByte(prefix)); | 49 bytecodes()->push_back(Bytecodes::ToByte(prefix)); |
| 48 } | 50 } |
| 49 | 51 |
| 50 Bytecode bytecode = node->bytecode(); | 52 Bytecode bytecode = node->bytecode(); |
| 51 bytecodes()->push_back(Bytecodes::ToByte(bytecode)); | 53 bytecodes()->push_back(Bytecodes::ToByte(bytecode)); |
| 52 | 54 |
| 53 int register_operand_bitmap = Bytecodes::GetRegisterOperandBitmap(bytecode); | 55 int register_operand_bitmap = Bytecodes::GetRegisterOperandBitmap(bytecode); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // override | 96 // override |
| 95 void BytecodeArrayWriter::FlushBasicBlock() {} | 97 void BytecodeArrayWriter::FlushBasicBlock() {} |
| 96 | 98 |
| 97 int BytecodeArrayWriter::GetMaximumFrameSizeUsed() { | 99 int BytecodeArrayWriter::GetMaximumFrameSizeUsed() { |
| 98 return max_register_count_ * kPointerSize; | 100 return max_register_count_ * kPointerSize; |
| 99 } | 101 } |
| 100 | 102 |
| 101 } // namespace interpreter | 103 } // namespace interpreter |
| 102 } // namespace internal | 104 } // namespace internal |
| 103 } // namespace v8 | 105 } // namespace v8 |
| OLD | NEW |