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/arm64/frames-arm64.h" | 5 #include "src/arm64/frames-arm64.h" |
6 #include "src/arm64/lithium-codegen-arm64.h" | 6 #include "src/arm64/lithium-codegen-arm64.h" |
7 #include "src/arm64/lithium-gap-resolver-arm64.h" | 7 #include "src/arm64/lithium-gap-resolver-arm64.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 LEnvironment* environment = instr->environment(); | 974 LEnvironment* environment = instr->environment(); |
975 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 975 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
976 Deoptimizer::BailoutType bailout_type = | 976 Deoptimizer::BailoutType bailout_type = |
977 info()->IsStub() ? Deoptimizer::LAZY : Deoptimizer::EAGER; | 977 info()->IsStub() ? Deoptimizer::LAZY : Deoptimizer::EAGER; |
978 | 978 |
979 if (override_bailout_type != NULL) { | 979 if (override_bailout_type != NULL) { |
980 bailout_type = *override_bailout_type; | 980 bailout_type = *override_bailout_type; |
981 } | 981 } |
982 | 982 |
983 DCHECK(environment->HasBeenRegistered()); | 983 DCHECK(environment->HasBeenRegistered()); |
984 DCHECK(info()->IsOptimizing() || info()->IsStub()); | |
985 int id = environment->deoptimization_index(); | 984 int id = environment->deoptimization_index(); |
986 Address entry = | 985 Address entry = |
987 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); | 986 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
988 | 987 |
989 if (entry == NULL) { | 988 if (entry == NULL) { |
990 Abort(kBailoutWasNotPrepared); | 989 Abort(kBailoutWasNotPrepared); |
991 } | 990 } |
992 | 991 |
993 if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { | 992 if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { |
994 Label not_zero; | 993 Label not_zero; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 } | 1124 } |
1126 | 1125 |
1127 | 1126 |
1128 void LCodeGen::DeoptimizeIfBitClear(Register rt, int bit, LInstruction* instr, | 1127 void LCodeGen::DeoptimizeIfBitClear(Register rt, int bit, LInstruction* instr, |
1129 Deoptimizer::DeoptReason deopt_reason) { | 1128 Deoptimizer::DeoptReason deopt_reason) { |
1130 DeoptimizeBranch(instr, deopt_reason, reg_bit_clear, rt, bit); | 1129 DeoptimizeBranch(instr, deopt_reason, reg_bit_clear, rt, bit); |
1131 } | 1130 } |
1132 | 1131 |
1133 | 1132 |
1134 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 1133 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
1135 if (!info()->IsStub()) { | 1134 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
1136 // Ensure that we have enough space after the previous lazy-bailout | 1135 // Ensure that we have enough space after the previous lazy-bailout |
1137 // instruction for patching the code here. | 1136 // instruction for patching the code here. |
1138 intptr_t current_pc = masm()->pc_offset(); | 1137 intptr_t current_pc = masm()->pc_offset(); |
1139 | 1138 |
1140 if (current_pc < (last_lazy_deopt_pc_ + space_needed)) { | 1139 if (current_pc < (last_lazy_deopt_pc_ + space_needed)) { |
1141 ptrdiff_t padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1140 ptrdiff_t padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1142 DCHECK((padding_size % kInstructionSize) == 0); | 1141 DCHECK((padding_size % kInstructionSize) == 0); |
1143 InstructionAccurateScope instruction_accurate( | 1142 InstructionAccurateScope instruction_accurate( |
1144 masm(), padding_size / kInstructionSize); | 1143 masm(), padding_size / kInstructionSize); |
1145 | 1144 |
(...skipping 4899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6045 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6044 Handle<ScopeInfo> scope_info = instr->scope_info(); |
6046 __ Push(scope_info); | 6045 __ Push(scope_info); |
6047 __ Push(ToRegister(instr->function())); | 6046 __ Push(ToRegister(instr->function())); |
6048 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6047 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6049 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6048 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6050 } | 6049 } |
6051 | 6050 |
6052 | 6051 |
6053 } // namespace internal | 6052 } // namespace internal |
6054 } // namespace v8 | 6053 } // namespace v8 |
OLD | NEW |