| 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/platform/elapsed-timer.h" | 10 #include "src/base/platform/elapsed-timer.h" |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 static const char* phase_name() { return "type feedback specializing"; } | 535 static const char* phase_name() { return "type feedback specializing"; } |
| 536 | 536 |
| 537 void Run(PipelineData* data, Zone* temp_zone) { | 537 void Run(PipelineData* data, Zone* temp_zone) { |
| 538 SourcePositionTable::Scope pos(data->source_positions(), | 538 SourcePositionTable::Scope pos(data->source_positions(), |
| 539 SourcePosition::Unknown()); | 539 SourcePosition::Unknown()); |
| 540 Handle<Context> native_context(data->info()->context()->native_context()); | 540 Handle<Context> native_context(data->info()->context()->native_context()); |
| 541 TypeFeedbackOracle oracle(data->isolate(), temp_zone, | 541 TypeFeedbackOracle oracle(data->isolate(), temp_zone, |
| 542 data->info()->unoptimized_code(), | 542 data->info()->unoptimized_code(), |
| 543 data->info()->feedback_vector(), native_context); | 543 data->info()->feedback_vector(), native_context); |
| 544 GraphReducer graph_reducer(data->graph(), temp_zone); | 544 GraphReducer graph_reducer(data->graph(), temp_zone); |
| 545 JSTypeFeedbackSpecializer specializer(data->jsgraph(), | 545 Handle<GlobalObject> global_object = Handle<GlobalObject>::null(); |
| 546 data->js_type_feedback(), &oracle); | 546 if (data->info()->has_global_object()) { |
| 547 global_object = |
| 548 Handle<GlobalObject>(data->info()->global_object(), data->isolate()); |
| 549 } |
| 550 // TODO(titzer): introduce a specialization mode/flags enum to control |
| 551 // specializing to the global object here. |
| 552 JSTypeFeedbackSpecializer specializer( |
| 553 data->jsgraph(), data->js_type_feedback(), &oracle, global_object, |
| 554 data->info()->dependencies()); |
| 547 AddReducer(data, &graph_reducer, &specializer); | 555 AddReducer(data, &graph_reducer, &specializer); |
| 548 graph_reducer.ReduceGraph(); | 556 graph_reducer.ReduceGraph(); |
| 549 } | 557 } |
| 550 }; | 558 }; |
| 551 | 559 |
| 552 | 560 |
| 553 struct TypedLoweringPhase { | 561 struct TypedLoweringPhase { |
| 554 static const char* phase_name() { return "typed lowering"; } | 562 static const char* phase_name() { return "typed lowering"; } |
| 555 | 563 |
| 556 void Run(PipelineData* data, Zone* temp_zone) { | 564 void Run(PipelineData* data, Zone* temp_zone) { |
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1307 tcf << AsC1VRegisterAllocationData("CodeGen", | 1315 tcf << AsC1VRegisterAllocationData("CodeGen", |
| 1308 data->register_allocation_data()); | 1316 data->register_allocation_data()); |
| 1309 } | 1317 } |
| 1310 | 1318 |
| 1311 data->DeleteRegisterAllocationZone(); | 1319 data->DeleteRegisterAllocationZone(); |
| 1312 } | 1320 } |
| 1313 | 1321 |
| 1314 } // namespace compiler | 1322 } // namespace compiler |
| 1315 } // namespace internal | 1323 } // namespace internal |
| 1316 } // namespace v8 | 1324 } // namespace v8 |
| OLD | NEW |