Chromium Code Reviews| Index: src/a64/lithium-codegen-a64.cc |
| diff --git a/src/a64/lithium-codegen-a64.cc b/src/a64/lithium-codegen-a64.cc |
| index cf697bf771f0e607f83eea1f0947769f3108cdfb..3f1fccd02425e77e9eea7a656459aa6b9d8a1005 100644 |
| --- a/src/a64/lithium-codegen-a64.cc |
| +++ b/src/a64/lithium-codegen-a64.cc |
| @@ -943,18 +943,19 @@ void LCodeGen::PopulateDeoptimizationLiteralsWithInlinedFunctions() { |
| } |
| -void LCodeGen::Deoptimize(LEnvironment* environment, |
| - Deoptimizer::BailoutType bailout_type) { |
| +bool LCodeGen::DeoptimizeHeader(LEnvironment* environment) { |
| 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; |
| Address entry = |
| Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
| if (entry == NULL) { |
| Abort(kBailoutWasNotPrepared); |
| - return; |
| + return false; |
| } |
| ASSERT(FLAG_deopt_every_n_times < 2); // Other values not supported on A64. |
| @@ -964,14 +965,28 @@ void LCodeGen::Deoptimize(LEnvironment* environment, |
| info()->opt_count() == id) { |
| ASSERT(frame_is_built_); |
| __ Call(entry, RelocInfo::RUNTIME_ENTRY); |
| - return; |
| + return false; |
| } |
| + return true; |
| +} |
| + |
| + |
| +void LCodeGen::Deoptimize(LEnvironment* environment, |
| + Deoptimizer::BailoutType bailout_type) { |
| + if (!DeoptimizeHeader(environment)) |
|
ulan
2014/02/10 14:22:46
V8 style nit: either put "return" in the same line
|
| + return; |
| + |
| + ASSERT(environment->HasBeenRegistered()); |
| + ASSERT(info()->IsOptimizing() || info()->IsStub()); |
| + int id = environment->deoptimization_index(); |
| + Address entry = |
| + Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
| + |
| if (info()->ShouldTrapOnDeopt()) { |
| __ Debug("trap_on_deopt", __LINE__, BREAK); |
| } |
| - |
| ASSERT(info()->IsStub() || frame_is_built_); |
| // Go through jump table if we need to build frame, or restore caller doubles. |
| if (frame_is_built_ && !info()->saves_caller_doubles()) { |