| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/base/bits.h" | 5 #include "src/base/bits.h" |
| 6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/cpu-profiler.h" | 8 #include "src/cpu-profiler.h" |
| 9 #include "src/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
| 10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 | 743 |
| 744 | 744 |
| 745 void LCodeGen::DeoptimizeIf(Condition cond, LInstruction* instr, | 745 void LCodeGen::DeoptimizeIf(Condition cond, LInstruction* instr, |
| 746 Deoptimizer::DeoptReason deopt_reason, | 746 Deoptimizer::DeoptReason deopt_reason, |
| 747 Deoptimizer::BailoutType bailout_type, | 747 Deoptimizer::BailoutType bailout_type, |
| 748 CRegister cr) { | 748 CRegister cr) { |
| 749 LEnvironment* environment = instr->environment(); | 749 LEnvironment* environment = instr->environment(); |
| 750 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 750 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
| 751 DCHECK(environment->HasBeenRegistered()); | 751 DCHECK(environment->HasBeenRegistered()); |
| 752 int id = environment->deoptimization_index(); | 752 int id = environment->deoptimization_index(); |
| 753 DCHECK(info()->IsOptimizing() || info()->IsStub()); | |
| 754 Address entry = | 753 Address entry = |
| 755 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); | 754 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
| 756 if (entry == NULL) { | 755 if (entry == NULL) { |
| 757 Abort(kBailoutWasNotPrepared); | 756 Abort(kBailoutWasNotPrepared); |
| 758 return; | 757 return; |
| 759 } | 758 } |
| 760 | 759 |
| 761 if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { | 760 if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { |
| 762 CRegister alt_cr = cr6; | 761 CRegister alt_cr = cr6; |
| 763 Register scratch = scratch0(); | 762 Register scratch = scratch0(); |
| (...skipping 5122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5886 __ LoadP(temp1, MemOperand(temp1, StandardFrameConstants::kCallerFPOffset)); | 5885 __ LoadP(temp1, MemOperand(temp1, StandardFrameConstants::kCallerFPOffset)); |
| 5887 | 5886 |
| 5888 // Check the marker in the calling frame. | 5887 // Check the marker in the calling frame. |
| 5889 __ bind(&check_frame_marker); | 5888 __ bind(&check_frame_marker); |
| 5890 __ LoadP(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset)); | 5889 __ LoadP(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset)); |
| 5891 __ CmpSmiLiteral(temp1, Smi::FromInt(StackFrame::CONSTRUCT), r0); | 5890 __ CmpSmiLiteral(temp1, Smi::FromInt(StackFrame::CONSTRUCT), r0); |
| 5892 } | 5891 } |
| 5893 | 5892 |
| 5894 | 5893 |
| 5895 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 5894 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
| 5896 if (!info()->IsStub()) { | 5895 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
| 5897 // Ensure that we have enough space after the previous lazy-bailout | 5896 // Ensure that we have enough space after the previous lazy-bailout |
| 5898 // instruction for patching the code here. | 5897 // instruction for patching the code here. |
| 5899 int current_pc = masm()->pc_offset(); | 5898 int current_pc = masm()->pc_offset(); |
| 5900 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 5899 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
| 5901 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 5900 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 5902 DCHECK_EQ(0, padding_size % Assembler::kInstrSize); | 5901 DCHECK_EQ(0, padding_size % Assembler::kInstrSize); |
| 5903 while (padding_size > 0) { | 5902 while (padding_size > 0) { |
| 5904 __ nop(); | 5903 __ nop(); |
| 5905 padding_size -= Assembler::kInstrSize; | 5904 padding_size -= Assembler::kInstrSize; |
| 5906 } | 5905 } |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6157 __ Push(scope_info); | 6156 __ Push(scope_info); |
| 6158 __ push(ToRegister(instr->function())); | 6157 __ push(ToRegister(instr->function())); |
| 6159 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6158 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6160 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6159 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6161 } | 6160 } |
| 6162 | 6161 |
| 6163 | 6162 |
| 6164 #undef __ | 6163 #undef __ |
| 6165 } // namespace internal | 6164 } // namespace internal |
| 6166 } // namespace v8 | 6165 } // namespace v8 |
| OLD | NEW |