| 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 25 matching lines...) Expand all Loading... |
| 36 namespace internal { | 36 namespace internal { |
| 37 | 37 |
| 38 // Forward declarations | 38 // Forward declarations |
| 39 class CompilationInfo; | 39 class CompilationInfo; |
| 40 class DeferredCode; | 40 class DeferredCode; |
| 41 class FrameRegisterState; | 41 class FrameRegisterState; |
| 42 class RegisterAllocator; | 42 class RegisterAllocator; |
| 43 class RegisterFile; | 43 class RegisterFile; |
| 44 class RuntimeCallHelper; | 44 class RuntimeCallHelper; |
| 45 | 45 |
| 46 enum InitState { CONST_INIT, NOT_CONST_INIT }; | |
| 47 enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; | |
| 48 | |
| 49 | 46 |
| 50 // ------------------------------------------------------------------------- | 47 // ------------------------------------------------------------------------- |
| 51 // Reference support | 48 // Reference support |
| 52 | 49 |
| 53 // A reference is a C++ stack-allocated object that puts a | 50 // A reference is a C++ stack-allocated object that puts a |
| 54 // reference on the virtual frame. The reference may be consumed | 51 // reference on the virtual frame. The reference may be consumed |
| 55 // by GetValue, TakeValue and SetValue. | 52 // by GetValue, TakeValue and SetValue. |
| 56 // When the lifetime (scope) of a valid reference ends, it must have | 53 // When the lifetime (scope) of a valid reference ends, it must have |
| 57 // been consumed, and be in state UNLOADED. | 54 // been consumed, and be in state UNLOADED. |
| 58 class Reference BASE_EMBEDDED { | 55 class Reference BASE_EMBEDDED { |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 static bool MakeCode(CompilationInfo* info); | 300 static bool MakeCode(CompilationInfo* info); |
| 304 | 301 |
| 305 // Printing of AST, etc. as requested by flags. | 302 // Printing of AST, etc. as requested by flags. |
| 306 static void MakeCodePrologue(CompilationInfo* info); | 303 static void MakeCodePrologue(CompilationInfo* info); |
| 307 | 304 |
| 308 // Allocate and install the code. | 305 // Allocate and install the code. |
| 309 static Handle<Code> MakeCodeEpilogue(MacroAssembler* masm, | 306 static Handle<Code> MakeCodeEpilogue(MacroAssembler* masm, |
| 310 Code::Flags flags, | 307 Code::Flags flags, |
| 311 CompilationInfo* info); | 308 CompilationInfo* info); |
| 312 | 309 |
| 310 // Print the code after compiling it. |
| 311 static void PrintCode(Handle<Code> code, CompilationInfo* info); |
| 312 |
| 313 #ifdef ENABLE_LOGGING_AND_PROFILING | 313 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 314 static bool ShouldGenerateLog(Expression* type); | 314 static bool ShouldGenerateLog(Expression* type); |
| 315 #endif | 315 #endif |
| 316 | 316 |
| 317 static bool RecordPositions(MacroAssembler* masm, | 317 static bool RecordPositions(MacroAssembler* masm, |
| 318 int pos, | 318 int pos, |
| 319 bool right_here = false); | 319 bool right_here = false); |
| 320 | 320 |
| 321 // Accessors | 321 // Accessors |
| 322 MacroAssembler* masm() { return masm_; } | 322 MacroAssembler* masm() { return masm_; } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 void ConvertInt32ResultToSmi(Result* value); | 391 void ConvertInt32ResultToSmi(Result* value); |
| 392 | 392 |
| 393 // Track loop nesting level. | 393 // Track loop nesting level. |
| 394 int loop_nesting() const { return loop_nesting_; } | 394 int loop_nesting() const { return loop_nesting_; } |
| 395 void IncrementLoopNesting() { loop_nesting_++; } | 395 void IncrementLoopNesting() { loop_nesting_++; } |
| 396 void DecrementLoopNesting() { loop_nesting_--; } | 396 void DecrementLoopNesting() { loop_nesting_--; } |
| 397 | 397 |
| 398 // Node visitors. | 398 // Node visitors. |
| 399 void VisitStatements(ZoneList<Statement*>* statements); | 399 void VisitStatements(ZoneList<Statement*>* statements); |
| 400 | 400 |
| 401 virtual void VisitSlot(Slot* node); |
| 401 #define DEF_VISIT(type) \ | 402 #define DEF_VISIT(type) \ |
| 402 void Visit##type(type* node); | 403 virtual void Visit##type(type* node); |
| 403 AST_NODE_LIST(DEF_VISIT) | 404 AST_NODE_LIST(DEF_VISIT) |
| 404 #undef DEF_VISIT | 405 #undef DEF_VISIT |
| 405 | 406 |
| 406 // Visit a statement and then spill the virtual frame if control flow can | 407 // Visit a statement and then spill the virtual frame if control flow can |
| 407 // reach the end of the statement (ie, it does not exit via break, | 408 // reach the end of the statement (ie, it does not exit via break, |
| 408 // continue, return, or throw). This function is used temporarily while | 409 // continue, return, or throw). This function is used temporarily while |
| 409 // the code generator is being transformed. | 410 // the code generator is being transformed. |
| 410 void VisitAndSpill(Statement* statement); | 411 void VisitAndSpill(Statement* statement); |
| 411 | 412 |
| 412 // Visit a list of statements and then spill the virtual frame if control | 413 // Visit a list of statements and then spill the virtual frame if control |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 int jit_cookie_; | 778 int jit_cookie_; |
| 778 | 779 |
| 779 friend class VirtualFrame; | 780 friend class VirtualFrame; |
| 780 friend class Isolate; | 781 friend class Isolate; |
| 781 friend class JumpTarget; | 782 friend class JumpTarget; |
| 782 friend class Reference; | 783 friend class Reference; |
| 783 friend class Result; | 784 friend class Result; |
| 784 friend class FastCodeGenerator; | 785 friend class FastCodeGenerator; |
| 785 friend class FullCodeGenerator; | 786 friend class FullCodeGenerator; |
| 786 friend class FullCodeGenSyntaxChecker; | 787 friend class FullCodeGenSyntaxChecker; |
| 788 friend class LCodeGen; |
| 787 | 789 |
| 788 friend class CodeGeneratorPatcher; // Used in test-log-stack-tracer.cc | 790 friend class CodeGeneratorPatcher; // Used in test-log-stack-tracer.cc |
| 789 friend class InlineRuntimeFunctionsTable; | 791 friend class InlineRuntimeFunctionsTable; |
| 790 | 792 |
| 791 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 793 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
| 792 }; | 794 }; |
| 793 | 795 |
| 794 | 796 |
| 795 } } // namespace v8::internal | 797 } } // namespace v8::internal |
| 796 | 798 |
| 797 #endif // V8_IA32_CODEGEN_IA32_H_ | 799 #endif // V8_IA32_CODEGEN_IA32_H_ |
| OLD | NEW |