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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 // An optimized implementation of expressions of the form | 539 // An optimized implementation of expressions of the form |
540 // x.apply(y, arguments). We call x the applicand and y the receiver. | 540 // x.apply(y, arguments). We call x the applicand and y the receiver. |
541 // The optimization avoids allocating an arguments object if possible. | 541 // The optimization avoids allocating an arguments object if possible. |
542 void CallApplyLazy(Expression* applicand, | 542 void CallApplyLazy(Expression* applicand, |
543 Expression* receiver, | 543 Expression* receiver, |
544 VariableProxy* arguments, | 544 VariableProxy* arguments, |
545 int position); | 545 int position); |
546 | 546 |
547 void CheckStack(); | 547 void CheckStack(); |
548 | 548 |
549 struct InlineRuntimeLUT { | 549 static InlineRuntimeFunctionsTable::Entry* FindInlineRuntimeLUT( |
550 void (CodeGenerator::*method)(ZoneList<Expression*>*); | 550 Handle<String> name); |
551 const char* name; | 551 |
552 int nargs; | |
553 }; | |
554 static InlineRuntimeLUT* FindInlineRuntimeLUT(Handle<String> name); | |
555 bool CheckForInlineRuntimeCall(CallRuntime* node); | 552 bool CheckForInlineRuntimeCall(CallRuntime* node); |
556 static bool PatchInlineRuntimeEntry(Handle<String> name, | 553 static bool PatchInlineRuntimeEntry( |
557 const InlineRuntimeLUT& new_entry, | 554 Handle<String> name, |
558 InlineRuntimeLUT* old_entry); | 555 const InlineRuntimeFunctionsTable::Entry& new_entry, |
| 556 InlineRuntimeFunctionsTable::Entry* old_entry); |
559 void ProcessDeclarations(ZoneList<Declaration*>* declarations); | 557 void ProcessDeclarations(ZoneList<Declaration*>* declarations); |
560 | 558 |
561 static Handle<Code> ComputeCallInitialize(int argc, InLoopFlag in_loop); | 559 static Handle<Code> ComputeCallInitialize(int argc, InLoopFlag in_loop); |
562 | 560 |
563 static Handle<Code> ComputeKeyedCallInitialize(int argc, InLoopFlag in_loop); | 561 static Handle<Code> ComputeKeyedCallInitialize(int argc, InLoopFlag in_loop); |
564 | 562 |
565 // Declare global variables and functions in the given array of | 563 // Declare global variables and functions in the given array of |
566 // name/value pairs. | 564 // name/value pairs. |
567 void DeclareGlobals(Handle<FixedArray> pairs); | 565 void DeclareGlobals(Handle<FixedArray> pairs); |
568 | 566 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 // function_return_ does not jump to the true function return, but rather | 687 // function_return_ does not jump to the true function return, but rather |
690 // to some unlinking code). | 688 // to some unlinking code). |
691 bool function_return_is_shadowed_; | 689 bool function_return_is_shadowed_; |
692 | 690 |
693 // True when we are in code that expects the virtual frame to be fully | 691 // True when we are in code that expects the virtual frame to be fully |
694 // spilled. Some virtual frame function are disabled in DEBUG builds when | 692 // spilled. Some virtual frame function are disabled in DEBUG builds when |
695 // called from spilled code, because they do not leave the virtual frame | 693 // called from spilled code, because they do not leave the virtual frame |
696 // in a spilled state. | 694 // in a spilled state. |
697 bool in_spilled_code_; | 695 bool in_spilled_code_; |
698 | 696 |
699 static InlineRuntimeLUT kInlineRuntimeLUT[]; | |
700 | |
701 friend class VirtualFrame; | 697 friend class VirtualFrame; |
| 698 friend class Isolate; |
702 friend class JumpTarget; | 699 friend class JumpTarget; |
703 friend class Reference; | 700 friend class Reference; |
704 friend class Result; | 701 friend class Result; |
705 friend class FastCodeGenerator; | 702 friend class FastCodeGenerator; |
706 friend class FullCodeGenerator; | 703 friend class FullCodeGenerator; |
707 friend class FullCodeGenSyntaxChecker; | 704 friend class FullCodeGenSyntaxChecker; |
708 | 705 |
709 friend class CodeGeneratorPatcher; // Used in test-log-stack-tracer.cc | 706 friend class CodeGeneratorPatcher; // Used in test-log-stack-tracer.cc |
| 707 friend class InlineRuntimeFunctionsTable; |
710 | 708 |
711 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 709 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
712 }; | 710 }; |
713 | 711 |
714 | 712 |
715 // Compute a transcendental math function natively, or call the | 713 // Compute a transcendental math function natively, or call the |
716 // TranscendentalCache runtime function. | 714 // TranscendentalCache runtime function. |
717 class TranscendentalCacheStub: public CodeStub { | 715 class TranscendentalCacheStub: public CodeStub { |
718 public: | 716 public: |
719 explicit TranscendentalCacheStub(TranscendentalCache::Type type) | 717 explicit TranscendentalCacheStub(TranscendentalCache::Type type) |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 return ObjectBits::encode(object_.code()) | | 1045 return ObjectBits::encode(object_.code()) | |
1048 AddressBits::encode(addr_.code()) | | 1046 AddressBits::encode(addr_.code()) | |
1049 ScratchBits::encode(scratch_.code()); | 1047 ScratchBits::encode(scratch_.code()); |
1050 } | 1048 } |
1051 }; | 1049 }; |
1052 | 1050 |
1053 | 1051 |
1054 } } // namespace v8::internal | 1052 } } // namespace v8::internal |
1055 | 1053 |
1056 #endif // V8_X64_CODEGEN_X64_H_ | 1054 #endif // V8_X64_CODEGEN_X64_H_ |
OLD | NEW |