OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 | 777 |
778 | 778 |
779 void LCodeGen::DeoptimizeIf(Condition condition, LInstruction* instr, | 779 void LCodeGen::DeoptimizeIf(Condition condition, LInstruction* instr, |
780 Deoptimizer::DeoptReason deopt_reason, | 780 Deoptimizer::DeoptReason deopt_reason, |
781 Deoptimizer::BailoutType bailout_type, | 781 Deoptimizer::BailoutType bailout_type, |
782 Register src1, const Operand& src2) { | 782 Register src1, const Operand& src2) { |
783 LEnvironment* environment = instr->environment(); | 783 LEnvironment* environment = instr->environment(); |
784 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 784 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
785 DCHECK(environment->HasBeenRegistered()); | 785 DCHECK(environment->HasBeenRegistered()); |
786 int id = environment->deoptimization_index(); | 786 int id = environment->deoptimization_index(); |
787 DCHECK(info()->IsOptimizing() || info()->IsStub()); | |
788 Address entry = | 787 Address entry = |
789 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); | 788 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
790 if (entry == NULL) { | 789 if (entry == NULL) { |
791 Abort(kBailoutWasNotPrepared); | 790 Abort(kBailoutWasNotPrepared); |
792 return; | 791 return; |
793 } | 792 } |
794 | 793 |
795 if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { | 794 if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { |
796 Register scratch = scratch0(); | 795 Register scratch = scratch0(); |
797 ExternalReference count = ExternalReference::stress_deopt_count(isolate()); | 796 ExternalReference count = ExternalReference::stress_deopt_count(isolate()); |
(...skipping 4850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5648 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 5647 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
5649 __ lw(temp1, MemOperand(temp1, StandardFrameConstants::kCallerFPOffset)); | 5648 __ lw(temp1, MemOperand(temp1, StandardFrameConstants::kCallerFPOffset)); |
5650 | 5649 |
5651 // Check the marker in the calling frame. | 5650 // Check the marker in the calling frame. |
5652 __ bind(&check_frame_marker); | 5651 __ bind(&check_frame_marker); |
5653 __ lw(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset)); | 5652 __ lw(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset)); |
5654 } | 5653 } |
5655 | 5654 |
5656 | 5655 |
5657 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 5656 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
5658 if (!info()->IsStub()) { | 5657 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
5659 // Ensure that we have enough space after the previous lazy-bailout | 5658 // Ensure that we have enough space after the previous lazy-bailout |
5660 // instruction for patching the code here. | 5659 // instruction for patching the code here. |
5661 int current_pc = masm()->pc_offset(); | 5660 int current_pc = masm()->pc_offset(); |
5662 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 5661 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
5663 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 5662 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
5664 DCHECK_EQ(0, padding_size % Assembler::kInstrSize); | 5663 DCHECK_EQ(0, padding_size % Assembler::kInstrSize); |
5665 while (padding_size > 0) { | 5664 while (padding_size > 0) { |
5666 __ nop(); | 5665 __ nop(); |
5667 padding_size -= Assembler::kInstrSize; | 5666 padding_size -= Assembler::kInstrSize; |
5668 } | 5667 } |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5927 __ Push(at, ToRegister(instr->function())); | 5926 __ Push(at, ToRegister(instr->function())); |
5928 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5927 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5929 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5928 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5930 } | 5929 } |
5931 | 5930 |
5932 | 5931 |
5933 #undef __ | 5932 #undef __ |
5934 | 5933 |
5935 } // namespace internal | 5934 } // namespace internal |
5936 } // namespace v8 | 5935 } // namespace v8 |
OLD | NEW |