Revision: 19242
Author: [email protected]
Date: Mon Feb 10 19:48:20 2014 UTC
Log: A64: Hook up --deopt-every-n-times to all Deoptimize methods
BUG=none
[email protected], [email protected]
LOG=n
Review URL: https://codereview.chromium.org/157803008
http://code.google.com/p/v8/source/detail?r=19242
Modified:
/branches/experimental/a64/src/a64/lithium-codegen-a64.cc
/branches/experimental/a64/src/a64/lithium-codegen-a64.h
=======================================
--- /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Mon Feb 10
17:18:24 2014 UTC
+++ /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Mon Feb 10
19:48:20 2014 UTC
@@ -959,19 +959,22 @@
}
-bool LCodeGen::DeoptimizeHeader(LEnvironment* environment) {
+Deoptimizer::BailoutType LCodeGen::DeoptimizeHeader(
+ LEnvironment* environment,
+ Deoptimizer::BailoutType* override_bailout_type) {
RegisterEnvironmentForDeoptimization(environment,
Safepoint::kNoLazyDeopt);
ASSERT(environment->HasBeenRegistered());
ASSERT(info()->IsOptimizing() || info()->IsStub());
int id = environment->deoptimization_index();
- Deoptimizer::BailoutType bailout_type = info()->IsStub() ?
Deoptimizer::LAZY
- :
Deoptimizer::EAGER;
+ Deoptimizer::BailoutType bailout_type =
+ info()->IsStub() ? Deoptimizer::LAZY : Deoptimizer::EAGER;
+ if (override_bailout_type) bailout_type = *override_bailout_type;
Address entry =
Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type);
if (entry == NULL) {
Abort(kBailoutWasNotPrepared);
- return false;
+ return bailout_type;
}
if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) {
@@ -995,14 +998,12 @@
__ Pop(x0, x1);
}
- return true;
+ return bailout_type;
}
void LCodeGen::Deoptimize(LEnvironment* environment,
Deoptimizer::BailoutType bailout_type) {
- if (!DeoptimizeHeader(environment)) return;
-
ASSERT(environment->HasBeenRegistered());
ASSERT(info()->IsOptimizing() || info()->IsStub());
int id = environment->deoptimization_index();
@@ -1035,32 +1036,34 @@
void LCodeGen::Deoptimize(LEnvironment* environment) {
- Deoptimizer::BailoutType bailout_type = info()->IsStub() ?
Deoptimizer::LAZY
- :
Deoptimizer::EAGER;
+ Deoptimizer::BailoutType bailout_type = DeoptimizeHeader(environment,
NULL);
Deoptimize(environment, bailout_type);
}
void LCodeGen::DeoptimizeIf(Condition cond, LEnvironment* environment) {
Label dont_deopt;
+ Deoptimizer::BailoutType bailout_type = DeoptimizeHeader(environment,
NULL);
__ B(InvertCondition(cond), &dont_deopt);
- Deoptimize(environment);
+ Deoptimize(environment, bailout_type);
__ Bind(&dont_deopt);
}
void LCodeGen::DeoptimizeIfZero(Register rt, LEnvironment* environment) {
Label dont_deopt;
+ Deoptimizer::BailoutType bailout_type = DeoptimizeHeader(environment,
NULL);
__ Cbnz(rt, &dont_deopt);
- Deoptimize(environment);
+ Deoptimize(environment, bailout_type);
__ Bind(&dont_deopt);
}
void LCodeGen::DeoptimizeIfNegative(Register rt, LEnvironment*
environment) {
Label dont_deopt;
+ Deoptimizer::BailoutType bailout_type = DeoptimizeHeader(environment,
NULL);
__ Tbz(rt, rt.Is64Bits() ? kXSignBit : kWSignBit, &dont_deopt);
- Deoptimize(environment);
+ Deoptimize(environment, bailout_type);
__ Bind(&dont_deopt);
}
@@ -1068,16 +1071,18 @@
void LCodeGen::DeoptimizeIfSmi(Register rt,
LEnvironment* environment) {
Label dont_deopt;
+ Deoptimizer::BailoutType bailout_type = DeoptimizeHeader(environment,
NULL);
__ JumpIfNotSmi(rt, &dont_deopt);
- Deoptimize(environment);
+ Deoptimize(environment, bailout_type);
__ Bind(&dont_deopt);
}
void LCodeGen::DeoptimizeIfNotSmi(Register rt, LEnvironment* environment) {
Label dont_deopt;
+ Deoptimizer::BailoutType bailout_type = DeoptimizeHeader(environment,
NULL);
__ JumpIfSmi(rt, &dont_deopt);
- Deoptimize(environment);
+ Deoptimize(environment, bailout_type);
__ Bind(&dont_deopt);
}
@@ -1086,8 +1091,9 @@
Heap::RootListIndex index,
LEnvironment* environment) {
Label dont_deopt;
+ Deoptimizer::BailoutType bailout_type = DeoptimizeHeader(environment,
NULL);
__ JumpIfNotRoot(rt, index, &dont_deopt);
- Deoptimize(environment);
+ Deoptimize(environment, bailout_type);
__ Bind(&dont_deopt);
}
@@ -1096,8 +1102,9 @@
Heap::RootListIndex index,
LEnvironment* environment) {
Label dont_deopt;
+ Deoptimizer::BailoutType bailout_type = DeoptimizeHeader(environment,
NULL);
__ JumpIfRoot(rt, index, &dont_deopt);
- Deoptimize(environment);
+ Deoptimize(environment, bailout_type);
__ Bind(&dont_deopt);
}
@@ -2560,6 +2567,7 @@
}
Comment(";;; deoptimize: %s", instr->hydrogen()->reason());
+ DeoptimizeHeader(instr->environment(), &type);
Deoptimize(instr->environment(), type);
}
=======================================
--- /branches/experimental/a64/src/a64/lithium-codegen-a64.h Mon Feb 10
15:37:43 2014 UTC
+++ /branches/experimental/a64/src/a64/lithium-codegen-a64.h Mon Feb 10
19:48:20 2014 UTC
@@ -218,7 +218,9 @@
Register temp,
LOperand* index,
String::Encoding encoding);
- bool DeoptimizeHeader(LEnvironment* environment);
+ Deoptimizer::BailoutType DeoptimizeHeader(
+ LEnvironment* environment,
+ Deoptimizer::BailoutType* override_bailout_type);
void Deoptimize(LEnvironment* environment);
void Deoptimize(LEnvironment* environment,
Deoptimizer::BailoutType bailout_type);
--
--
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/groups/opt_out.