Remove kOsrCompileFailed bailout.
authortitzer <titzer@chromium.org>
Mon, 27 Apr 2015 14:24:49 +0000 (07:24 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 27 Apr 2015 14:24:28 +0000 (14:24 +0000)
R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1105133002

Cr-Commit-Position: refs/heads/master@{#28083}

src/bailout-reason.h
src/compiler.cc
src/compiler/osr.cc
src/compiler/osr.h
src/compiler/pipeline.cc

index 09c889f..2e02808 100644 (file)
@@ -323,7 +323,6 @@ namespace internal {
     "Wrong address or value passed to RecordWrite")                            \
   V(kShouldNotDirectlyEnterOsrFunction,                                        \
     "Should not directly enter OSR-compiled function")                         \
-  V(kOsrCompileFailed, "OSR compilation failed")                               \
   V(kYield, "Yield")
 
 
index a803d32..f44f092 100644 (file)
@@ -357,7 +357,7 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
     return AbortOptimization(kHydrogenFilter);
   }
 
-  // Crankshaft requires a version of fullcode with deoptimization support.
+  // 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
@@ -378,9 +378,10 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
 
   DCHECK(info()->shared_info()->has_deoptimization_support());
 
-  // Check the whitelist for TurboFan.
-  if ((FLAG_turbo_asm && info()->shared_info()->asm_function()) ||
-      info()->closure()->PassesFilter(FLAG_turbo_filter)) {
+  // Check the enabling conditions for TurboFan.
+  if (((FLAG_turbo_asm && info()->shared_info()->asm_function()) ||
+       info()->closure()->PassesFilter(FLAG_turbo_filter)) &&
+      (FLAG_turbo_osr || !info()->is_osr())) {
     if (FLAG_trace_opt) {
       OFStream os(stdout);
       os << "[compiling method " << Brief(*info()->closure())
index 2ab5d73..a603ce9 100644 (file)
@@ -285,7 +285,7 @@ static void TransferOsrValueTypesFromLoopPhis(Zone* zone, Node* osr_loop_entry,
 }
 
 
-bool OsrHelper::Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common,
+void OsrHelper::Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common,
                             Zone* tmp_zone) {
   Graph* graph = jsgraph->graph();
   Node* osr_normal_entry = nullptr;
@@ -303,7 +303,7 @@ bool OsrHelper::Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common,
   if (osr_loop_entry == nullptr) {
     // No OSR entry found, do nothing.
     CHECK(osr_normal_entry);
-    return true;
+    return;
   }
 
   for (Node* use : osr_loop_entry->uses()) {
@@ -345,8 +345,6 @@ bool OsrHelper::Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common,
   // Run the normal control reduction, which naturally trims away the dead
   // parts of the graph.
   ControlReducer::ReduceGraph(tmp_zone, jsgraph, common);
-
-  return true;
 }
 
 
index 549bb5f..89773f0 100644 (file)
@@ -99,8 +99,7 @@ class OsrHelper {
 
   // Deconstructs the artificial {OsrNormalEntry} and rewrites the graph so
   // that only the path corresponding to {OsrLoopEntry} remains.
-  // Return {false} if the OSR deconstruction failed somehow.
-  bool Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common,
+  void Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common,
                    Zone* tmp_zone);
 
   // Prepares the frame w.r.t. OSR.
index cb616fb..f6a5c05 100644 (file)
@@ -524,9 +524,7 @@ struct OsrDeconstructionPhase {
     SourcePositionTable::Scope pos(data->source_positions(),
                                    SourcePosition::Unknown());
     OsrHelper osr_helper(data->info());
-    bool success =
-        osr_helper.Deconstruct(data->jsgraph(), data->common(), temp_zone);
-    if (!success) data->info()->RetryOptimization(kOsrCompileFailed);
+    osr_helper.Deconstruct(data->jsgraph(), data->common(), temp_zone);
   }
 };
 
@@ -919,12 +917,6 @@ void Pipeline::RunPrintAndVerify(const char* phase, bool untyped) {
 
 
 Handle<Code> Pipeline::GenerateCode() {
-  if (info()->is_osr() && !FLAG_turbo_osr) {
-    // TODO(turbofan): remove this flag and always handle OSR
-    info()->RetryOptimization(kOsrCompileFailed);
-    return Handle<Code>::null();
-  }
-
   // TODO(mstarzinger): This is just a temporary hack to make TurboFan work,
   // the correct solution is to restore the context register after invoking
   // builtins from full-codegen.
@@ -1046,7 +1038,6 @@ Handle<Code> Pipeline::GenerateCode() {
 
     if (info()->is_osr()) {
       Run<OsrDeconstructionPhase>();
-      if (info()->bailout_reason() != kNoReason) return Handle<Code>::null();
       RunPrintAndVerify("OSR deconstruction");
     }