OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/address-map.h" | 7 #include "src/address-map.h" |
8 #include "src/base/adapters.h" | 8 #include "src/base/adapters.h" |
9 #include "src/compiler/code-generator-impl.h" | 9 #include "src/compiler/code-generator-impl.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage, | 35 CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage, |
36 InstructionSequence* code, CompilationInfo* info) | 36 InstructionSequence* code, CompilationInfo* info) |
37 : frame_access_state_(nullptr), | 37 : frame_access_state_(nullptr), |
38 linkage_(linkage), | 38 linkage_(linkage), |
39 code_(code), | 39 code_(code), |
40 info_(info), | 40 info_(info), |
41 labels_(zone()->NewArray<Label>(code->InstructionBlockCount())), | 41 labels_(zone()->NewArray<Label>(code->InstructionBlockCount())), |
42 current_block_(RpoNumber::Invalid()), | 42 current_block_(RpoNumber::Invalid()), |
43 current_source_position_(SourcePosition::Unknown()), | 43 current_source_position_(SourcePosition::Unknown()), |
44 masm_(info->isolate(), nullptr, 0, CodeObjectRequired::kNo), | 44 masm_(info->isolate(), nullptr, 0, CodeObjectRequired::kYes), |
45 resolver_(this), | 45 resolver_(this), |
46 safepoints_(code->zone()), | 46 safepoints_(code->zone()), |
47 handlers_(code->zone()), | 47 handlers_(code->zone()), |
48 deoptimization_exits_(code->zone()), | 48 deoptimization_exits_(code->zone()), |
49 deoptimization_states_(code->zone()), | 49 deoptimization_states_(code->zone()), |
50 deoptimization_literals_(code->zone()), | 50 deoptimization_literals_(code->zone()), |
51 inlined_function_count_(0), | 51 inlined_function_count_(0), |
52 translations_(code->zone()), | 52 translations_(code->zone()), |
53 last_lazy_deopt_pc_(0), | 53 last_lazy_deopt_pc_(0), |
54 jump_tables_(nullptr), | 54 jump_tables_(nullptr), |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 if (jump_tables_) { | 196 if (jump_tables_) { |
197 masm()->Align(kPointerSize); | 197 masm()->Align(kPointerSize); |
198 for (JumpTable* table = jump_tables_; table; table = table->next()) { | 198 for (JumpTable* table = jump_tables_; table; table = table->next()) { |
199 masm()->bind(table->label()); | 199 masm()->bind(table->label()); |
200 AssembleJumpTable(table->targets(), table->target_count()); | 200 AssembleJumpTable(table->targets(), table->target_count()); |
201 } | 201 } |
202 } | 202 } |
203 | 203 |
204 safepoints()->Emit(masm(), frame()->GetTotalFrameSlotCount()); | 204 safepoints()->Emit(masm(), frame()->GetTotalFrameSlotCount()); |
205 | 205 |
206 // Turbofan does not use the self reference. | 206 Handle<Code> result = |
207 Handle<Code> result = v8::internal::CodeGenerator::MakeCodeEpilogue( | 207 v8::internal::CodeGenerator::MakeCodeEpilogue(masm(), nullptr, info); |
208 masm(), nullptr, info, Handle<Object>()); | |
209 result->set_is_turbofanned(true); | 208 result->set_is_turbofanned(true); |
210 result->set_stack_slots(frame()->GetTotalFrameSlotCount()); | 209 result->set_stack_slots(frame()->GetTotalFrameSlotCount()); |
211 result->set_safepoint_table_offset(safepoints()->GetCodeOffset()); | 210 result->set_safepoint_table_offset(safepoints()->GetCodeOffset()); |
212 Handle<ByteArray> source_positions = | 211 Handle<ByteArray> source_positions = |
213 source_position_table_builder_.ToSourcePositionTable(); | 212 source_position_table_builder_.ToSourcePositionTable(); |
214 result->set_source_position_table(*source_positions); | 213 result->set_source_position_table(*source_positions); |
215 source_position_table_builder_.EndJitLogging(AbstractCode::cast(*result)); | 214 source_position_table_builder_.EndJitLogging(AbstractCode::cast(*result)); |
216 | 215 |
217 // Emit exception handler table. | 216 // Emit exception handler table. |
218 if (!handlers_.empty()) { | 217 if (!handlers_.empty()) { |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { | 898 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { |
900 gen->ools_ = this; | 899 gen->ools_ = this; |
901 } | 900 } |
902 | 901 |
903 | 902 |
904 OutOfLineCode::~OutOfLineCode() {} | 903 OutOfLineCode::~OutOfLineCode() {} |
905 | 904 |
906 } // namespace compiler | 905 } // namespace compiler |
907 } // namespace internal | 906 } // namespace internal |
908 } // namespace v8 | 907 } // namespace v8 |
OLD | NEW |