| 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 | 6 |
| 7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
| 8 #include "src/interpreter/bytecode-array-writer.h" | 8 #include "src/interpreter/bytecode-array-writer.h" |
| 9 #include "src/interpreter/bytecode-peephole-optimizer.h" | 9 #include "src/interpreter/bytecode-peephole-optimizer.h" |
| 10 #include "src/interpreter/bytecode-register-optimizer.h" |
| 10 #include "src/interpreter/interpreter-intrinsics.h" | 11 #include "src/interpreter/interpreter-intrinsics.h" |
| 11 | 12 |
| 12 namespace v8 { | 13 namespace v8 { |
| 13 namespace internal { | 14 namespace internal { |
| 14 namespace interpreter { | 15 namespace interpreter { |
| 15 | 16 |
| 16 BytecodeArrayBuilder::BytecodeArrayBuilder(Isolate* isolate, Zone* zone, | 17 BytecodeArrayBuilder::BytecodeArrayBuilder(Isolate* isolate, Zone* zone, |
| 17 int parameter_count, | 18 int parameter_count, |
| 18 int context_count, int locals_count, | 19 int context_count, int locals_count, |
| 19 FunctionLiteral* literal) | 20 FunctionLiteral* literal) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 33 pipeline_(&bytecode_array_writer_) { | 34 pipeline_(&bytecode_array_writer_) { |
| 34 DCHECK_GE(parameter_count_, 0); | 35 DCHECK_GE(parameter_count_, 0); |
| 35 DCHECK_GE(context_register_count_, 0); | 36 DCHECK_GE(context_register_count_, 0); |
| 36 DCHECK_GE(local_register_count_, 0); | 37 DCHECK_GE(local_register_count_, 0); |
| 37 | 38 |
| 38 if (FLAG_ignition_peephole) { | 39 if (FLAG_ignition_peephole) { |
| 39 pipeline_ = new (zone) | 40 pipeline_ = new (zone) |
| 40 BytecodePeepholeOptimizer(&constant_array_builder_, pipeline_); | 41 BytecodePeepholeOptimizer(&constant_array_builder_, pipeline_); |
| 41 } | 42 } |
| 42 | 43 |
| 44 if (FLAG_ignition_reo) { |
| 45 pipeline_ = new (zone) |
| 46 BytecodeRegisterOptimizer(zone, &temporary_allocator_, parameter_count, |
| 47 fixed_register_count(), pipeline_); |
| 48 } |
| 49 |
| 43 return_position_ = | 50 return_position_ = |
| 44 literal ? std::max(literal->start_position(), literal->end_position() - 1) | 51 literal ? std::max(literal->start_position(), literal->end_position() - 1) |
| 45 : RelocInfo::kNoPosition; | 52 : RelocInfo::kNoPosition; |
| 46 LOG_CODE_EVENT(isolate_, CodeStartLinePosInfoRecordEvent( | 53 LOG_CODE_EVENT(isolate_, CodeStartLinePosInfoRecordEvent( |
| 47 source_position_table_builder())); | 54 source_position_table_builder())); |
| 48 } | 55 } |
| 49 | 56 |
| 50 Register BytecodeArrayBuilder::first_context_register() const { | 57 Register BytecodeArrayBuilder::first_context_register() const { |
| 51 DCHECK_GT(context_register_count_, 0); | 58 DCHECK_GT(context_register_count_, 0); |
| 52 return Register(local_register_count_); | 59 return Register(local_register_count_); |
| (...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1284 } | 1291 } |
| 1285 | 1292 |
| 1286 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) { | 1293 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) { |
| 1287 DCHECK_LE(value, kMaxUInt32); | 1294 DCHECK_LE(value, kMaxUInt32); |
| 1288 return static_cast<uint32_t>(value); | 1295 return static_cast<uint32_t>(value); |
| 1289 } | 1296 } |
| 1290 | 1297 |
| 1291 } // namespace interpreter | 1298 } // namespace interpreter |
| 1292 } // namespace internal | 1299 } // namespace internal |
| 1293 } // namespace v8 | 1300 } // namespace v8 |
| OLD | NEW |