Reviewers: mcilroy,
Description:
Use ShouldEnsureSpaceForLazyDeopt more.
[email protected]
BUG=
Please review this at https://codereview.chromium.org/1310283005/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+12, -20 lines):
M src/arm/lithium-codegen-arm.cc
M src/arm64/lithium-codegen-arm64.cc
M src/ia32/lithium-codegen-ia32.cc
M src/mips/lithium-codegen-mips.cc
M src/mips64/lithium-codegen-mips64.cc
M src/ppc/lithium-codegen-ppc.cc
M src/x64/lithium-codegen-x64.cc
M src/x87/lithium-codegen-x87.cc
Index: src/arm/lithium-codegen-arm.cc
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
index
56418e5e9373ab697672aa947bf2758cfa1bfe3d..a519a56c73a4addcc8f1011d6e9ae8dc477cba95
100644
--- a/src/arm/lithium-codegen-arm.cc
+++ b/src/arm/lithium-codegen-arm.cc
@@ -807,7 +807,6 @@ void LCodeGen::DeoptimizeIf(Condition condition,
LInstruction* instr,
RegisterEnvironmentForDeoptimization(environment,
Safepoint::kNoLazyDeopt);
DCHECK(environment->HasBeenRegistered());
int id = environment->deoptimization_index();
- DCHECK(info()->IsOptimizing() || info()->IsStub());
Address entry =
Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type);
if (entry == NULL) {
@@ -5597,7 +5596,7 @@ void LCodeGen::EmitIsConstructCall(Register temp1,
Register temp2) {
void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) {
- if (!info()->IsStub()) {
+ if (info()->ShouldEnsureSpaceForLazyDeopt()) {
// Ensure that we have enough space after the previous lazy-bailout
// instruction for patching the code here.
int current_pc = masm()->pc_offset();
Index: src/arm64/lithium-codegen-arm64.cc
diff --git a/src/arm64/lithium-codegen-arm64.cc
b/src/arm64/lithium-codegen-arm64.cc
index
7cb6cb64bdd3b80ebb31a1be1b380891d7dc7039..b8f2e6935c9539e3af16590d9700c8ab258ae646
100644
--- a/src/arm64/lithium-codegen-arm64.cc
+++ b/src/arm64/lithium-codegen-arm64.cc
@@ -981,7 +981,6 @@ void LCodeGen::DeoptimizeBranch(
}
DCHECK(environment->HasBeenRegistered());
- DCHECK(info()->IsOptimizing() || info()->IsStub());
int id = environment->deoptimization_index();
Address entry =
Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type);
@@ -1132,7 +1131,7 @@ void LCodeGen::DeoptimizeIfBitClear(Register rt, int
bit, LInstruction* instr,
void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) {
- if (!info()->IsStub()) {
+ if (info()->ShouldEnsureSpaceForLazyDeopt()) {
// Ensure that we have enough space after the previous lazy-bailout
// instruction for patching the code here.
intptr_t current_pc = masm()->pc_offset();
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc
b/src/ia32/lithium-codegen-ia32.cc
index
38f3f2cf80b20646ab29df64e5311536ab5f04ba..c0e0208c513f5fecb77321ab19d363df592ab286
100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -76,7 +76,7 @@ void LCodeGen::FinishCode(Handle<Code> code) {
code->set_stack_slots(GetStackSlotCount());
code->set_safepoint_table_offset(safepoints_.GetCodeOffset());
PopulateDeoptimizationData(code);
- if (!info()->IsStub()) {
+ if (info()->ShouldEnsureSpaceForLazyDeopt()) {
Deoptimizer::EnsureRelocSpaceForLazyDeoptimization(code);
}
}
@@ -496,7 +496,7 @@ bool LCodeGen::GenerateDeferredCode() {
bool LCodeGen::GenerateSafepointTable() {
DCHECK(is_done());
- if (!info()->IsStub()) {
+ if (info()->ShouldEnsureSpaceForLazyDeopt()) {
// For lazy deoptimization we need space to patch a call after every
call.
// Ensure there is always space for such patching, even if the code
ends
// in a call.
@@ -825,7 +825,6 @@ void LCodeGen::DeoptimizeIf(Condition cc, LInstruction*
instr,
RegisterEnvironmentForDeoptimization(environment,
Safepoint::kNoLazyDeopt);
DCHECK(environment->HasBeenRegistered());
int id = environment->deoptimization_index();
- DCHECK(info()->IsOptimizing() || info()->IsStub());
Address entry =
Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type);
if (entry == NULL) {
@@ -5486,7 +5485,7 @@ void LCodeGen::EmitIsConstructCall(Register temp) {
void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) {
- if (!info()->IsStub()) {
+ if (info()->ShouldEnsureSpaceForLazyDeopt()) {
// Ensure that we have enough space after the previous lazy-bailout
// instruction for patching the code here.
int current_pc = masm()->pc_offset();
Index: src/mips/lithium-codegen-mips.cc
diff --git a/src/mips/lithium-codegen-mips.cc
b/src/mips/lithium-codegen-mips.cc
index
35ff38d6d5456785c0ae653507707d44dc055679..f9c5869fc3485fbfa23a7a273cfb1479376ab6a9
100644
--- a/src/mips/lithium-codegen-mips.cc
+++ b/src/mips/lithium-codegen-mips.cc
@@ -784,7 +784,6 @@ void LCodeGen::DeoptimizeIf(Condition condition,
LInstruction* instr,
RegisterEnvironmentForDeoptimization(environment,
Safepoint::kNoLazyDeopt);
DCHECK(environment->HasBeenRegistered());
int id = environment->deoptimization_index();
- DCHECK(info()->IsOptimizing() || info()->IsStub());
Address entry =
Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type);
if (entry == NULL) {
@@ -5655,7 +5654,7 @@ void LCodeGen::EmitIsConstructCall(Register temp1,
Register temp2) {
void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) {
- if (!info()->IsStub()) {
+ if (info()->ShouldEnsureSpaceForLazyDeopt()) {
// Ensure that we have enough space after the previous lazy-bailout
// instruction for patching the code here.
int current_pc = masm()->pc_offset();
Index: src/mips64/lithium-codegen-mips64.cc
diff --git a/src/mips64/lithium-codegen-mips64.cc
b/src/mips64/lithium-codegen-mips64.cc
index
d37e19287628e0ccf82f66de4adb19af410d5ec3..bfa6d9561c017490a6885bddb25d292730a7f896
100644
--- a/src/mips64/lithium-codegen-mips64.cc
+++ b/src/mips64/lithium-codegen-mips64.cc
@@ -772,7 +772,6 @@ void LCodeGen::DeoptimizeIf(Condition condition,
LInstruction* instr,
RegisterEnvironmentForDeoptimization(environment,
Safepoint::kNoLazyDeopt);
DCHECK(environment->HasBeenRegistered());
int id = environment->deoptimization_index();
- DCHECK(info()->IsOptimizing() || info()->IsStub());
Address entry =
Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type);
if (entry == NULL) {
@@ -5843,7 +5842,7 @@ void LCodeGen::EmitIsConstructCall(Register temp1,
Register temp2) {
void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) {
- if (!info()->IsStub()) {
+ if (info()->ShouldEnsureSpaceForLazyDeopt()) {
// Ensure that we have enough space after the previous lazy-bailout
// instruction for patching the code here.
int current_pc = masm()->pc_offset();
Index: src/ppc/lithium-codegen-ppc.cc
diff --git a/src/ppc/lithium-codegen-ppc.cc b/src/ppc/lithium-codegen-ppc.cc
index
c996eca42129ca52b166eb10ccd0d059fd57a131..a68033dd33570f18d62f0cc987515f67f80c27ac
100644
--- a/src/ppc/lithium-codegen-ppc.cc
+++ b/src/ppc/lithium-codegen-ppc.cc
@@ -750,7 +750,6 @@ void LCodeGen::DeoptimizeIf(Condition cond,
LInstruction* instr,
RegisterEnvironmentForDeoptimization(environment,
Safepoint::kNoLazyDeopt);
DCHECK(environment->HasBeenRegistered());
int id = environment->deoptimization_index();
- DCHECK(info()->IsOptimizing() || info()->IsStub());
Address entry =
Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type);
if (entry == NULL) {
@@ -5893,7 +5892,7 @@ void LCodeGen::EmitIsConstructCall(Register temp1,
Register temp2) {
void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) {
- if (!info()->IsStub()) {
+ if (info()->ShouldEnsureSpaceForLazyDeopt()) {
// Ensure that we have enough space after the previous lazy-bailout
// instruction for patching the code here.
int current_pc = masm()->pc_offset();
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index
3a98fcb18b901460715975b09b93b911dc981af8..37e05cae96a73bbe0de2443c8b2225eb09008bd2
100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -743,7 +743,6 @@ void LCodeGen::DeoptimizeIf(Condition cc, LInstruction*
instr,
RegisterEnvironmentForDeoptimization(environment,
Safepoint::kNoLazyDeopt);
DCHECK(environment->HasBeenRegistered());
int id = environment->deoptimization_index();
- DCHECK(info()->IsOptimizing() || info()->IsStub());
Address entry =
Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type);
if (entry == NULL) {
@@ -5677,7 +5676,7 @@ void LCodeGen::EmitIsConstructCall(Register temp) {
void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) {
- if (!info()->IsStub()) {
+ if (info()->ShouldEnsureSpaceForLazyDeopt()) {
// Ensure that we have enough space after the previous lazy-bailout
// instruction for patching the code here.
int current_pc = masm()->pc_offset();
Index: src/x87/lithium-codegen-x87.cc
diff --git a/src/x87/lithium-codegen-x87.cc b/src/x87/lithium-codegen-x87.cc
index
ef8ee0eaa140c2e016e6a46b9cdaf924f7895485..e5a66ace2b02e7254910d11589743882011b4e03
100644
--- a/src/x87/lithium-codegen-x87.cc
+++ b/src/x87/lithium-codegen-x87.cc
@@ -77,7 +77,7 @@ void LCodeGen::FinishCode(Handle<Code> code) {
code->set_stack_slots(GetStackSlotCount());
code->set_safepoint_table_offset(safepoints_.GetCodeOffset());
PopulateDeoptimizationData(code);
- if (!info()->IsStub()) {
+ if (info()->ShouldEnsureSpaceForLazyDeopt()) {
Deoptimizer::EnsureRelocSpaceForLazyDeoptimization(code);
}
}
@@ -497,7 +497,7 @@ bool LCodeGen::GenerateDeferredCode() {
bool LCodeGen::GenerateSafepointTable() {
DCHECK(is_done());
- if (!info()->IsStub()) {
+ if (info()->ShouldEnsureSpaceForLazyDeopt()) {
// For lazy deoptimization we need space to patch a call after every
call.
// Ensure there is always space for such patching, even if the code
ends
// in a call.
@@ -1093,7 +1093,6 @@ void LCodeGen::DeoptimizeIf(Condition cc,
LInstruction* instr,
RegisterEnvironmentForDeoptimization(environment,
Safepoint::kNoLazyDeopt);
DCHECK(environment->HasBeenRegistered());
int id = environment->deoptimization_index();
- DCHECK(info()->IsOptimizing() || info()->IsStub());
Address entry =
Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type);
if (entry == NULL) {
@@ -6096,7 +6095,7 @@ void LCodeGen::EmitIsConstructCall(Register temp) {
void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) {
- if (!info()->IsStub()) {
+ if (info()->ShouldEnsureSpaceForLazyDeopt()) {
// Ensure that we have enough space after the previous lazy-bailout
// instruction for patching the code here.
int current_pc = masm()->pc_offset();
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.