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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 | 398 |
399 int optimization_id() const { return optimization_id_; } | 399 int optimization_id() const { return optimization_id_; } |
400 | 400 |
401 AstValueFactory* ast_value_factory() const { return ast_value_factory_; } | 401 AstValueFactory* ast_value_factory() const { return ast_value_factory_; } |
402 void SetAstValueFactory(AstValueFactory* ast_value_factory, | 402 void SetAstValueFactory(AstValueFactory* ast_value_factory, |
403 bool owned = true) { | 403 bool owned = true) { |
404 ast_value_factory_ = ast_value_factory; | 404 ast_value_factory_ = ast_value_factory; |
405 ast_value_factory_owned_ = owned; | 405 ast_value_factory_owned_ = owned; |
406 } | 406 } |
407 | 407 |
| 408 int osr_expr_stack_height() { return osr_expr_stack_height_; } |
| 409 void set_osr_expr_stack_height(int height) { |
| 410 DCHECK(height >= 0); |
| 411 osr_expr_stack_height_ = height; |
| 412 } |
| 413 |
408 #if DEBUG | 414 #if DEBUG |
409 void PrintAstForTesting(); | 415 void PrintAstForTesting(); |
410 #endif | 416 #endif |
411 | 417 |
412 protected: | 418 protected: |
413 CompilationInfo(Handle<SharedFunctionInfo> shared_info, | 419 CompilationInfo(Handle<SharedFunctionInfo> shared_info, |
414 Zone* zone); | 420 Zone* zone); |
415 CompilationInfo(HydrogenCodeStub* stub, | 421 CompilationInfo(HydrogenCodeStub* stub, |
416 Isolate* isolate, | 422 Isolate* isolate, |
417 Zone* zone); | 423 Zone* zone); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 | 530 |
525 int optimization_id_; | 531 int optimization_id_; |
526 | 532 |
527 AstValueFactory* ast_value_factory_; | 533 AstValueFactory* ast_value_factory_; |
528 bool ast_value_factory_owned_; | 534 bool ast_value_factory_owned_; |
529 | 535 |
530 // This flag is used by the main thread to track whether this compilation | 536 // This flag is used by the main thread to track whether this compilation |
531 // should be abandoned due to dependency change. | 537 // should be abandoned due to dependency change. |
532 bool aborted_due_to_dependency_change_; | 538 bool aborted_due_to_dependency_change_; |
533 | 539 |
| 540 int osr_expr_stack_height_; |
| 541 |
534 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); | 542 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); |
535 }; | 543 }; |
536 | 544 |
537 | 545 |
538 // Exactly like a CompilationInfo, except also creates and enters a | 546 // Exactly like a CompilationInfo, except also creates and enters a |
539 // Zone on construction and deallocates it on exit. | 547 // Zone on construction and deallocates it on exit. |
540 class CompilationInfoWithZone: public CompilationInfo { | 548 class CompilationInfoWithZone: public CompilationInfo { |
541 public: | 549 public: |
542 explicit CompilationInfoWithZone(Handle<Script> script) | 550 explicit CompilationInfoWithZone(Handle<Script> script) |
543 : CompilationInfo(script, &zone_) {} | 551 : CompilationInfo(script, &zone_) {} |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 Zone zone_; | 768 Zone zone_; |
761 unsigned info_zone_start_allocation_size_; | 769 unsigned info_zone_start_allocation_size_; |
762 base::ElapsedTimer timer_; | 770 base::ElapsedTimer timer_; |
763 | 771 |
764 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 772 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
765 }; | 773 }; |
766 | 774 |
767 } } // namespace v8::internal | 775 } } // namespace v8::internal |
768 | 776 |
769 #endif // V8_COMPILER_H_ | 777 #endif // V8_COMPILER_H_ |
OLD | NEW |