OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/pipeline.h" | 5 #include "src/compiler/pipeline.h" |
6 | 6 |
7 #include <fstream> // NOLINT(readability/streams) | 7 #include <fstream> // NOLINT(readability/streams) |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/base/adapters.h" | 10 #include "src/base/adapters.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "src/compiler/graph-trimmer.h" | 23 #include "src/compiler/graph-trimmer.h" |
24 #include "src/compiler/graph-visualizer.h" | 24 #include "src/compiler/graph-visualizer.h" |
25 #include "src/compiler/greedy-allocator.h" | 25 #include "src/compiler/greedy-allocator.h" |
26 #include "src/compiler/instruction.h" | 26 #include "src/compiler/instruction.h" |
27 #include "src/compiler/instruction-selector.h" | 27 #include "src/compiler/instruction-selector.h" |
28 #include "src/compiler/js-builtin-reducer.h" | 28 #include "src/compiler/js-builtin-reducer.h" |
29 #include "src/compiler/js-context-relaxation.h" | 29 #include "src/compiler/js-context-relaxation.h" |
30 #include "src/compiler/js-context-specialization.h" | 30 #include "src/compiler/js-context-specialization.h" |
31 #include "src/compiler/js-frame-specialization.h" | 31 #include "src/compiler/js-frame-specialization.h" |
32 #include "src/compiler/js-generic-lowering.h" | 32 #include "src/compiler/js-generic-lowering.h" |
| 33 #include "src/compiler/js-global-specialization.h" |
33 #include "src/compiler/js-inlining.h" | 34 #include "src/compiler/js-inlining.h" |
34 #include "src/compiler/js-intrinsic-lowering.h" | 35 #include "src/compiler/js-intrinsic-lowering.h" |
35 #include "src/compiler/js-type-feedback.h" | 36 #include "src/compiler/js-type-feedback.h" |
36 #include "src/compiler/js-type-feedback-lowering.h" | 37 #include "src/compiler/js-type-feedback-lowering.h" |
37 #include "src/compiler/js-typed-lowering.h" | 38 #include "src/compiler/js-typed-lowering.h" |
38 #include "src/compiler/jump-threading.h" | 39 #include "src/compiler/jump-threading.h" |
39 #include "src/compiler/live-range-separator.h" | 40 #include "src/compiler/live-range-separator.h" |
40 #include "src/compiler/load-elimination.h" | 41 #include "src/compiler/load-elimination.h" |
41 #include "src/compiler/loop-analysis.h" | 42 #include "src/compiler/loop-analysis.h" |
42 #include "src/compiler/loop-peeling.h" | 43 #include "src/compiler/loop-peeling.h" |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 data->common()); | 505 data->common()); |
505 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), | 506 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
506 data->common(), data->machine()); | 507 data->common(), data->machine()); |
507 JSContextSpecialization context_specialization( | 508 JSContextSpecialization context_specialization( |
508 &graph_reducer, data->jsgraph(), | 509 &graph_reducer, data->jsgraph(), |
509 data->info()->is_function_context_specializing() | 510 data->info()->is_function_context_specializing() |
510 ? data->info()->context() | 511 ? data->info()->context() |
511 : MaybeHandle<Context>()); | 512 : MaybeHandle<Context>()); |
512 JSFrameSpecialization frame_specialization(data->info()->osr_frame(), | 513 JSFrameSpecialization frame_specialization(data->info()->osr_frame(), |
513 data->jsgraph()); | 514 data->jsgraph()); |
| 515 JSGlobalSpecialization::Flags global_flags = |
| 516 JSGlobalSpecialization::kNoFlags; |
| 517 if (data->info()->is_deoptimization_enabled()) { |
| 518 global_flags |= JSGlobalSpecialization::kDeoptimizationEnabled; |
| 519 } |
| 520 if (data->info()->is_typing_enabled()) { |
| 521 global_flags |= JSGlobalSpecialization::kTypingEnabled; |
| 522 } |
| 523 JSGlobalSpecialization global_specialization( |
| 524 &graph_reducer, data->jsgraph(), global_flags, |
| 525 data->info()->has_global_object() |
| 526 ? handle(data->info()->global_object()) |
| 527 : Handle<GlobalObject>(), |
| 528 data->info()->dependencies()); |
514 JSInliner inliner(&graph_reducer, data->info()->is_inlining_enabled() | 529 JSInliner inliner(&graph_reducer, data->info()->is_inlining_enabled() |
515 ? JSInliner::kGeneralInlining | 530 ? JSInliner::kGeneralInlining |
516 : JSInliner::kRestrictedInlining, | 531 : JSInliner::kRestrictedInlining, |
517 temp_zone, data->info(), data->jsgraph()); | 532 temp_zone, data->info(), data->jsgraph()); |
518 AddReducer(data, &graph_reducer, &dead_code_elimination); | 533 AddReducer(data, &graph_reducer, &dead_code_elimination); |
519 AddReducer(data, &graph_reducer, &common_reducer); | 534 AddReducer(data, &graph_reducer, &common_reducer); |
520 if (data->info()->is_frame_specializing()) { | 535 if (data->info()->is_frame_specializing()) { |
521 AddReducer(data, &graph_reducer, &frame_specialization); | 536 AddReducer(data, &graph_reducer, &frame_specialization); |
522 } | 537 } |
| 538 if (data->info()->is_native_context_specializing()) { |
| 539 AddReducer(data, &graph_reducer, &global_specialization); |
| 540 } |
523 AddReducer(data, &graph_reducer, &context_specialization); | 541 AddReducer(data, &graph_reducer, &context_specialization); |
524 AddReducer(data, &graph_reducer, &inliner); | 542 AddReducer(data, &graph_reducer, &inliner); |
525 graph_reducer.ReduceGraph(); | 543 graph_reducer.ReduceGraph(); |
526 } | 544 } |
527 }; | 545 }; |
528 | 546 |
529 | 547 |
530 struct TyperPhase { | 548 struct TyperPhase { |
531 static const char* phase_name() { return "typer"; } | 549 static const char* phase_name() { return "typer"; } |
532 | 550 |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 tcf << AsC1VRegisterAllocationData("CodeGen", | 1429 tcf << AsC1VRegisterAllocationData("CodeGen", |
1412 data->register_allocation_data()); | 1430 data->register_allocation_data()); |
1413 } | 1431 } |
1414 | 1432 |
1415 data->DeleteRegisterAllocationZone(); | 1433 data->DeleteRegisterAllocationZone(); |
1416 } | 1434 } |
1417 | 1435 |
1418 } // namespace compiler | 1436 } // namespace compiler |
1419 } // namespace internal | 1437 } // namespace internal |
1420 } // namespace v8 | 1438 } // namespace v8 |
OLD | NEW |