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.h" | 9 #include "src/ast.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 // This flag is used by the main thread to track whether this compilation | 481 // This flag is used by the main thread to track whether this compilation |
482 // should be abandoned due to dependency change. | 482 // should be abandoned due to dependency change. |
483 bool aborted_due_to_dependency_change_; | 483 bool aborted_due_to_dependency_change_; |
484 | 484 |
485 int osr_expr_stack_height_; | 485 int osr_expr_stack_height_; |
486 | 486 |
487 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); | 487 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); |
488 }; | 488 }; |
489 | 489 |
490 | 490 |
491 // Exactly like a CompilationInfo, except also creates and enters a | |
492 // Zone on construction and deallocates it on exit. | |
493 class CompilationInfoWithZone: public CompilationInfo { | |
494 public: | |
495 explicit CompilationInfoWithZone(Handle<Script> script); | |
496 explicit CompilationInfoWithZone(Handle<JSFunction> closure); | |
497 | |
498 // Virtual destructor because a CompilationInfoWithZone has to exit the | |
499 // zone scope and get rid of dependent maps even when the destructor is | |
500 // called when cast as a CompilationInfo. | |
501 virtual ~CompilationInfoWithZone(); | |
502 | |
503 private: | |
504 Zone zone_; | |
505 }; | |
506 | |
507 // A wrapper around a CompilationInfo that detaches the Handles from | 491 // A wrapper around a CompilationInfo that detaches the Handles from |
508 // the underlying DeferredHandleScope and stores them in info_ on | 492 // the underlying DeferredHandleScope and stores them in info_ on |
509 // destruction. | 493 // destruction. |
510 class CompilationHandleScope BASE_EMBEDDED { | 494 class CompilationHandleScope BASE_EMBEDDED { |
511 public: | 495 public: |
512 explicit CompilationHandleScope(CompilationInfo* info) | 496 explicit CompilationHandleScope(CompilationInfo* info) |
513 : deferred_(info->isolate()), info_(info) {} | 497 : deferred_(info->isolate()), info_(info) {} |
514 ~CompilationHandleScope() { | 498 ~CompilationHandleScope() { |
515 info_->set_deferred_handles(deferred_.Detach()); | 499 info_->set_deferred_handles(deferred_.Detach()); |
516 } | 500 } |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 Zone zone_; | 687 Zone zone_; |
704 size_t info_zone_start_allocation_size_; | 688 size_t info_zone_start_allocation_size_; |
705 base::ElapsedTimer timer_; | 689 base::ElapsedTimer timer_; |
706 | 690 |
707 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 691 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
708 }; | 692 }; |
709 | 693 |
710 } } // namespace v8::internal | 694 } } // namespace v8::internal |
711 | 695 |
712 #endif // V8_COMPILER_H_ | 696 #endif // V8_COMPILER_H_ |
OLD | NEW |