| 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/compilation-info.h" | 9 #include "src/compilation-info.h" |
| 10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 for (OutOfLineCode* ool = ools_; ool; ool = ool->next()) { | 181 for (OutOfLineCode* ool = ools_; ool; ool = ool->next()) { |
| 182 masm()->bind(ool->entry()); | 182 masm()->bind(ool->entry()); |
| 183 ool->Generate(); | 183 ool->Generate(); |
| 184 if (ool->exit()->is_bound()) masm()->jmp(ool->exit()); | 184 if (ool->exit()->is_bound()) masm()->jmp(ool->exit()); |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 | 187 |
| 188 // Assemble all eager deoptimization exits. | 188 // Assemble all eager deoptimization exits. |
| 189 for (DeoptimizationExit* exit : deoptimization_exits_) { | 189 for (DeoptimizationExit* exit : deoptimization_exits_) { |
| 190 masm()->bind(exit->label()); | 190 masm()->bind(exit->label()); |
| 191 AssembleDeoptimizerCall(exit->deoptimization_id(), Deoptimizer::EAGER); | 191 AssembleDeoptimizerCall(exit->deoptimization_id(), Deoptimizer::EAGER, |
| 192 exit->pos()); |
| 192 } | 193 } |
| 193 | 194 |
| 194 // Ensure there is space for lazy deoptimization in the code. | 195 // Ensure there is space for lazy deoptimization in the code. |
| 195 if (info->ShouldEnsureSpaceForLazyDeopt()) { | 196 if (info->ShouldEnsureSpaceForLazyDeopt()) { |
| 196 int target_offset = masm()->pc_offset() + Deoptimizer::patch_size(); | 197 int target_offset = masm()->pc_offset() + Deoptimizer::patch_size(); |
| 197 while (masm()->pc_offset() < target_offset) { | 198 while (masm()->pc_offset() < target_offset) { |
| 198 masm()->nop(); | 199 masm()->nop(); |
| 199 } | 200 } |
| 200 } | 201 } |
| 201 | 202 |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 | 925 |
| 925 | 926 |
| 926 void CodeGenerator::MarkLazyDeoptSite() { | 927 void CodeGenerator::MarkLazyDeoptSite() { |
| 927 last_lazy_deopt_pc_ = masm()->pc_offset(); | 928 last_lazy_deopt_pc_ = masm()->pc_offset(); |
| 928 } | 929 } |
| 929 | 930 |
| 930 DeoptimizationExit* CodeGenerator::AddDeoptimizationExit( | 931 DeoptimizationExit* CodeGenerator::AddDeoptimizationExit( |
| 931 Instruction* instr, size_t frame_state_offset) { | 932 Instruction* instr, size_t frame_state_offset) { |
| 932 int const deoptimization_id = BuildTranslation( | 933 int const deoptimization_id = BuildTranslation( |
| 933 instr, -1, frame_state_offset, OutputFrameStateCombine::Ignore()); | 934 instr, -1, frame_state_offset, OutputFrameStateCombine::Ignore()); |
| 934 DeoptimizationExit* const exit = | 935 DeoptimizationExit* const exit = new (zone()) |
| 935 new (zone()) DeoptimizationExit(deoptimization_id); | 936 DeoptimizationExit(deoptimization_id, current_source_position_); |
| 936 deoptimization_exits_.push_back(exit); | 937 deoptimization_exits_.push_back(exit); |
| 937 return exit; | 938 return exit; |
| 938 } | 939 } |
| 939 | 940 |
| 940 OutOfLineCode::OutOfLineCode(CodeGenerator* gen) | 941 OutOfLineCode::OutOfLineCode(CodeGenerator* gen) |
| 941 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { | 942 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { |
| 942 gen->ools_ = this; | 943 gen->ools_ = this; |
| 943 } | 944 } |
| 944 | 945 |
| 945 | 946 |
| 946 OutOfLineCode::~OutOfLineCode() {} | 947 OutOfLineCode::~OutOfLineCode() {} |
| 947 | 948 |
| 948 } // namespace compiler | 949 } // namespace compiler |
| 949 } // namespace internal | 950 } // namespace internal |
| 950 } // namespace v8 | 951 } // namespace v8 |
| OLD | NEW |