| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 NO_REGISTERS, | 76 NO_REGISTERS, |
| 77 TOS_REG | 77 TOS_REG |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 FullCodeGenerator(MacroAssembler* masm, CompilationInfo* info) | 80 FullCodeGenerator(MacroAssembler* masm, CompilationInfo* info) |
| 81 : masm_(masm), | 81 : masm_(masm), |
| 82 info_(info), | 82 info_(info), |
| 83 scope_(info->scope()), | 83 scope_(info->scope()), |
| 84 nesting_stack_(NULL), | 84 nesting_stack_(NULL), |
| 85 loop_depth_(0), | 85 loop_depth_(0), |
| 86 globals_(10), | 86 globals_(NULL), |
| 87 context_(NULL), | 87 context_(NULL), |
| 88 bailout_entries_(info->HasDeoptimizationSupport() | 88 bailout_entries_(info->HasDeoptimizationSupport() |
| 89 ? info->function()->ast_node_count() : 0), | 89 ? info->function()->ast_node_count() : 0), |
| 90 stack_checks_(2), // There's always at least one. | 90 stack_checks_(2), // There's always at least one. |
| 91 type_feedback_cells_(info->HasDeoptimizationSupport() | 91 type_feedback_cells_(info->HasDeoptimizationSupport() |
| 92 ? info->function()->ast_node_count() : 0), | 92 ? info->function()->ast_node_count() : 0), |
| 93 ic_total_count_(0) { } | 93 ic_total_count_(0) { } |
| 94 | 94 |
| 95 static bool MakeCode(CompilationInfo* info); | 95 static bool MakeCode(CompilationInfo* info); |
| 96 | 96 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 195 |
| 196 // A nested block statement. | 196 // A nested block statement. |
| 197 class NestedBlock : public Breakable { | 197 class NestedBlock : public Breakable { |
| 198 public: | 198 public: |
| 199 NestedBlock(FullCodeGenerator* codegen, Block* block) | 199 NestedBlock(FullCodeGenerator* codegen, Block* block) |
| 200 : Breakable(codegen, block) { | 200 : Breakable(codegen, block) { |
| 201 } | 201 } |
| 202 virtual ~NestedBlock() {} | 202 virtual ~NestedBlock() {} |
| 203 | 203 |
| 204 virtual NestedStatement* Exit(int* stack_depth, int* context_length) { | 204 virtual NestedStatement* Exit(int* stack_depth, int* context_length) { |
| 205 if (statement()->AsBlock()->block_scope() != NULL) { | 205 if (statement()->AsBlock()->scope() != NULL) { |
| 206 ++(*context_length); | 206 ++(*context_length); |
| 207 } | 207 } |
| 208 return previous_; | 208 return previous_; |
| 209 }; | 209 }; |
| 210 }; | 210 }; |
| 211 | 211 |
| 212 // The try block of a try/catch statement. | 212 // The try block of a try/catch statement. |
| 213 class TryCatch : public NestedStatement { | 213 class TryCatch : public NestedStatement { |
| 214 public: | 214 public: |
| 215 explicit TryCatch(FullCodeGenerator* codegen) : NestedStatement(codegen) { | 215 explicit TryCatch(FullCodeGenerator* codegen) : NestedStatement(codegen) { |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 Label** fall_through) const; | 771 Label** fall_through) const; |
| 772 virtual bool IsEffect() const { return true; } | 772 virtual bool IsEffect() const { return true; } |
| 773 }; | 773 }; |
| 774 | 774 |
| 775 MacroAssembler* masm_; | 775 MacroAssembler* masm_; |
| 776 CompilationInfo* info_; | 776 CompilationInfo* info_; |
| 777 Scope* scope_; | 777 Scope* scope_; |
| 778 Label return_label_; | 778 Label return_label_; |
| 779 NestedStatement* nesting_stack_; | 779 NestedStatement* nesting_stack_; |
| 780 int loop_depth_; | 780 int loop_depth_; |
| 781 ZoneList<Handle<Object> > globals_; | 781 ZoneList<Handle<Object> >* globals_; |
| 782 const ExpressionContext* context_; | 782 const ExpressionContext* context_; |
| 783 ZoneList<BailoutEntry> bailout_entries_; | 783 ZoneList<BailoutEntry> bailout_entries_; |
| 784 ZoneList<BailoutEntry> stack_checks_; | 784 ZoneList<BailoutEntry> stack_checks_; |
| 785 ZoneList<TypeFeedbackCellEntry> type_feedback_cells_; | 785 ZoneList<TypeFeedbackCellEntry> type_feedback_cells_; |
| 786 int ic_total_count_; | 786 int ic_total_count_; |
| 787 Handle<FixedArray> handler_table_; | 787 Handle<FixedArray> handler_table_; |
| 788 Handle<JSGlobalPropertyCell> profiling_counter_; | 788 Handle<JSGlobalPropertyCell> profiling_counter_; |
| 789 | 789 |
| 790 friend class NestedStatement; | 790 friend class NestedStatement; |
| 791 | 791 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 811 } | 811 } |
| 812 | 812 |
| 813 private: | 813 private: |
| 814 Zone* zone_; | 814 Zone* zone_; |
| 815 }; | 815 }; |
| 816 | 816 |
| 817 | 817 |
| 818 } } // namespace v8::internal | 818 } } // namespace v8::internal |
| 819 | 819 |
| 820 #endif // V8_FULL_CODEGEN_H_ | 820 #endif // V8_FULL_CODEGEN_H_ |
| OLD | NEW |