| 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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 // An optimized implementation of expressions of the form | 583 // An optimized implementation of expressions of the form |
| 584 // x.apply(y, arguments). We call x the applicand and y the receiver. | 584 // x.apply(y, arguments). We call x the applicand and y the receiver. |
| 585 // The optimization avoids allocating an arguments object if possible. | 585 // The optimization avoids allocating an arguments object if possible. |
| 586 void CallApplyLazy(Expression* applicand, | 586 void CallApplyLazy(Expression* applicand, |
| 587 Expression* receiver, | 587 Expression* receiver, |
| 588 VariableProxy* arguments, | 588 VariableProxy* arguments, |
| 589 int position); | 589 int position); |
| 590 | 590 |
| 591 void CheckStack(); | 591 void CheckStack(); |
| 592 | 592 |
| 593 struct InlineRuntimeLUT { | 593 static InlineRuntimeFunctionsTable::Entry* FindInlineRuntimeLUT( |
| 594 void (CodeGenerator::*method)(ZoneList<Expression*>*); | 594 Handle<String> name); |
| 595 const char* name; | |
| 596 int nargs; | |
| 597 }; | |
| 598 | |
| 599 static InlineRuntimeLUT* FindInlineRuntimeLUT(Handle<String> name); | |
| 600 bool CheckForInlineRuntimeCall(CallRuntime* node); | 595 bool CheckForInlineRuntimeCall(CallRuntime* node); |
| 601 static bool PatchInlineRuntimeEntry(Handle<String> name, | 596 static bool PatchInlineRuntimeEntry( |
| 602 const InlineRuntimeLUT& new_entry, | 597 Handle<String> name, |
| 603 InlineRuntimeLUT* old_entry); | 598 const InlineRuntimeFunctionsTable::Entry& new_entry, |
| 599 InlineRuntimeFunctionsTable::Entry* old_entry); |
| 604 | 600 |
| 605 void ProcessDeclarations(ZoneList<Declaration*>* declarations); | 601 void ProcessDeclarations(ZoneList<Declaration*>* declarations); |
| 606 | 602 |
| 607 static Handle<Code> ComputeCallInitialize(int argc, InLoopFlag in_loop); | 603 static Handle<Code> ComputeCallInitialize(int argc, InLoopFlag in_loop); |
| 608 | 604 |
| 609 static Handle<Code> ComputeKeyedCallInitialize(int argc, InLoopFlag in_loop); | 605 static Handle<Code> ComputeKeyedCallInitialize(int argc, InLoopFlag in_loop); |
| 610 | 606 |
| 611 // Declare global variables and functions in the given array of | 607 // Declare global variables and functions in the given array of |
| 612 // name/value pairs. | 608 // name/value pairs. |
| 613 void DeclareGlobals(Handle<FixedArray> pairs); | 609 void DeclareGlobals(Handle<FixedArray> pairs); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 // function_return_ does not jump to the true function return, but rather | 735 // function_return_ does not jump to the true function return, but rather |
| 740 // to some unlinking code). | 736 // to some unlinking code). |
| 741 bool function_return_is_shadowed_; | 737 bool function_return_is_shadowed_; |
| 742 | 738 |
| 743 // True when we are in code that expects the virtual frame to be fully | 739 // True when we are in code that expects the virtual frame to be fully |
| 744 // spilled. Some virtual frame function are disabled in DEBUG builds when | 740 // spilled. Some virtual frame function are disabled in DEBUG builds when |
| 745 // called from spilled code, because they do not leave the virtual frame | 741 // called from spilled code, because they do not leave the virtual frame |
| 746 // in a spilled state. | 742 // in a spilled state. |
| 747 bool in_spilled_code_; | 743 bool in_spilled_code_; |
| 748 | 744 |
| 749 static InlineRuntimeLUT kInlineRuntimeLUT[]; | |
| 750 | |
| 751 friend class VirtualFrame; | 745 friend class VirtualFrame; |
| 746 friend class Isolate; |
| 752 friend class JumpTarget; | 747 friend class JumpTarget; |
| 753 friend class Reference; | 748 friend class Reference; |
| 754 friend class Result; | 749 friend class Result; |
| 755 friend class FastCodeGenerator; | 750 friend class FastCodeGenerator; |
| 756 friend class FullCodeGenerator; | 751 friend class FullCodeGenerator; |
| 757 friend class FullCodeGenSyntaxChecker; | 752 friend class FullCodeGenSyntaxChecker; |
| 758 | 753 |
| 759 friend class CodeGeneratorPatcher; // Used in test-log-stack-tracer.cc | 754 friend class CodeGeneratorPatcher; // Used in test-log-stack-tracer.cc |
| 755 friend class InlineRuntimeFunctionsTable; |
| 760 | 756 |
| 761 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 757 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
| 762 }; | 758 }; |
| 763 | 759 |
| 764 | 760 |
| 765 // Compute a transcendental math function natively, or call the | 761 // Compute a transcendental math function natively, or call the |
| 766 // TranscendentalCache runtime function. | 762 // TranscendentalCache runtime function. |
| 767 class TranscendentalCacheStub: public CodeStub { | 763 class TranscendentalCacheStub: public CodeStub { |
| 768 public: | 764 public: |
| 769 explicit TranscendentalCacheStub(TranscendentalCache::Type type) | 765 explicit TranscendentalCacheStub(TranscendentalCache::Type type) |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 void Print() { | 1063 void Print() { |
| 1068 PrintF("NumberToStringStub\n"); | 1064 PrintF("NumberToStringStub\n"); |
| 1069 } | 1065 } |
| 1070 #endif | 1066 #endif |
| 1071 }; | 1067 }; |
| 1072 | 1068 |
| 1073 | 1069 |
| 1074 } } // namespace v8::internal | 1070 } } // namespace v8::internal |
| 1075 | 1071 |
| 1076 #endif // V8_IA32_CODEGEN_IA32_H_ | 1072 #endif // V8_IA32_CODEGEN_IA32_H_ |
| OLD | NEW |