Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 1310283005: Use ShouldEnsureSpaceForLazyDeopt more. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ppc/lithium-codegen-ppc.cc ('k') | src/x87/lithium-codegen-x87.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 } 736 }
737 737
738 738
739 void LCodeGen::DeoptimizeIf(Condition cc, LInstruction* instr, 739 void LCodeGen::DeoptimizeIf(Condition cc, LInstruction* instr,
740 Deoptimizer::DeoptReason deopt_reason, 740 Deoptimizer::DeoptReason deopt_reason,
741 Deoptimizer::BailoutType bailout_type) { 741 Deoptimizer::BailoutType bailout_type) {
742 LEnvironment* environment = instr->environment(); 742 LEnvironment* environment = instr->environment();
743 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 743 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
744 DCHECK(environment->HasBeenRegistered()); 744 DCHECK(environment->HasBeenRegistered());
745 int id = environment->deoptimization_index(); 745 int id = environment->deoptimization_index();
746 DCHECK(info()->IsOptimizing() || info()->IsStub());
747 Address entry = 746 Address entry =
748 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); 747 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type);
749 if (entry == NULL) { 748 if (entry == NULL) {
750 Abort(kBailoutWasNotPrepared); 749 Abort(kBailoutWasNotPrepared);
751 return; 750 return;
752 } 751 }
753 752
754 if (DeoptEveryNTimes()) { 753 if (DeoptEveryNTimes()) {
755 ExternalReference count = ExternalReference::stress_deopt_count(isolate()); 754 ExternalReference count = ExternalReference::stress_deopt_count(isolate());
756 Label no_deopt; 755 Label no_deopt;
(...skipping 4913 matching lines...) Expand 10 before | Expand all | Expand 10 after
5670 __ movp(temp, Operand(temp, StandardFrameConstants::kCallerFPOffset)); 5669 __ movp(temp, Operand(temp, StandardFrameConstants::kCallerFPOffset));
5671 5670
5672 // Check the marker in the calling frame. 5671 // Check the marker in the calling frame.
5673 __ bind(&check_frame_marker); 5672 __ bind(&check_frame_marker);
5674 __ Cmp(Operand(temp, StandardFrameConstants::kMarkerOffset), 5673 __ Cmp(Operand(temp, StandardFrameConstants::kMarkerOffset),
5675 Smi::FromInt(StackFrame::CONSTRUCT)); 5674 Smi::FromInt(StackFrame::CONSTRUCT));
5676 } 5675 }
5677 5676
5678 5677
5679 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { 5678 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) {
5680 if (!info()->IsStub()) { 5679 if (info()->ShouldEnsureSpaceForLazyDeopt()) {
5681 // Ensure that we have enough space after the previous lazy-bailout 5680 // Ensure that we have enough space after the previous lazy-bailout
5682 // instruction for patching the code here. 5681 // instruction for patching the code here.
5683 int current_pc = masm()->pc_offset(); 5682 int current_pc = masm()->pc_offset();
5684 if (current_pc < last_lazy_deopt_pc_ + space_needed) { 5683 if (current_pc < last_lazy_deopt_pc_ + space_needed) {
5685 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 5684 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
5686 __ Nop(padding_size); 5685 __ Nop(padding_size);
5687 } 5686 }
5688 } 5687 }
5689 last_lazy_deopt_pc_ = masm()->pc_offset(); 5688 last_lazy_deopt_pc_ = masm()->pc_offset();
5690 } 5689 }
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
5939 RecordSafepoint(Safepoint::kNoLazyDeopt); 5938 RecordSafepoint(Safepoint::kNoLazyDeopt);
5940 } 5939 }
5941 5940
5942 5941
5943 #undef __ 5942 #undef __
5944 5943
5945 } // namespace internal 5944 } // namespace internal
5946 } // namespace v8 5945 } // namespace v8
5947 5946
5948 #endif // V8_TARGET_ARCH_X64 5947 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ppc/lithium-codegen-ppc.cc ('k') | src/x87/lithium-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698