| 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_IA32_CODEGEN_IA32_H_ | 28 #ifndef V8_IA32_CODEGEN_IA32_H_ |
| 29 #define V8_IA32_CODEGEN_IA32_H_ | 29 #define V8_IA32_CODEGEN_IA32_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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 291 |
| 291 // ------------------------------------------------------------------------- | 292 // ------------------------------------------------------------------------- |
| 292 // CodeGenerator | 293 // CodeGenerator |
| 293 | 294 |
| 294 class CodeGenerator: public AstVisitor { | 295 class CodeGenerator: public AstVisitor { |
| 295 public: | 296 public: |
| 296 // Takes a function literal, generates code for it. This function should only | 297 // Takes a function literal, generates code for it. This function should only |
| 297 // be called by compiler.cc. | 298 // be called by compiler.cc. |
| 298 static Handle<Code> MakeCode(FunctionLiteral* fun, | 299 static Handle<Code> MakeCode(FunctionLiteral* fun, |
| 299 Handle<Script> script, | 300 Handle<Script> script, |
| 300 bool is_eval); | 301 bool is_eval, |
| 302 CompilationInfo* info); |
| 301 | 303 |
| 302 // Printing of AST, etc. as requested by flags. | 304 // Printing of AST, etc. as requested by flags. |
| 303 static void MakeCodePrologue(FunctionLiteral* fun); | 305 static void MakeCodePrologue(FunctionLiteral* fun); |
| 304 | 306 |
| 305 // Allocate and install the code. | 307 // Allocate and install the code. |
| 306 static Handle<Code> MakeCodeEpilogue(FunctionLiteral* fun, | 308 static Handle<Code> MakeCodeEpilogue(FunctionLiteral* fun, |
| 307 MacroAssembler* masm, | 309 MacroAssembler* masm, |
| 308 Code::Flags flags, | 310 Code::Flags flags, |
| 309 Handle<Script> script); | 311 Handle<Script> script); |
| 310 | 312 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 // reach the end of the statement (ie, it does not exit via break, | 373 // reach the end of the statement (ie, it does not exit via break, |
| 372 // continue, return, or throw). This function is used temporarily while | 374 // continue, return, or throw). This function is used temporarily while |
| 373 // the code generator is being transformed. | 375 // the code generator is being transformed. |
| 374 void VisitAndSpill(Statement* statement); | 376 void VisitAndSpill(Statement* statement); |
| 375 | 377 |
| 376 // Visit a list of statements and then spill the virtual frame if control | 378 // Visit a list of statements and then spill the virtual frame if control |
| 377 // flow can reach the end of the list. | 379 // flow can reach the end of the list. |
| 378 void VisitStatementsAndSpill(ZoneList<Statement*>* statements); | 380 void VisitStatementsAndSpill(ZoneList<Statement*>* statements); |
| 379 | 381 |
| 380 // Main code generation function | 382 // Main code generation function |
| 381 void GenCode(FunctionLiteral* fun); | 383 void GenCode(FunctionLiteral* fun, CompilationInfo* info); |
| 382 | 384 |
| 383 // Generate the return sequence code. Should be called no more than | 385 // Generate the return sequence code. Should be called no more than |
| 384 // once per compiled function, immediately after binding the return | 386 // once per compiled function, immediately after binding the return |
| 385 // target (which can not be done more than once). | 387 // target (which can not be done more than once). |
| 386 void GenerateReturnSequence(Result* return_value); | 388 void GenerateReturnSequence(Result* return_value); |
| 387 | 389 |
| 388 // Returns the arguments allocation mode. | 390 // Returns the arguments allocation mode. |
| 389 ArgumentsAllocationMode ArgumentsMode() const; | 391 ArgumentsAllocationMode ArgumentsMode() const; |
| 390 | 392 |
| 391 // Store the arguments object and allocate it if necessary. | 393 // Store the arguments object and allocate it if necessary. |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 Major MajorKey() { return StringCompare; } | 820 Major MajorKey() { return StringCompare; } |
| 819 int MinorKey() { return 0; } | 821 int MinorKey() { return 0; } |
| 820 | 822 |
| 821 void Generate(MacroAssembler* masm); | 823 void Generate(MacroAssembler* masm); |
| 822 }; | 824 }; |
| 823 | 825 |
| 824 | 826 |
| 825 } } // namespace v8::internal | 827 } } // namespace v8::internal |
| 826 | 828 |
| 827 #endif // V8_IA32_CODEGEN_IA32_H_ | 829 #endif // V8_IA32_CODEGEN_IA32_H_ |
| OLD | NEW |