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 14 matching lines...) Expand all Loading... |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_ARM_CODEGEN_ARM_H_ | 28 #ifndef V8_ARM_CODEGEN_ARM_H_ |
29 #define V8_ARM_CODEGEN_ARM_H_ | 29 #define V8_ARM_CODEGEN_ARM_H_ |
30 | 30 |
31 namespace v8 { | 31 namespace v8 { |
32 namespace internal { | 32 namespace internal { |
33 | 33 |
34 // Forward declarations | 34 // Forward declarations |
| 35 class CompilationInfo; |
35 class DeferredCode; | 36 class DeferredCode; |
36 class RegisterAllocator; | 37 class RegisterAllocator; |
37 class RegisterFile; | 38 class RegisterFile; |
38 | 39 |
39 enum InitState { CONST_INIT, NOT_CONST_INIT }; | 40 enum InitState { CONST_INIT, NOT_CONST_INIT }; |
40 enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; | 41 enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; |
41 | 42 |
42 | 43 |
43 // ------------------------------------------------------------------------- | 44 // ------------------------------------------------------------------------- |
44 // Reference support | 45 // Reference support |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 147 |
147 // ------------------------------------------------------------------------- | 148 // ------------------------------------------------------------------------- |
148 // CodeGenerator | 149 // CodeGenerator |
149 | 150 |
150 class CodeGenerator: public AstVisitor { | 151 class CodeGenerator: public AstVisitor { |
151 public: | 152 public: |
152 // Takes a function literal, generates code for it. This function should only | 153 // Takes a function literal, generates code for it. This function should only |
153 // be called by compiler.cc. | 154 // be called by compiler.cc. |
154 static Handle<Code> MakeCode(FunctionLiteral* fun, | 155 static Handle<Code> MakeCode(FunctionLiteral* fun, |
155 Handle<Script> script, | 156 Handle<Script> script, |
156 bool is_eval); | 157 bool is_eval, |
| 158 CompilationInfo* info); |
157 | 159 |
158 // Printing of AST, etc. as requested by flags. | 160 // Printing of AST, etc. as requested by flags. |
159 static void MakeCodePrologue(FunctionLiteral* fun); | 161 static void MakeCodePrologue(FunctionLiteral* fun); |
160 | 162 |
161 // Allocate and install the code. | 163 // Allocate and install the code. |
162 static Handle<Code> MakeCodeEpilogue(FunctionLiteral* fun, | 164 static Handle<Code> MakeCodeEpilogue(FunctionLiteral* fun, |
163 MacroAssembler* masm, | 165 MacroAssembler* masm, |
164 Code::Flags flags, | 166 Code::Flags flags, |
165 Handle<Script> script); | 167 Handle<Script> script); |
166 | 168 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // reach the end of the statement (ie, it does not exit via break, | 234 // reach the end of the statement (ie, it does not exit via break, |
233 // continue, return, or throw). This function is used temporarily while | 235 // continue, return, or throw). This function is used temporarily while |
234 // the code generator is being transformed. | 236 // the code generator is being transformed. |
235 inline void VisitAndSpill(Statement* statement); | 237 inline void VisitAndSpill(Statement* statement); |
236 | 238 |
237 // Visit a list of statements and then spill the virtual frame if control | 239 // Visit a list of statements and then spill the virtual frame if control |
238 // flow can reach the end of the list. | 240 // flow can reach the end of the list. |
239 inline void VisitStatementsAndSpill(ZoneList<Statement*>* statements); | 241 inline void VisitStatementsAndSpill(ZoneList<Statement*>* statements); |
240 | 242 |
241 // Main code generation function | 243 // Main code generation function |
242 void GenCode(FunctionLiteral* fun); | 244 void GenCode(FunctionLiteral* fun, CompilationInfo* info); |
243 | 245 |
244 // The following are used by class Reference. | 246 // The following are used by class Reference. |
245 void LoadReference(Reference* ref); | 247 void LoadReference(Reference* ref); |
246 void UnloadReference(Reference* ref); | 248 void UnloadReference(Reference* ref); |
247 | 249 |
248 static MemOperand ContextOperand(Register context, int index) { | 250 static MemOperand ContextOperand(Register context, int index) { |
249 return MemOperand(context, Context::SlotOffset(index)); | 251 return MemOperand(context, Context::SlotOffset(index)); |
250 } | 252 } |
251 | 253 |
252 MemOperand SlotOperand(Slot* slot, Register tmp); | 254 MemOperand SlotOperand(Slot* slot, Register tmp); |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 Major MajorKey() { return StringCompare; } | 547 Major MajorKey() { return StringCompare; } |
546 int MinorKey() { return 0; } | 548 int MinorKey() { return 0; } |
547 | 549 |
548 void Generate(MacroAssembler* masm); | 550 void Generate(MacroAssembler* masm); |
549 }; | 551 }; |
550 | 552 |
551 | 553 |
552 } } // namespace v8::internal | 554 } } // namespace v8::internal |
553 | 555 |
554 #endif // V8_ARM_CODEGEN_ARM_H_ | 556 #endif // V8_ARM_CODEGEN_ARM_H_ |
OLD | NEW |