| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/arm/lithium-codegen-arm.h" | 5 #include "src/arm/lithium-codegen-arm.h" |
| 6 #include "src/arm/lithium-gap-resolver-arm.h" | 6 #include "src/arm/lithium-gap-resolver-arm.h" |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 } | 800 } |
| 801 | 801 |
| 802 | 802 |
| 803 void LCodeGen::DeoptimizeIf(Condition condition, LInstruction* instr, | 803 void LCodeGen::DeoptimizeIf(Condition condition, LInstruction* instr, |
| 804 Deoptimizer::DeoptReason deopt_reason, | 804 Deoptimizer::DeoptReason deopt_reason, |
| 805 Deoptimizer::BailoutType bailout_type) { | 805 Deoptimizer::BailoutType bailout_type) { |
| 806 LEnvironment* environment = instr->environment(); | 806 LEnvironment* environment = instr->environment(); |
| 807 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 807 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
| 808 DCHECK(environment->HasBeenRegistered()); | 808 DCHECK(environment->HasBeenRegistered()); |
| 809 int id = environment->deoptimization_index(); | 809 int id = environment->deoptimization_index(); |
| 810 DCHECK(info()->IsOptimizing() || info()->IsStub()); | |
| 811 Address entry = | 810 Address entry = |
| 812 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); | 811 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
| 813 if (entry == NULL) { | 812 if (entry == NULL) { |
| 814 Abort(kBailoutWasNotPrepared); | 813 Abort(kBailoutWasNotPrepared); |
| 815 return; | 814 return; |
| 816 } | 815 } |
| 817 | 816 |
| 818 if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { | 817 if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { |
| 819 Register scratch = scratch0(); | 818 Register scratch = scratch0(); |
| 820 ExternalReference count = ExternalReference::stress_deopt_count(isolate()); | 819 ExternalReference count = ExternalReference::stress_deopt_count(isolate()); |
| (...skipping 4769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5590 __ cmp(temp2, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 5589 __ cmp(temp2, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 5591 __ ldr(temp1, MemOperand(temp1, StandardFrameConstants::kCallerFPOffset), eq); | 5590 __ ldr(temp1, MemOperand(temp1, StandardFrameConstants::kCallerFPOffset), eq); |
| 5592 | 5591 |
| 5593 // Check the marker in the calling frame. | 5592 // Check the marker in the calling frame. |
| 5594 __ ldr(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset)); | 5593 __ ldr(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset)); |
| 5595 __ cmp(temp1, Operand(Smi::FromInt(StackFrame::CONSTRUCT))); | 5594 __ cmp(temp1, Operand(Smi::FromInt(StackFrame::CONSTRUCT))); |
| 5596 } | 5595 } |
| 5597 | 5596 |
| 5598 | 5597 |
| 5599 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 5598 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
| 5600 if (!info()->IsStub()) { | 5599 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
| 5601 // Ensure that we have enough space after the previous lazy-bailout | 5600 // Ensure that we have enough space after the previous lazy-bailout |
| 5602 // instruction for patching the code here. | 5601 // instruction for patching the code here. |
| 5603 int current_pc = masm()->pc_offset(); | 5602 int current_pc = masm()->pc_offset(); |
| 5604 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 5603 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
| 5605 // Block literal pool emission for duration of padding. | 5604 // Block literal pool emission for duration of padding. |
| 5606 Assembler::BlockConstPoolScope block_const_pool(masm()); | 5605 Assembler::BlockConstPoolScope block_const_pool(masm()); |
| 5607 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 5606 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 5608 DCHECK_EQ(0, padding_size % Assembler::kInstrSize); | 5607 DCHECK_EQ(0, padding_size % Assembler::kInstrSize); |
| 5609 while (padding_size > 0) { | 5608 while (padding_size > 0) { |
| 5610 __ nop(); | 5609 __ nop(); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5873 __ push(ToRegister(instr->function())); | 5872 __ push(ToRegister(instr->function())); |
| 5874 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5873 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5875 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5874 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5876 } | 5875 } |
| 5877 | 5876 |
| 5878 | 5877 |
| 5879 #undef __ | 5878 #undef __ |
| 5880 | 5879 |
| 5881 } // namespace internal | 5880 } // namespace internal |
| 5882 } // namespace v8 | 5881 } // namespace v8 |
| OLD | NEW |