| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 Zone* graph_zone() const { return graph_zone_; } | 192 Zone* graph_zone() const { return graph_zone_; } |
| 193 Graph* graph() const { return graph_; } | 193 Graph* graph() const { return graph_; } |
| 194 SourcePositionTable* source_positions() const { | 194 SourcePositionTable* source_positions() const { |
| 195 return source_positions_.get(); | 195 return source_positions_.get(); |
| 196 } | 196 } |
| 197 MachineOperatorBuilder* machine() const { return machine_; } | 197 MachineOperatorBuilder* machine() const { return machine_; } |
| 198 CommonOperatorBuilder* common() const { return common_; } | 198 CommonOperatorBuilder* common() const { return common_; } |
| 199 JSOperatorBuilder* javascript() const { return javascript_; } | 199 JSOperatorBuilder* javascript() const { return javascript_; } |
| 200 JSGraph* jsgraph() const { return jsgraph_; } | 200 JSGraph* jsgraph() const { return jsgraph_; } |
| 201 MaybeHandle<Context> native_context() const { |
| 202 if (info()->is_native_context_specializing()) { |
| 203 return handle(info()->native_context(), isolate()); |
| 204 } |
| 205 return MaybeHandle<Context>(); |
| 206 } |
| 201 | 207 |
| 202 LoopAssignmentAnalysis* loop_assignment() const { return loop_assignment_; } | 208 LoopAssignmentAnalysis* loop_assignment() const { return loop_assignment_; } |
| 203 void set_loop_assignment(LoopAssignmentAnalysis* loop_assignment) { | 209 void set_loop_assignment(LoopAssignmentAnalysis* loop_assignment) { |
| 204 DCHECK(!loop_assignment_); | 210 DCHECK(!loop_assignment_); |
| 205 loop_assignment_ = loop_assignment; | 211 loop_assignment_ = loop_assignment; |
| 206 } | 212 } |
| 207 | 213 |
| 208 Schedule* schedule() const { return schedule_; } | 214 Schedule* schedule() const { return schedule_; } |
| 209 void set_schedule(Schedule* schedule) { | 215 void set_schedule(Schedule* schedule) { |
| 210 DCHECK(!schedule_); | 216 DCHECK(!schedule_); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 | 507 |
| 502 void Run(PipelineData* data, Zone* temp_zone) { | 508 void Run(PipelineData* data, Zone* temp_zone) { |
| 503 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 509 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
| 504 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), | 510 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), |
| 505 data->common()); | 511 data->common()); |
| 506 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), | 512 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
| 507 data->common(), data->machine()); | 513 data->common(), data->machine()); |
| 508 JSCallReducer call_reducer(data->jsgraph(), | 514 JSCallReducer call_reducer(data->jsgraph(), |
| 509 data->info()->is_deoptimization_enabled() | 515 data->info()->is_deoptimization_enabled() |
| 510 ? JSCallReducer::kDeoptimizationEnabled | 516 ? JSCallReducer::kDeoptimizationEnabled |
| 511 : JSCallReducer::kNoFlags); | 517 : JSCallReducer::kNoFlags, |
| 518 data->native_context()); |
| 512 JSContextSpecialization context_specialization( | 519 JSContextSpecialization context_specialization( |
| 513 &graph_reducer, data->jsgraph(), | 520 &graph_reducer, data->jsgraph(), |
| 514 data->info()->is_function_context_specializing() | 521 data->info()->is_function_context_specializing() |
| 515 ? data->info()->context() | 522 ? data->info()->context() |
| 516 : MaybeHandle<Context>()); | 523 : MaybeHandle<Context>()); |
| 517 JSFrameSpecialization frame_specialization(data->info()->osr_frame(), | 524 JSFrameSpecialization frame_specialization(data->info()->osr_frame(), |
| 518 data->jsgraph()); | 525 data->jsgraph()); |
| 519 JSGlobalObjectSpecialization global_object_specialization( | 526 JSGlobalObjectSpecialization global_object_specialization( |
| 520 &graph_reducer, data->jsgraph(), | 527 &graph_reducer, data->jsgraph(), |
| 521 data->info()->is_deoptimization_enabled() | 528 data->info()->is_deoptimization_enabled() |
| 522 ? JSGlobalObjectSpecialization::kDeoptimizationEnabled | 529 ? JSGlobalObjectSpecialization::kDeoptimizationEnabled |
| 523 : JSGlobalObjectSpecialization::kNoFlags, | 530 : JSGlobalObjectSpecialization::kNoFlags, |
| 524 data->info()->is_native_context_specializing() | 531 data->native_context(), data->info()->dependencies()); |
| 525 ? handle(data->info()->native_context(), data->isolate()) | |
| 526 : MaybeHandle<Context>(), | |
| 527 data->info()->dependencies()); | |
| 528 JSNativeContextSpecialization native_context_specialization( | 532 JSNativeContextSpecialization native_context_specialization( |
| 529 &graph_reducer, data->jsgraph(), | 533 &graph_reducer, data->jsgraph(), |
| 530 data->info()->is_deoptimization_enabled() | 534 data->info()->is_deoptimization_enabled() |
| 531 ? JSNativeContextSpecialization::kDeoptimizationEnabled | 535 ? JSNativeContextSpecialization::kDeoptimizationEnabled |
| 532 : JSNativeContextSpecialization::kNoFlags, | 536 : JSNativeContextSpecialization::kNoFlags, |
| 533 data->info()->is_native_context_specializing() | 537 data->native_context(), data->info()->dependencies(), temp_zone); |
| 534 ? handle(data->info()->native_context(), data->isolate()) | |
| 535 : MaybeHandle<Context>(), | |
| 536 data->info()->dependencies(), temp_zone); | |
| 537 JSInliningHeuristic inlining(&graph_reducer, | 538 JSInliningHeuristic inlining(&graph_reducer, |
| 538 data->info()->is_inlining_enabled() | 539 data->info()->is_inlining_enabled() |
| 539 ? JSInliningHeuristic::kGeneralInlining | 540 ? JSInliningHeuristic::kGeneralInlining |
| 540 : JSInliningHeuristic::kRestrictedInlining, | 541 : JSInliningHeuristic::kRestrictedInlining, |
| 541 temp_zone, data->info(), data->jsgraph()); | 542 temp_zone, data->info(), data->jsgraph()); |
| 542 AddReducer(data, &graph_reducer, &dead_code_elimination); | 543 AddReducer(data, &graph_reducer, &dead_code_elimination); |
| 543 AddReducer(data, &graph_reducer, &common_reducer); | 544 AddReducer(data, &graph_reducer, &common_reducer); |
| 544 if (data->info()->is_frame_specializing()) { | 545 if (data->info()->is_frame_specializing()) { |
| 545 AddReducer(data, &graph_reducer, &frame_specialization); | 546 AddReducer(data, &graph_reducer, &frame_specialization); |
| 546 } | 547 } |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1425 tcf << AsC1VRegisterAllocationData("CodeGen", | 1426 tcf << AsC1VRegisterAllocationData("CodeGen", |
| 1426 data->register_allocation_data()); | 1427 data->register_allocation_data()); |
| 1427 } | 1428 } |
| 1428 | 1429 |
| 1429 data->DeleteRegisterAllocationZone(); | 1430 data->DeleteRegisterAllocationZone(); |
| 1430 } | 1431 } |
| 1431 | 1432 |
| 1432 } // namespace compiler | 1433 } // namespace compiler |
| 1433 } // namespace internal | 1434 } // namespace internal |
| 1434 } // namespace v8 | 1435 } // namespace v8 |
| OLD | NEW |