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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 global_count_(0), | 86 global_count_(0), |
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 has_self_optimization_header_(false) { } |
94 | 95 |
95 static bool MakeCode(CompilationInfo* info); | 96 static bool MakeCode(CompilationInfo* info); |
96 | 97 |
| 98 // Returns the platform-specific size in bytes of the self-optimization |
| 99 // header. |
| 100 static int self_optimization_header_size(); |
| 101 |
97 // Encode state and pc-offset as a BitField<type, start, size>. | 102 // Encode state and pc-offset as a BitField<type, start, size>. |
98 // Only use 30 bits because we encode the result as a smi. | 103 // Only use 30 bits because we encode the result as a smi. |
99 class StateField : public BitField<State, 0, 1> { }; | 104 class StateField : public BitField<State, 0, 1> { }; |
100 class PcField : public BitField<unsigned, 1, 30-1> { }; | 105 class PcField : public BitField<unsigned, 1, 30-1> { }; |
101 | 106 |
102 static const char* State2String(State state) { | 107 static const char* State2String(State state) { |
103 switch (state) { | 108 switch (state) { |
104 case NO_REGISTERS: return "NO_REGISTERS"; | 109 case NO_REGISTERS: return "NO_REGISTERS"; |
105 case TOS_REG: return "TOS_REG"; | 110 case TOS_REG: return "TOS_REG"; |
106 } | 111 } |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 Scope* scope_; | 784 Scope* scope_; |
780 Label return_label_; | 785 Label return_label_; |
781 NestedStatement* nesting_stack_; | 786 NestedStatement* nesting_stack_; |
782 int loop_depth_; | 787 int loop_depth_; |
783 int global_count_; | 788 int global_count_; |
784 const ExpressionContext* context_; | 789 const ExpressionContext* context_; |
785 ZoneList<BailoutEntry> bailout_entries_; | 790 ZoneList<BailoutEntry> bailout_entries_; |
786 ZoneList<BailoutEntry> stack_checks_; | 791 ZoneList<BailoutEntry> stack_checks_; |
787 ZoneList<TypeFeedbackCellEntry> type_feedback_cells_; | 792 ZoneList<TypeFeedbackCellEntry> type_feedback_cells_; |
788 int ic_total_count_; | 793 int ic_total_count_; |
| 794 bool has_self_optimization_header_; |
789 Handle<FixedArray> handler_table_; | 795 Handle<FixedArray> handler_table_; |
790 Handle<JSGlobalPropertyCell> profiling_counter_; | 796 Handle<JSGlobalPropertyCell> profiling_counter_; |
791 | 797 |
792 friend class NestedStatement; | 798 friend class NestedStatement; |
793 | 799 |
794 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); | 800 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); |
795 }; | 801 }; |
796 | 802 |
797 | 803 |
798 } } // namespace v8::internal | 804 } } // namespace v8::internal |
799 | 805 |
800 #endif // V8_FULL_CODEGEN_H_ | 806 #endif // V8_FULL_CODEGEN_H_ |
OLD | NEW |