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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 // A base class for compilation jobs intended to run concurrent to the main | 564 // A base class for compilation jobs intended to run concurrent to the main |
565 // thread. The job is split into three phases which are called in sequence on | 565 // thread. The job is split into three phases which are called in sequence on |
566 // different threads and with different limitations: | 566 // different threads and with different limitations: |
567 // 1) CreateGraph: Runs on main thread. No major limitations. | 567 // 1) CreateGraph: Runs on main thread. No major limitations. |
568 // 2) OptimizeGraph: Runs concurrently. No heap allocation or handle derefs. | 568 // 2) OptimizeGraph: Runs concurrently. No heap allocation or handle derefs. |
569 // 3) GenerateCode: Runs on main thread. No dependency changes. | 569 // 3) GenerateCode: Runs on main thread. No dependency changes. |
570 // | 570 // |
571 // Each of the three phases can either fail, bail-out to full code generator or | 571 // Each of the three phases can either fail, bail-out to full code generator or |
572 // succeed. Apart from their return value, the status of the phase last run can | 572 // succeed. Apart from their return value, the status of the phase last run can |
573 // be checked using {last_status()} as well. | 573 // be checked using {last_status()} as well. |
574 class OptimizedCompileJob: public ZoneObject { | 574 // TODO(mstarzinger): Make CompilationInfo base embedded. |
| 575 class OptimizedCompileJob { |
575 public: | 576 public: |
576 explicit OptimizedCompileJob(CompilationInfo* info, const char* compiler_name) | 577 explicit OptimizedCompileJob(CompilationInfo* info, const char* compiler_name) |
577 : info_(info), compiler_name_(compiler_name), last_status_(SUCCEEDED) {} | 578 : info_(info), compiler_name_(compiler_name), last_status_(SUCCEEDED) {} |
578 virtual ~OptimizedCompileJob() {} | 579 virtual ~OptimizedCompileJob() {} |
579 | 580 |
580 enum Status { | 581 enum Status { |
581 FAILED, BAILED_OUT, SUCCEEDED | 582 FAILED, BAILED_OUT, SUCCEEDED |
582 }; | 583 }; |
583 | 584 |
584 MUST_USE_RESULT Status CreateGraph(); | 585 MUST_USE_RESULT Status CreateGraph(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 MUST_USE_RESULT Status SetLastStatus(Status status) { | 621 MUST_USE_RESULT Status SetLastStatus(Status status) { |
621 last_status_ = status; | 622 last_status_ = status; |
622 return last_status_; | 623 return last_status_; |
623 } | 624 } |
624 }; | 625 }; |
625 | 626 |
626 } // namespace internal | 627 } // namespace internal |
627 } // namespace v8 | 628 } // namespace v8 |
628 | 629 |
629 #endif // V8_COMPILER_H_ | 630 #endif // V8_COMPILER_H_ |
OLD | NEW |