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/globals.h" | 8 #include "src/globals.h" |
9 #include "src/interpreter/bytecode-array-writer.h" | 9 #include "src/interpreter/bytecode-array-writer.h" |
10 #include "src/interpreter/bytecode-dead-code-optimizer.h" | 10 #include "src/interpreter/bytecode-dead-code-optimizer.h" |
11 #include "src/interpreter/bytecode-label.h" | 11 #include "src/interpreter/bytecode-label.h" |
12 #include "src/interpreter/bytecode-peephole-optimizer.h" | 12 #include "src/interpreter/bytecode-peephole-optimizer.h" |
13 #include "src/interpreter/bytecode-register-optimizer.h" | 13 #include "src/interpreter/bytecode-register-optimizer.h" |
14 #include "src/interpreter/interpreter-intrinsics.h" | 14 #include "src/interpreter/interpreter-intrinsics.h" |
15 | 15 |
16 namespace v8 { | 16 namespace v8 { |
17 namespace internal { | 17 namespace internal { |
18 namespace interpreter { | 18 namespace interpreter { |
19 | 19 |
20 BytecodeArrayBuilder::BytecodeArrayBuilder(Isolate* isolate, Zone* zone, | 20 BytecodeArrayBuilder::BytecodeArrayBuilder( |
21 int parameter_count, | 21 Isolate* isolate, Zone* zone, int parameter_count, int context_count, |
22 int context_count, int locals_count, | 22 int locals_count, FunctionLiteral* literal, |
23 FunctionLiteral* literal) | 23 SourcePositionTableBuilder::RecordingMode source_position_mode) |
24 : isolate_(isolate), | 24 : isolate_(isolate), |
25 zone_(zone), | 25 zone_(zone), |
26 bytecode_generated_(false), | 26 bytecode_generated_(false), |
27 constant_array_builder_(isolate, zone), | 27 constant_array_builder_(isolate, zone), |
28 handler_table_builder_(isolate, zone), | 28 handler_table_builder_(isolate, zone), |
29 return_seen_in_block_(false), | 29 return_seen_in_block_(false), |
30 parameter_count_(parameter_count), | 30 parameter_count_(parameter_count), |
31 local_register_count_(locals_count), | 31 local_register_count_(locals_count), |
32 context_register_count_(context_count), | 32 context_register_count_(context_count), |
33 temporary_allocator_(zone, fixed_register_count()), | 33 temporary_allocator_(zone, fixed_register_count()), |
34 bytecode_array_writer_(isolate, zone, &constant_array_builder_), | 34 bytecode_array_writer_(isolate, zone, &constant_array_builder_, |
| 35 source_position_mode), |
35 pipeline_(&bytecode_array_writer_) { | 36 pipeline_(&bytecode_array_writer_) { |
36 DCHECK_GE(parameter_count_, 0); | 37 DCHECK_GE(parameter_count_, 0); |
37 DCHECK_GE(context_register_count_, 0); | 38 DCHECK_GE(context_register_count_, 0); |
38 DCHECK_GE(local_register_count_, 0); | 39 DCHECK_GE(local_register_count_, 0); |
39 | 40 |
40 if (FLAG_ignition_deadcode) { | 41 if (FLAG_ignition_deadcode) { |
41 pipeline_ = new (zone) BytecodeDeadCodeOptimizer(pipeline_); | 42 pipeline_ = new (zone) BytecodeDeadCodeOptimizer(pipeline_); |
42 } | 43 } |
43 | 44 |
44 if (FLAG_ignition_peephole) { | 45 if (FLAG_ignition_peephole) { |
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 return Bytecode::kTailCall; | 932 return Bytecode::kTailCall; |
932 default: | 933 default: |
933 UNREACHABLE(); | 934 UNREACHABLE(); |
934 } | 935 } |
935 return Bytecode::kIllegal; | 936 return Bytecode::kIllegal; |
936 } | 937 } |
937 | 938 |
938 } // namespace interpreter | 939 } // namespace interpreter |
939 } // namespace internal | 940 } // namespace internal |
940 } // namespace v8 | 941 } // namespace v8 |
OLD | NEW |