| 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 GraphReducer graph_reducer(data->graph(), temp_zone); | 539 GraphReducer graph_reducer(data->graph(), temp_zone); |
| 540 Handle<GlobalObject> global_object = Handle<GlobalObject>::null(); | 540 Handle<GlobalObject> global_object = Handle<GlobalObject>::null(); |
| 541 if (data->info()->has_global_object()) { | 541 if (data->info()->has_global_object()) { |
| 542 global_object = | 542 global_object = |
| 543 Handle<GlobalObject>(data->info()->global_object(), data->isolate()); | 543 Handle<GlobalObject>(data->info()->global_object(), data->isolate()); |
| 544 } | 544 } |
| 545 // TODO(titzer): introduce a specialization mode/flags enum to control | 545 // TODO(titzer): introduce a specialization mode/flags enum to control |
| 546 // specializing to the global object here. | 546 // specializing to the global object here. |
| 547 JSTypeFeedbackSpecializer specializer( | 547 JSTypeFeedbackSpecializer specializer( |
| 548 &graph_reducer, data->jsgraph(), data->js_type_feedback(), &oracle, | 548 &graph_reducer, data->jsgraph(), data->js_type_feedback(), &oracle, |
| 549 global_object, data->info()->dependencies()); | 549 global_object, data->info()->is_deoptimization_enabled() |
| 550 ? JSTypeFeedbackSpecializer::kDeoptimizationEnabled |
| 551 : JSTypeFeedbackSpecializer::kDeoptimizationDisabled, |
| 552 data->info()->dependencies()); |
| 550 AddReducer(data, &graph_reducer, &specializer); | 553 AddReducer(data, &graph_reducer, &specializer); |
| 551 graph_reducer.ReduceGraph(); | 554 graph_reducer.ReduceGraph(); |
| 552 } | 555 } |
| 553 }; | 556 }; |
| 554 | 557 |
| 555 | 558 |
| 556 struct TypedLoweringPhase { | 559 struct TypedLoweringPhase { |
| 557 static const char* phase_name() { return "typed lowering"; } | 560 static const char* phase_name() { return "typed lowering"; } |
| 558 | 561 |
| 559 void Run(PipelineData* data, Zone* temp_zone) { | 562 void Run(PipelineData* data, Zone* temp_zone) { |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 if (FLAG_turbo_stress_loop_peeling) { | 1044 if (FLAG_turbo_stress_loop_peeling) { |
| 1042 Run<StressLoopPeelingPhase>(); | 1045 Run<StressLoopPeelingPhase>(); |
| 1043 RunPrintAndVerify("Loop peeled", true); | 1046 RunPrintAndVerify("Loop peeled", true); |
| 1044 } | 1047 } |
| 1045 | 1048 |
| 1046 if (info()->is_osr()) { | 1049 if (info()->is_osr()) { |
| 1047 Run<OsrDeconstructionPhase>(); | 1050 Run<OsrDeconstructionPhase>(); |
| 1048 RunPrintAndVerify("OSR deconstruction"); | 1051 RunPrintAndVerify("OSR deconstruction"); |
| 1049 } | 1052 } |
| 1050 | 1053 |
| 1051 // TODO(turbofan): Type feedback currently requires deoptimization. | 1054 if (info()->is_type_feedback_enabled()) { |
| 1052 if (info()->is_deoptimization_enabled() && | |
| 1053 info()->is_type_feedback_enabled()) { | |
| 1054 Run<JSTypeFeedbackPhase>(); | 1055 Run<JSTypeFeedbackPhase>(); |
| 1055 RunPrintAndVerify("JSType feedback"); | 1056 RunPrintAndVerify("JSType feedback"); |
| 1056 } | 1057 } |
| 1057 | 1058 |
| 1058 // Lower simplified operators and insert changes. | 1059 // Lower simplified operators and insert changes. |
| 1059 Run<SimplifiedLoweringPhase>(); | 1060 Run<SimplifiedLoweringPhase>(); |
| 1060 RunPrintAndVerify("Lowered simplified"); | 1061 RunPrintAndVerify("Lowered simplified"); |
| 1061 | 1062 |
| 1062 // Optimize control flow. | 1063 // Optimize control flow. |
| 1063 if (FLAG_turbo_cf_optimization) { | 1064 if (FLAG_turbo_cf_optimization) { |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 tcf << AsC1VRegisterAllocationData("CodeGen", | 1326 tcf << AsC1VRegisterAllocationData("CodeGen", |
| 1326 data->register_allocation_data()); | 1327 data->register_allocation_data()); |
| 1327 } | 1328 } |
| 1328 | 1329 |
| 1329 data->DeleteRegisterAllocationZone(); | 1330 data->DeleteRegisterAllocationZone(); |
| 1330 } | 1331 } |
| 1331 | 1332 |
| 1332 } // namespace compiler | 1333 } // namespace compiler |
| 1333 } // namespace internal | 1334 } // namespace internal |
| 1334 } // namespace v8 | 1335 } // namespace v8 |
| OLD | NEW |