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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 globals_(NULL), | 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 info->zone()), | 90 info->zone()), |
91 stack_checks_(2, info->zone()), // There's always at least one. | 91 stack_checks_(2, info->zone()), // There's always at least one. |
92 type_feedback_cells_(info->HasDeoptimizationSupport() | 92 type_feedback_cells_(info->HasDeoptimizationSupport() |
93 ? info->function()->ast_node_count() : 0, | 93 ? info->function()->ast_node_count() : 0, |
94 info->zone()), | 94 info->zone()), |
95 ic_total_count_(0), | 95 ic_total_count_(0), |
96 zone_(info->zone()) { } | 96 zone_(info->zone()) { |
| 97 Initialize(); |
| 98 } |
| 99 |
| 100 void Initialize(); |
97 | 101 |
98 static bool MakeCode(CompilationInfo* info); | 102 static bool MakeCode(CompilationInfo* info); |
99 | 103 |
100 // Encode state and pc-offset as a BitField<type, start, size>. | 104 // Encode state and pc-offset as a BitField<type, start, size>. |
101 // Only use 30 bits because we encode the result as a smi. | 105 // Only use 30 bits because we encode the result as a smi. |
102 class StateField : public BitField<State, 0, 1> { }; | 106 class StateField : public BitField<State, 0, 1> { }; |
103 class PcField : public BitField<unsigned, 1, 30-1> { }; | 107 class PcField : public BitField<unsigned, 1, 30-1> { }; |
104 | 108 |
105 static const char* State2String(State state) { | 109 static const char* State2String(State state) { |
106 switch (state) { | 110 switch (state) { |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 NestedStatement* nesting_stack_; | 803 NestedStatement* nesting_stack_; |
800 int loop_depth_; | 804 int loop_depth_; |
801 ZoneList<Handle<Object> >* globals_; | 805 ZoneList<Handle<Object> >* globals_; |
802 const ExpressionContext* context_; | 806 const ExpressionContext* context_; |
803 ZoneList<BailoutEntry> bailout_entries_; | 807 ZoneList<BailoutEntry> bailout_entries_; |
804 ZoneList<BailoutEntry> stack_checks_; | 808 ZoneList<BailoutEntry> stack_checks_; |
805 ZoneList<TypeFeedbackCellEntry> type_feedback_cells_; | 809 ZoneList<TypeFeedbackCellEntry> type_feedback_cells_; |
806 int ic_total_count_; | 810 int ic_total_count_; |
807 Handle<FixedArray> handler_table_; | 811 Handle<FixedArray> handler_table_; |
808 Handle<JSGlobalPropertyCell> profiling_counter_; | 812 Handle<JSGlobalPropertyCell> profiling_counter_; |
| 813 bool generate_debug_code_; |
809 Zone* zone_; | 814 Zone* zone_; |
810 | 815 |
811 friend class NestedStatement; | 816 friend class NestedStatement; |
812 | 817 |
813 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); | 818 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); |
814 }; | 819 }; |
815 | 820 |
816 | 821 |
817 // A map from property names to getter/setter pairs allocated in the zone. | 822 // A map from property names to getter/setter pairs allocated in the zone. |
818 class AccessorTable: public TemplateHashMap<Literal, | 823 class AccessorTable: public TemplateHashMap<Literal, |
(...skipping 13 matching lines...) Expand all Loading... |
832 } | 837 } |
833 | 838 |
834 private: | 839 private: |
835 Zone* zone_; | 840 Zone* zone_; |
836 }; | 841 }; |
837 | 842 |
838 | 843 |
839 } } // namespace v8::internal | 844 } } // namespace v8::internal |
840 | 845 |
841 #endif // V8_FULL_CODEGEN_H_ | 846 #endif // V8_FULL_CODEGEN_H_ |
OLD | NEW |