| Index: src/a64/lithium-codegen-a64.cc
|
| diff --git a/src/a64/lithium-codegen-a64.cc b/src/a64/lithium-codegen-a64.cc
|
| index 8f32806a3417adfe282d983a7a61fda6cd70ad86..71baee7fd0776ccd0bdc255369c7ec4f7aab4b8b 100644
|
| --- a/src/a64/lithium-codegen-a64.cc
|
| +++ b/src/a64/lithium-codegen-a64.cc
|
| @@ -966,19 +966,22 @@ void LCodeGen::PopulateDeoptimizationLiteralsWithInlinedFunctions() {
|
| }
|
|
|
|
|
| -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()) {
|
| @@ -1002,14 +1005,12 @@ bool LCodeGen::DeoptimizeHeader(LEnvironment* environment) {
|
| __ 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();
|
| @@ -1042,32 +1043,34 @@ void LCodeGen::Deoptimize(LEnvironment* environment,
|
|
|
|
|
| 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);
|
| }
|
|
|
| @@ -1075,16 +1078,18 @@ void LCodeGen::DeoptimizeIfNegative(Register rt, LEnvironment* environment) {
|
| 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);
|
| }
|
|
|
| @@ -1093,8 +1098,9 @@ void LCodeGen::DeoptimizeIfRoot(Register rt,
|
| 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);
|
| }
|
|
|
| @@ -1103,8 +1109,9 @@ void LCodeGen::DeoptimizeIfNotRoot(Register rt,
|
| 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);
|
| }
|
|
|
| @@ -2555,6 +2562,7 @@ void LCodeGen::DoDeoptimize(LDeoptimize* instr) {
|
| }
|
|
|
| Comment(";;; deoptimize: %s", instr->hydrogen()->reason());
|
| + DeoptimizeHeader(instr->environment(), &type);
|
| Deoptimize(instr->environment(), type);
|
| }
|
|
|
|
|