OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(BreakableStatementChecker); | 83 DISALLOW_COPY_AND_ASSIGN(BreakableStatementChecker); |
84 }; | 84 }; |
85 | 85 |
86 | 86 |
87 // ----------------------------------------------------------------------------- | 87 // ----------------------------------------------------------------------------- |
88 // Full code generator. | 88 // Full code generator. |
89 | 89 |
90 class FullCodeGenerator: public AstVisitor { | 90 class FullCodeGenerator: public AstVisitor { |
91 public: | 91 public: |
92 enum Mode { | |
93 PRIMARY, | |
94 SECONDARY | |
95 }; | |
96 | |
97 explicit FullCodeGenerator(MacroAssembler* masm) | 92 explicit FullCodeGenerator(MacroAssembler* masm) |
98 : masm_(masm), | 93 : masm_(masm), |
99 info_(NULL), | 94 info_(NULL), |
100 nesting_stack_(NULL), | 95 nesting_stack_(NULL), |
101 loop_depth_(0), | 96 loop_depth_(0), |
102 location_(kStack), | 97 location_(kStack), |
103 true_label_(NULL), | 98 true_label_(NULL), |
104 false_label_(NULL) { | 99 false_label_(NULL) { |
105 } | 100 } |
106 | 101 |
107 static Handle<Code> MakeCode(CompilationInfo* info); | 102 static Handle<Code> MakeCode(CompilationInfo* info); |
108 | 103 |
109 void Generate(CompilationInfo* info, Mode mode); | 104 void Generate(CompilationInfo* info); |
110 | 105 |
111 private: | 106 private: |
112 class Breakable; | 107 class Breakable; |
113 class Iteration; | 108 class Iteration; |
114 class TryCatch; | 109 class TryCatch; |
115 class TryFinally; | 110 class TryFinally; |
116 class Finally; | 111 class Finally; |
117 class ForIn; | 112 class ForIn; |
118 | 113 |
119 class NestedStatement BASE_EMBEDDED { | 114 class NestedStatement BASE_EMBEDDED { |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 | 537 |
543 friend class NestedStatement; | 538 friend class NestedStatement; |
544 | 539 |
545 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); | 540 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); |
546 }; | 541 }; |
547 | 542 |
548 | 543 |
549 } } // namespace v8::internal | 544 } } // namespace v8::internal |
550 | 545 |
551 #endif // V8_FULL_CODEGEN_H_ | 546 #endif // V8_FULL_CODEGEN_H_ |
OLD | NEW |