OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_COMPILER_H_ | 5 #ifndef V8_COMPILER_H_ |
6 #define V8_COMPILER_H_ | 6 #define V8_COMPILER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 info_->set_deferred_handles(deferred_.Detach()); | 502 info_->set_deferred_handles(deferred_.Detach()); |
503 } | 503 } |
504 | 504 |
505 private: | 505 private: |
506 DeferredHandleScope deferred_; | 506 DeferredHandleScope deferred_; |
507 CompilationInfo* info_; | 507 CompilationInfo* info_; |
508 }; | 508 }; |
509 | 509 |
510 | 510 |
511 class HGraph; | 511 class HGraph; |
512 class HOptimizedGraphBuilder; | |
513 class LChunk; | 512 class LChunk; |
514 | 513 |
515 // A helper class that calls the three compilation phases in | 514 // A helper class that calls the three compilation phases in |
516 // Crankshaft and keeps track of its state. The three phases | 515 // Crankshaft and keeps track of its state. The three phases |
517 // CreateGraph, OptimizeGraph and GenerateAndInstallCode can either | 516 // CreateGraph, OptimizeGraph and GenerateAndInstallCode can either |
518 // fail, bail-out to the full code generator or succeed. Apart from | 517 // fail, bail-out to the full code generator or succeed. Apart from |
519 // their return value, the status of the phase last run can be checked | 518 // their return value, the status of the phase last run can be checked |
520 // using last_status(). | 519 // using last_status(). |
521 class OptimizedCompileJob: public ZoneObject { | 520 class OptimizedCompileJob: public ZoneObject { |
522 public: | 521 public: |
523 explicit OptimizedCompileJob(CompilationInfo* info) | 522 explicit OptimizedCompileJob(CompilationInfo* info) |
524 : info_(info), | 523 : info_(info), |
525 graph_builder_(NULL), | |
526 graph_(NULL), | 524 graph_(NULL), |
527 chunk_(NULL), | 525 chunk_(NULL), |
528 last_status_(FAILED), | 526 last_status_(FAILED), |
529 awaiting_install_(false) { } | 527 awaiting_install_(false) { } |
530 | 528 |
531 enum Status { | 529 enum Status { |
532 FAILED, BAILED_OUT, SUCCEEDED | 530 FAILED, BAILED_OUT, SUCCEEDED |
533 }; | 531 }; |
534 | 532 |
535 MUST_USE_RESULT Status CreateGraph(); | 533 MUST_USE_RESULT Status CreateGraph(); |
(...skipping 16 matching lines...) Expand all Loading... |
552 | 550 |
553 void WaitForInstall() { | 551 void WaitForInstall() { |
554 DCHECK(info_->is_osr()); | 552 DCHECK(info_->is_osr()); |
555 awaiting_install_ = true; | 553 awaiting_install_ = true; |
556 } | 554 } |
557 | 555 |
558 bool IsWaitingForInstall() { return awaiting_install_; } | 556 bool IsWaitingForInstall() { return awaiting_install_; } |
559 | 557 |
560 private: | 558 private: |
561 CompilationInfo* info_; | 559 CompilationInfo* info_; |
562 HOptimizedGraphBuilder* graph_builder_; | |
563 HGraph* graph_; | 560 HGraph* graph_; |
564 LChunk* chunk_; | 561 LChunk* chunk_; |
565 base::TimeDelta time_taken_to_create_graph_; | 562 base::TimeDelta time_taken_to_create_graph_; |
566 base::TimeDelta time_taken_to_optimize_; | 563 base::TimeDelta time_taken_to_optimize_; |
567 base::TimeDelta time_taken_to_codegen_; | 564 base::TimeDelta time_taken_to_codegen_; |
568 Status last_status_; | 565 Status last_status_; |
569 bool awaiting_install_; | 566 bool awaiting_install_; |
570 | 567 |
571 MUST_USE_RESULT Status SetLastStatus(Status status) { | 568 MUST_USE_RESULT Status SetLastStatus(Status status) { |
572 last_status_ = status; | 569 last_status_ = status; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 size_t info_zone_start_allocation_size_; | 685 size_t info_zone_start_allocation_size_; |
689 base::ElapsedTimer timer_; | 686 base::ElapsedTimer timer_; |
690 | 687 |
691 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 688 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
692 }; | 689 }; |
693 | 690 |
694 } // namespace internal | 691 } // namespace internal |
695 } // namespace v8 | 692 } // namespace v8 |
696 | 693 |
697 #endif // V8_COMPILER_H_ | 694 #endif // V8_COMPILER_H_ |
OLD | NEW |