OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/wasm-compiler.h" | 5 #include "src/compiler/wasm-compiler.h" |
6 | 6 |
7 #include "src/isolate-inl.h" | 7 #include "src/isolate-inl.h" |
8 | 8 |
9 #include "src/base/platform/elapsed-timer.h" | 9 #include "src/base/platform/elapsed-timer.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 2512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2523 // Run the compilation pipeline. | 2523 // Run the compilation pipeline. |
2524 //---------------------------------------------------------------------------- | 2524 //---------------------------------------------------------------------------- |
2525 { | 2525 { |
2526 // Changes lowering requires types. | 2526 // Changes lowering requires types. |
2527 Typer typer(isolate, &graph); | 2527 Typer typer(isolate, &graph); |
2528 NodeVector roots(&zone); | 2528 NodeVector roots(&zone); |
2529 jsgraph.GetCachedNodes(&roots); | 2529 jsgraph.GetCachedNodes(&roots); |
2530 typer.Run(roots); | 2530 typer.Run(roots); |
2531 | 2531 |
2532 // Run generic and change lowering. | 2532 // Run generic and change lowering. |
2533 JSGenericLowering generic(true, &jsgraph); | 2533 JSGenericLowering generic(&jsgraph); |
2534 ChangeLowering changes(&jsgraph); | 2534 ChangeLowering changes(&jsgraph); |
2535 GraphReducer graph_reducer(&zone, &graph, jsgraph.Dead()); | 2535 GraphReducer graph_reducer(&zone, &graph, jsgraph.Dead()); |
2536 graph_reducer.AddReducer(&changes); | 2536 graph_reducer.AddReducer(&changes); |
2537 graph_reducer.AddReducer(&generic); | 2537 graph_reducer.AddReducer(&generic); |
2538 graph_reducer.ReduceGraph(); | 2538 graph_reducer.ReduceGraph(); |
2539 | 2539 |
2540 if (FLAG_trace_turbo_graph) { // Simple textual RPO. | 2540 if (FLAG_trace_turbo_graph) { // Simple textual RPO. |
2541 OFStream os(stdout); | 2541 OFStream os(stdout); |
2542 os << "-- Graph after change lowering -- " << std::endl; | 2542 os << "-- Graph after change lowering -- " << std::endl; |
2543 os << AsRPO(graph); | 2543 os << AsRPO(graph); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2613 | 2613 |
2614 Handle<Code> code = Handle<Code>::null(); | 2614 Handle<Code> code = Handle<Code>::null(); |
2615 { | 2615 { |
2616 // Changes lowering requires types. | 2616 // Changes lowering requires types. |
2617 Typer typer(isolate, &graph); | 2617 Typer typer(isolate, &graph); |
2618 NodeVector roots(&zone); | 2618 NodeVector roots(&zone); |
2619 jsgraph.GetCachedNodes(&roots); | 2619 jsgraph.GetCachedNodes(&roots); |
2620 typer.Run(roots); | 2620 typer.Run(roots); |
2621 | 2621 |
2622 // Run generic and change lowering. | 2622 // Run generic and change lowering. |
2623 JSGenericLowering generic(true, &jsgraph); | 2623 JSGenericLowering generic(&jsgraph); |
2624 ChangeLowering changes(&jsgraph); | 2624 ChangeLowering changes(&jsgraph); |
2625 GraphReducer graph_reducer(&zone, &graph, jsgraph.Dead()); | 2625 GraphReducer graph_reducer(&zone, &graph, jsgraph.Dead()); |
2626 graph_reducer.AddReducer(&changes); | 2626 graph_reducer.AddReducer(&changes); |
2627 graph_reducer.AddReducer(&generic); | 2627 graph_reducer.AddReducer(&generic); |
2628 graph_reducer.ReduceGraph(); | 2628 graph_reducer.ReduceGraph(); |
2629 | 2629 |
2630 if (FLAG_trace_turbo_graph) { // Simple textual RPO. | 2630 if (FLAG_trace_turbo_graph) { // Simple textual RPO. |
2631 OFStream os(stdout); | 2631 OFStream os(stdout); |
2632 os << "-- Graph after change lowering -- " << std::endl; | 2632 os << "-- Graph after change lowering -- " << std::endl; |
2633 os << AsRPO(graph); | 2633 os << AsRPO(graph); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2778 static_cast<int>(function.code_end_offset - function.code_start_offset), | 2778 static_cast<int>(function.code_end_offset - function.code_start_offset), |
2779 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); | 2779 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); |
2780 } | 2780 } |
2781 return code; | 2781 return code; |
2782 } | 2782 } |
2783 | 2783 |
2784 | 2784 |
2785 } // namespace compiler | 2785 } // namespace compiler |
2786 } // namespace internal | 2786 } // namespace internal |
2787 } // namespace v8 | 2787 } // namespace v8 |
OLD | NEW |