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-builder.h" | 5 #include "src/interpreter/bytecode-array-builder.h" |
6 #include "src/compiler.h" | 6 #include "src/compiler.h" |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 namespace interpreter { | 10 namespace interpreter { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 Handle<BytecodeArray> BytecodeArrayBuilder::ToBytecodeArray() { | 117 Handle<BytecodeArray> BytecodeArrayBuilder::ToBytecodeArray() { |
118 DCHECK_EQ(bytecode_generated_, false); | 118 DCHECK_EQ(bytecode_generated_, false); |
119 DCHECK(exit_seen_in_block_); | 119 DCHECK(exit_seen_in_block_); |
120 | 120 |
121 int bytecode_size = static_cast<int>(bytecodes_.size()); | 121 int bytecode_size = static_cast<int>(bytecodes_.size()); |
122 int register_count = | 122 int register_count = |
123 fixed_and_temporary_register_count() + translation_register_count(); | 123 fixed_and_temporary_register_count() + translation_register_count(); |
124 int frame_size = register_count * kPointerSize; | 124 int frame_size = register_count * kPointerSize; |
125 Handle<FixedArray> constant_pool = constant_array_builder()->ToFixedArray(); | 125 Handle<FixedArray> constant_pool = constant_array_builder()->ToFixedArray(); |
126 Handle<FixedArray> handler_table = handler_table_builder()->ToHandlerTable(); | 126 Handle<FixedArray> handler_table = handler_table_builder()->ToHandlerTable(); |
127 Handle<FixedArray> source_position_table = | 127 Handle<ByteArray> source_position_table = |
128 source_position_table_builder()->ToFixedArray(); | 128 source_position_table_builder()->ToSourcePositionTable(); |
129 Handle<BytecodeArray> output = isolate_->factory()->NewBytecodeArray( | 129 Handle<BytecodeArray> output = isolate_->factory()->NewBytecodeArray( |
130 bytecode_size, &bytecodes_.front(), frame_size, parameter_count(), | 130 bytecode_size, &bytecodes_.front(), frame_size, parameter_count(), |
131 constant_pool); | 131 constant_pool); |
132 output->set_handler_table(*handler_table); | 132 output->set_handler_table(*handler_table); |
133 output->set_source_position_table(*source_position_table); | 133 output->set_source_position_table(*source_position_table); |
134 bytecode_generated_ = true; | 134 bytecode_generated_ = true; |
135 return output; | 135 return output; |
136 } | 136 } |
137 | 137 |
138 | 138 |
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 } | 1692 } |
1693 | 1693 |
1694 // static | 1694 // static |
1695 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) { | 1695 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) { |
1696 return value.is_short_operand(); | 1696 return value.is_short_operand(); |
1697 } | 1697 } |
1698 | 1698 |
1699 } // namespace interpreter | 1699 } // namespace interpreter |
1700 } // namespace internal | 1700 } // namespace internal |
1701 } // namespace v8 | 1701 } // namespace v8 |
OLD | NEW |