Correct bailout from TurboFan for unsupported targets.
authormstarzinger@chromium.org <mstarzinger@chromium.org>
Thu, 25 Sep 2014 15:26:03 +0000 (15:26 +0000)
committermstarzinger@chromium.org <mstarzinger@chromium.org>
Thu, 25 Sep 2014 15:26:03 +0000 (15:26 +0000)
R=titzer@chromium.org
TEST=mjsunit/asm/math-fround

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/compiler/pipeline.cc

index 4882d0b..87a5370 100644 (file)
@@ -241,6 +241,9 @@ Handle<Code> Pipeline::GenerateCode() {
     GraphReplayPrinter::PrintReplay(&graph);
   }
 
+  // Bailout here in case target architecture is not supported.
+  if (!SupportedTarget()) return Handle<Code>::null();
+
   if (info()->is_typing_enabled()) {
     {
       // Type the graph.
@@ -298,36 +301,34 @@ Handle<Code> Pipeline::GenerateCode() {
     }
   }
 
-  Handle<Code> code = Handle<Code>::null();
-  if (SupportedTarget()) {
-    {
-      // Lower any remaining generic JSOperators.
-      PhaseStats lowering_stats(info(), PhaseStats::CREATE_GRAPH,
-                                "generic lowering");
-      SourcePositionTable::Scope pos(&source_positions,
-                                     SourcePosition::Unknown());
-      JSGenericLowering lowering(info(), &jsgraph);
-      GraphReducer graph_reducer(&graph);
-      graph_reducer.AddReducer(&lowering);
-      graph_reducer.ReduceGraph();
-
-      VerifyAndPrintGraph(&graph, "Lowered generic");
-    }
+  {
+    // Lower any remaining generic JSOperators.
+    PhaseStats lowering_stats(info(), PhaseStats::CREATE_GRAPH,
+                              "generic lowering");
+    SourcePositionTable::Scope pos(&source_positions,
+                                   SourcePosition::Unknown());
+    JSGenericLowering lowering(info(), &jsgraph);
+    GraphReducer graph_reducer(&graph);
+    graph_reducer.AddReducer(&lowering);
+    graph_reducer.ReduceGraph();
 
-    {
-      // Compute a schedule.
-      Schedule* schedule = ComputeSchedule(&graph);
-      // Generate optimized code.
-      PhaseStats codegen_stats(info(), PhaseStats::CODEGEN, "codegen");
-      Linkage linkage(info());
-      code = GenerateCode(&linkage, &graph, schedule, &source_positions);
-      info()->SetCode(code);
-    }
+    VerifyAndPrintGraph(&graph, "Lowered generic");
+  }
 
-    // Print optimized code.
-    v8::internal::CodeGenerator::PrintCode(code, info());
+  Handle<Code> code = Handle<Code>::null();
+  {
+    // Compute a schedule.
+    Schedule* schedule = ComputeSchedule(&graph);
+    // Generate optimized code.
+    PhaseStats codegen_stats(info(), PhaseStats::CODEGEN, "codegen");
+    Linkage linkage(info());
+    code = GenerateCode(&linkage, &graph, schedule, &source_positions);
+    info()->SetCode(code);
   }
 
+  // Print optimized code.
+  v8::internal::CodeGenerator::PrintCode(code, info());
+
   if (FLAG_trace_turbo) {
     OFStream os(stdout);
     os << "--------------------------------------------------\n"