| 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/code-factory.h" | 5 #include "src/code-factory.h" |
| 6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
| 7 #include "src/cpu-profiler.h" | 7 #include "src/cpu-profiler.h" |
| 8 #include "src/hydrogen-osr.h" | 8 #include "src/hydrogen-osr.h" |
| 9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
| 10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 | 765 |
| 766 | 766 |
| 767 void LCodeGen::DeoptimizeIf(Condition condition, LInstruction* instr, | 767 void LCodeGen::DeoptimizeIf(Condition condition, LInstruction* instr, |
| 768 Deoptimizer::DeoptReason deopt_reason, | 768 Deoptimizer::DeoptReason deopt_reason, |
| 769 Deoptimizer::BailoutType bailout_type, | 769 Deoptimizer::BailoutType bailout_type, |
| 770 Register src1, const Operand& src2) { | 770 Register src1, const Operand& src2) { |
| 771 LEnvironment* environment = instr->environment(); | 771 LEnvironment* environment = instr->environment(); |
| 772 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 772 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
| 773 DCHECK(environment->HasBeenRegistered()); | 773 DCHECK(environment->HasBeenRegistered()); |
| 774 int id = environment->deoptimization_index(); | 774 int id = environment->deoptimization_index(); |
| 775 DCHECK(info()->IsOptimizing() || info()->IsStub()); | |
| 776 Address entry = | 775 Address entry = |
| 777 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); | 776 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
| 778 if (entry == NULL) { | 777 if (entry == NULL) { |
| 779 Abort(kBailoutWasNotPrepared); | 778 Abort(kBailoutWasNotPrepared); |
| 780 return; | 779 return; |
| 781 } | 780 } |
| 782 | 781 |
| 783 if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { | 782 if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { |
| 784 Register scratch = scratch0(); | 783 Register scratch = scratch0(); |
| 785 ExternalReference count = ExternalReference::stress_deopt_count(isolate()); | 784 ExternalReference count = ExternalReference::stress_deopt_count(isolate()); |
| (...skipping 5050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5836 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 5835 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 5837 __ ld(temp1, MemOperand(temp1, StandardFrameConstants::kCallerFPOffset)); | 5836 __ ld(temp1, MemOperand(temp1, StandardFrameConstants::kCallerFPOffset)); |
| 5838 | 5837 |
| 5839 // Check the marker in the calling frame. | 5838 // Check the marker in the calling frame. |
| 5840 __ bind(&check_frame_marker); | 5839 __ bind(&check_frame_marker); |
| 5841 __ ld(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset)); | 5840 __ ld(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset)); |
| 5842 } | 5841 } |
| 5843 | 5842 |
| 5844 | 5843 |
| 5845 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 5844 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
| 5846 if (!info()->IsStub()) { | 5845 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
| 5847 // Ensure that we have enough space after the previous lazy-bailout | 5846 // Ensure that we have enough space after the previous lazy-bailout |
| 5848 // instruction for patching the code here. | 5847 // instruction for patching the code here. |
| 5849 int current_pc = masm()->pc_offset(); | 5848 int current_pc = masm()->pc_offset(); |
| 5850 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 5849 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
| 5851 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 5850 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 5852 DCHECK_EQ(0, padding_size % Assembler::kInstrSize); | 5851 DCHECK_EQ(0, padding_size % Assembler::kInstrSize); |
| 5853 while (padding_size > 0) { | 5852 while (padding_size > 0) { |
| 5854 __ nop(); | 5853 __ nop(); |
| 5855 padding_size -= Assembler::kInstrSize; | 5854 padding_size -= Assembler::kInstrSize; |
| 5856 } | 5855 } |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6114 __ Push(at, ToRegister(instr->function())); | 6113 __ Push(at, ToRegister(instr->function())); |
| 6115 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6114 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6116 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6115 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6117 } | 6116 } |
| 6118 | 6117 |
| 6119 | 6118 |
| 6120 #undef __ | 6119 #undef __ |
| 6121 | 6120 |
| 6122 } // namespace internal | 6121 } // namespace internal |
| 6123 } // namespace v8 | 6122 } // namespace v8 |
| OLD | NEW |