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

Side by Side Diff: src/arm/lithium-codegen-arm.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 | « no previous file | src/arm64/lithium-codegen-arm64.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 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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698