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

Unified Diff: src/a64/lithium-codegen-a64.cc

Issue 151523007: A64: Move some deoptimization logic into a separate function (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/a64/lithium-codegen-a64.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()) {
« no previous file with comments | « src/a64/lithium-codegen-a64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698