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_FULL_CODEGEN_FULL_CODEGEN_H_ | 5 #ifndef V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
6 #define V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 6 #define V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/ast.h" | 10 #include "src/ast.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class FullCodeGenerator: public AstVisitor { | 28 class FullCodeGenerator: public AstVisitor { |
29 public: | 29 public: |
30 enum State { | 30 enum State { |
31 NO_REGISTERS, | 31 NO_REGISTERS, |
32 TOS_REG | 32 TOS_REG |
33 }; | 33 }; |
34 | 34 |
35 FullCodeGenerator(MacroAssembler* masm, CompilationInfo* info) | 35 FullCodeGenerator(MacroAssembler* masm, CompilationInfo* info) |
36 : masm_(masm), | 36 : masm_(masm), |
37 info_(info), | 37 info_(info), |
| 38 isolate_(info->isolate()), |
| 39 zone_(info->zone()), |
38 scope_(info->scope()), | 40 scope_(info->scope()), |
39 nesting_stack_(NULL), | 41 nesting_stack_(NULL), |
40 loop_depth_(0), | 42 loop_depth_(0), |
41 try_catch_depth_(0), | 43 try_catch_depth_(0), |
42 globals_(NULL), | 44 globals_(NULL), |
43 context_(NULL), | 45 context_(NULL), |
44 bailout_entries_(info->HasDeoptimizationSupport() | 46 bailout_entries_(info->HasDeoptimizationSupport() |
45 ? info->literal()->ast_node_count() | 47 ? info->literal()->ast_node_count() |
46 : 0, | 48 : 0, |
47 info->zone()), | 49 info->zone()), |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 DCHECK(loop_depth_ > 0); | 683 DCHECK(loop_depth_ > 0); |
682 loop_depth_--; | 684 loop_depth_--; |
683 } | 685 } |
684 | 686 |
685 MacroAssembler* masm() const { return masm_; } | 687 MacroAssembler* masm() const { return masm_; } |
686 | 688 |
687 class ExpressionContext; | 689 class ExpressionContext; |
688 const ExpressionContext* context() { return context_; } | 690 const ExpressionContext* context() { return context_; } |
689 void set_new_context(const ExpressionContext* context) { context_ = context; } | 691 void set_new_context(const ExpressionContext* context) { context_ = context; } |
690 | 692 |
691 Isolate* isolate() const { return info_->isolate(); } | 693 Isolate* isolate() const { return isolate_; } |
| 694 Zone* zone() const { return zone_; } |
692 Handle<Script> script() { return info_->script(); } | 695 Handle<Script> script() { return info_->script(); } |
693 bool is_eval() { return info_->is_eval(); } | 696 bool is_eval() { return info_->is_eval(); } |
694 bool is_native() { return info_->is_native(); } | 697 bool is_native() { return info_->is_native(); } |
695 LanguageMode language_mode() { return literal()->language_mode(); } | 698 LanguageMode language_mode() { return literal()->language_mode(); } |
696 bool has_simple_parameters() { return info_->has_simple_parameters(); } | 699 bool has_simple_parameters() { return info_->has_simple_parameters(); } |
697 FunctionLiteral* literal() const { return info_->literal(); } | 700 FunctionLiteral* literal() const { return info_->literal(); } |
698 Scope* scope() { return scope_; } | 701 Scope* scope() { return scope_; } |
699 | 702 |
700 static Register result_register(); | 703 static Register result_register(); |
701 static Register context_register(); | 704 static Register context_register(); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 MacroAssembler* masm() const { return codegen_->masm(); } | 946 MacroAssembler* masm() const { return codegen_->masm(); } |
944 | 947 |
945 FullCodeGenerator* codegen_; | 948 FullCodeGenerator* codegen_; |
946 Scope* saved_scope_; | 949 Scope* saved_scope_; |
947 BailoutId exit_id_; | 950 BailoutId exit_id_; |
948 bool needs_block_context_; | 951 bool needs_block_context_; |
949 }; | 952 }; |
950 | 953 |
951 MacroAssembler* masm_; | 954 MacroAssembler* masm_; |
952 CompilationInfo* info_; | 955 CompilationInfo* info_; |
| 956 Isolate* isolate_; |
| 957 Zone* zone_; |
953 Scope* scope_; | 958 Scope* scope_; |
954 Label return_label_; | 959 Label return_label_; |
955 NestedStatement* nesting_stack_; | 960 NestedStatement* nesting_stack_; |
956 int loop_depth_; | 961 int loop_depth_; |
957 int try_catch_depth_; | 962 int try_catch_depth_; |
958 ZoneList<Handle<Object> >* globals_; | 963 ZoneList<Handle<Object> >* globals_; |
959 Handle<FixedArray> modules_; | 964 Handle<FixedArray> modules_; |
960 int module_index_; | 965 int module_index_; |
961 const ExpressionContext* context_; | 966 const ExpressionContext* context_; |
962 ZoneList<BailoutEntry> bailout_entries_; | 967 ZoneList<BailoutEntry> bailout_entries_; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 Address start_; | 1058 Address start_; |
1054 Address instruction_start_; | 1059 Address instruction_start_; |
1055 uint32_t length_; | 1060 uint32_t length_; |
1056 }; | 1061 }; |
1057 | 1062 |
1058 | 1063 |
1059 } // namespace internal | 1064 } // namespace internal |
1060 } // namespace v8 | 1065 } // namespace v8 |
1061 | 1066 |
1062 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 1067 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
OLD | NEW |