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) BytecodeRegisterOptimizer( |
| 46 zone, &temporary_allocator_, parameter_count, pipeline_); |
| 47 } |
| 48 |
43 return_position_ = | 49 return_position_ = |
44 literal ? std::max(literal->start_position(), literal->end_position() - 1) | 50 literal ? std::max(literal->start_position(), literal->end_position() - 1) |
45 : RelocInfo::kNoPosition; | 51 : RelocInfo::kNoPosition; |
46 LOG_CODE_EVENT(isolate_, CodeStartLinePosInfoRecordEvent( | 52 LOG_CODE_EVENT(isolate_, CodeStartLinePosInfoRecordEvent( |
47 source_position_table_builder())); | 53 source_position_table_builder())); |
48 } | 54 } |
49 | 55 |
50 Register BytecodeArrayBuilder::first_context_register() const { | 56 Register BytecodeArrayBuilder::first_context_register() const { |
51 DCHECK_GT(context_register_count_, 0); | 57 DCHECK_GT(context_register_count_, 0); |
52 return Register(local_register_count_); | 58 return Register(local_register_count_); |
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1286 } | 1292 } |
1287 | 1293 |
1288 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) { | 1294 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) { |
1289 DCHECK_LE(value, kMaxUInt32); | 1295 DCHECK_LE(value, kMaxUInt32); |
1290 return static_cast<uint32_t>(value); | 1296 return static_cast<uint32_t>(value); |
1291 } | 1297 } |
1292 | 1298 |
1293 } // namespace interpreter | 1299 } // namespace interpreter |
1294 } // namespace internal | 1300 } // namespace internal |
1295 } // namespace v8 | 1301 } // namespace v8 |
OLD | NEW |