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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1883403002: [compiler] Move ensuring deoptimization support to backends. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 4 years, 8 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/compiler/pipeline.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index 3d314d0e1e1a040ec5b1bce75278e75d0ae2ba6e..6bc9ff4a19b0a5193685061fc2ffcca42dc1be00 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -114,6 +114,27 @@ class HOptimizedGraphBuilderWithPositions : public HOptimizedGraphBuilder {
HCompilationJob::Status HCompilationJob::CreateGraphImpl() {
bool dont_crankshaft = info()->shared_info()->dont_crankshaft();
+ // Optimization requires a version of fullcode with deoptimization support.
+ // Recompile the unoptimized version of the code if the current version
+ // doesn't have deoptimization support already.
+ // Otherwise, if we are gathering compilation time and space statistics
+ // for hydrogen, gather baseline statistics for a fullcode compilation.
+ bool should_recompile = !info()->shared_info()->has_deoptimization_support();
+ if (should_recompile || FLAG_hydrogen_stats) {
+ base::ElapsedTimer timer;
+ if (FLAG_hydrogen_stats) {
+ timer.Start();
+ }
+ if (!Compiler::EnsureDeoptimizationSupport(info())) {
+ return FAILED;
+ }
+ if (FLAG_hydrogen_stats) {
+ isolate()->GetHStatistics()->IncrementFullCodeGen(timer.Elapsed());
+ }
+ }
+ DCHECK(info()->shared_info()->has_deoptimization_support());
+ DCHECK(!info()->shared_info()->never_compiled());
+
if (!isolate()->use_crankshaft() || dont_crankshaft) {
// Crankshaft is entirely disabled.
return FAILED;
« no previous file with comments | « src/compiler/pipeline.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698