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/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/pipeline.h" | 9 #include "src/compiler/pipeline.h" |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 safepoints()->Emit(masm(), frame()->GetSpillSlotCount()); | 127 safepoints()->Emit(masm(), frame()->GetSpillSlotCount()); |
128 | 128 |
129 Handle<Code> result = v8::internal::CodeGenerator::MakeCodeEpilogue( | 129 Handle<Code> result = v8::internal::CodeGenerator::MakeCodeEpilogue( |
130 masm(), info->flags(), info); | 130 masm(), info->flags(), info); |
131 result->set_is_turbofanned(true); | 131 result->set_is_turbofanned(true); |
132 result->set_stack_slots(frame()->GetSpillSlotCount()); | 132 result->set_stack_slots(frame()->GetSpillSlotCount()); |
133 result->set_safepoint_table_offset(safepoints()->GetCodeOffset()); | 133 result->set_safepoint_table_offset(safepoints()->GetCodeOffset()); |
134 | 134 |
135 // Emit exception handler table. | 135 // Emit exception handler table. |
136 if (!handlers_.empty()) { | 136 if (!handlers_.empty()) { |
137 Handle<FixedArray> table = isolate()->factory()->NewFixedArray( | 137 Handle<HandlerTable> table = |
138 static_cast<int>(handlers_.size()) * 2, TENURED); | 138 Handle<HandlerTable>::cast(isolate()->factory()->NewFixedArray( |
| 139 HandlerTable::LengthForReturn(static_cast<int>(handlers_.size())), |
| 140 TENURED)); |
139 for (size_t i = 0; i < handlers_.size(); ++i) { | 141 for (size_t i = 0; i < handlers_.size(); ++i) { |
140 int table_index = static_cast<int>(i * 2); | 142 table->SetReturnOffset(static_cast<int>(i), handlers_[i].pc_offset); |
141 table->set(table_index + 0, Smi::FromInt(handlers_[i].pc_offset)); | 143 table->SetReturnHandler(static_cast<int>(i), handlers_[i].handler->pos()); |
142 table->set(table_index + 1, Smi::FromInt(handlers_[i].handler->pos())); | |
143 } | 144 } |
144 result->set_handler_table(*table); | 145 result->set_handler_table(*table); |
145 } | 146 } |
146 | 147 |
147 PopulateDeoptimizationData(result); | 148 PopulateDeoptimizationData(result); |
148 | 149 |
149 // Ensure there is space for lazy deoptimization in the relocation info. | 150 // Ensure there is space for lazy deoptimization in the relocation info. |
150 if (!info->IsStub()) { | 151 if (!info->IsStub()) { |
151 Deoptimizer::EnsureRelocSpaceForLazyDeoptimization(result); | 152 Deoptimizer::EnsureRelocSpaceForLazyDeoptimization(result); |
152 } | 153 } |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 : masm_(gen->masm()), next_(gen->ools_) { | 640 : masm_(gen->masm()), next_(gen->ools_) { |
640 gen->ools_ = this; | 641 gen->ools_ = this; |
641 } | 642 } |
642 | 643 |
643 | 644 |
644 OutOfLineCode::~OutOfLineCode() {} | 645 OutOfLineCode::~OutOfLineCode() {} |
645 | 646 |
646 } // namespace compiler | 647 } // namespace compiler |
647 } // namespace internal | 648 } // namespace internal |
648 } // namespace v8 | 649 } // namespace v8 |
OLD | NEW |