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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 } | 498 } |
499 } | 499 } |
500 json_of << "\",\n\"phases\":["; | 500 json_of << "\",\n\"phases\":["; |
501 fclose(json_file); | 501 fclose(json_file); |
502 } | 502 } |
503 } | 503 } |
504 | 504 |
505 return pipeline_statistics; | 505 return pipeline_statistics; |
506 } | 506 } |
507 | 507 |
| 508 } // namespace |
| 509 |
508 class PipelineCompilationJob final : public CompilationJob { | 510 class PipelineCompilationJob final : public CompilationJob { |
509 public: | 511 public: |
510 PipelineCompilationJob(Isolate* isolate, Handle<JSFunction> function) | 512 PipelineCompilationJob(Isolate* isolate, Handle<JSFunction> function) |
511 // Note that the CompilationInfo is not initialized at the time we pass it | 513 // Note that the CompilationInfo is not initialized at the time we pass it |
512 // to the CompilationJob constructor, but it is not dereferenced there. | 514 // to the CompilationJob constructor, but it is not dereferenced there. |
513 : CompilationJob(&info_, "TurboFan"), | 515 : CompilationJob(&info_, "TurboFan"), |
514 zone_(isolate->allocator()), | 516 zone_(isolate->allocator()), |
515 zone_pool_(isolate->allocator()), | 517 zone_pool_(isolate->allocator()), |
516 parse_info_(&zone_, function), | 518 parse_info_(&zone_, function), |
517 info_(&parse_info_, function), | 519 info_(&parse_info_, function), |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 } | 582 } |
581 info()->dependencies()->Commit(code); | 583 info()->dependencies()->Commit(code); |
582 info()->SetCode(code); | 584 info()->SetCode(code); |
583 if (info()->is_deoptimization_enabled()) { | 585 if (info()->is_deoptimization_enabled()) { |
584 info()->context()->native_context()->AddOptimizedCode(*code); | 586 info()->context()->native_context()->AddOptimizedCode(*code); |
585 RegisterWeakObjectsInOptimizedCode(code); | 587 RegisterWeakObjectsInOptimizedCode(code); |
586 } | 588 } |
587 return SUCCEEDED; | 589 return SUCCEEDED; |
588 } | 590 } |
589 | 591 |
590 } // namespace | |
591 | |
592 class PipelineWasmCompilationJob final : public CompilationJob { | 592 class PipelineWasmCompilationJob final : public CompilationJob { |
593 public: | 593 public: |
594 explicit PipelineWasmCompilationJob(CompilationInfo* info, Graph* graph, | 594 explicit PipelineWasmCompilationJob(CompilationInfo* info, Graph* graph, |
595 CallDescriptor* descriptor, | 595 CallDescriptor* descriptor, |
596 SourcePositionTable* source_positions) | 596 SourcePositionTable* source_positions) |
597 : CompilationJob(info, "TurboFan"), | 597 : CompilationJob(info, "TurboFan"), |
598 zone_pool_(info->isolate()->allocator()), | 598 zone_pool_(info->isolate()->allocator()), |
599 data_(&zone_pool_, info, graph, source_positions), | 599 data_(&zone_pool_, info, graph, source_positions), |
600 pipeline_(&data_), | 600 pipeline_(&data_), |
601 linkage_(descriptor) {} | 601 linkage_(descriptor) {} |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1775 data->DeleteRegisterAllocationZone(); | 1775 data->DeleteRegisterAllocationZone(); |
1776 } | 1776 } |
1777 | 1777 |
1778 CompilationInfo* Pipeline::info() const { return data_->info(); } | 1778 CompilationInfo* Pipeline::info() const { return data_->info(); } |
1779 | 1779 |
1780 Isolate* Pipeline::isolate() const { return info()->isolate(); } | 1780 Isolate* Pipeline::isolate() const { return info()->isolate(); } |
1781 | 1781 |
1782 } // namespace compiler | 1782 } // namespace compiler |
1783 } // namespace internal | 1783 } // namespace internal |
1784 } // namespace v8 | 1784 } // namespace v8 |
OLD | NEW |