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 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1298 tcf << AsC1VRegisterAllocationData("CodeGen", | 1306 tcf << AsC1VRegisterAllocationData("CodeGen", |
1299 data->register_allocation_data()); | 1307 data->register_allocation_data()); |
1300 } | 1308 } |
1301 | 1309 |
1302 data->DeleteRegisterAllocationZone(); | 1310 data->DeleteRegisterAllocationZone(); |
1303 } | 1311 } |
1304 | 1312 |
1305 } // namespace compiler | 1313 } // namespace compiler |
1306 } // namespace internal | 1314 } // namespace internal |
1307 } // namespace v8 | 1315 } // namespace v8 |
OLD | NEW |