| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 #define CUSTOM_CALL_IC_GENERATORS(V) \ | 686 #define CUSTOM_CALL_IC_GENERATORS(V) \ |
| 687 V(ArrayPush) \ | 687 V(ArrayPush) \ |
| 688 V(ArrayPop) \ | 688 V(ArrayPop) \ |
| 689 V(StringCharCodeAt) \ | 689 V(StringCharCodeAt) \ |
| 690 V(StringCharAt) \ | 690 V(StringCharAt) \ |
| 691 V(StringFromCharCode) \ | 691 V(StringFromCharCode) \ |
| 692 V(MathFloor) \ | 692 V(MathFloor) \ |
| 693 V(MathAbs) | 693 V(MathAbs) |
| 694 | 694 |
| 695 | 695 |
| 696 class CallOptimization; |
| 697 |
| 696 class CallStubCompiler: public StubCompiler { | 698 class CallStubCompiler: public StubCompiler { |
| 697 public: | 699 public: |
| 698 CallStubCompiler(int argc, | 700 CallStubCompiler(int argc, |
| 699 InLoopFlag in_loop, | 701 InLoopFlag in_loop, |
| 700 Code::Kind kind, | 702 Code::Kind kind, |
| 701 Code::ExtraICState extra_ic_state, | 703 Code::ExtraICState extra_ic_state, |
| 702 InlineCacheHolderFlag cache_holder); | 704 InlineCacheHolderFlag cache_holder); |
| 703 | 705 |
| 704 MUST_USE_RESULT MaybeObject* CompileCallField(JSObject* object, | 706 MUST_USE_RESULT MaybeObject* CompileCallField(JSObject* object, |
| 705 JSObject* holder, | 707 JSObject* holder, |
| 706 int index, | 708 int index, |
| 707 String* name); | 709 String* name); |
| 708 MUST_USE_RESULT MaybeObject* CompileCallConstant(Object* object, | 710 MUST_USE_RESULT MaybeObject* CompileCallConstant(Object* object, |
| 709 JSObject* holder, | 711 JSObject* holder, |
| 710 JSFunction* function, | 712 JSFunction* function, |
| 711 String* name, | 713 String* name, |
| 712 CheckType check); | 714 CheckType check); |
| 713 MUST_USE_RESULT MaybeObject* CompileCallInterceptor(JSObject* object, | 715 MUST_USE_RESULT MaybeObject* CompileCallInterceptor(JSObject* object, |
| 714 JSObject* holder, | 716 JSObject* holder, |
| 715 String* name); | 717 String* name); |
| 716 MUST_USE_RESULT MaybeObject* CompileCallGlobal(JSObject* object, | 718 MUST_USE_RESULT MaybeObject* CompileCallGlobal(JSObject* object, |
| 717 GlobalObject* holder, | 719 GlobalObject* holder, |
| 718 JSGlobalPropertyCell* cell, | 720 JSGlobalPropertyCell* cell, |
| 719 JSFunction* function, | 721 JSFunction* function, |
| 720 String* name); | 722 String* name); |
| 721 | 723 |
| 722 static bool HasCustomCallGenerator(BuiltinFunctionId id); | 724 static bool HasCustomCallGenerator(JSFunction* function); |
| 723 | 725 |
| 724 private: | 726 private: |
| 725 // Compiles a custom call constant/global IC. For constant calls | 727 // Compiles a custom call constant/global IC. For constant calls |
| 726 // cell is NULL. Returns undefined if there is no custom call code | 728 // cell is NULL. Returns undefined if there is no custom call code |
| 727 // for the given function or it can't be generated. | 729 // for the given function or it can't be generated. |
| 728 MUST_USE_RESULT MaybeObject* CompileCustomCall(BuiltinFunctionId id, | 730 MUST_USE_RESULT MaybeObject* CompileCustomCall(Object* object, |
| 729 Object* object, | |
| 730 JSObject* holder, | 731 JSObject* holder, |
| 731 JSGlobalPropertyCell* cell, | 732 JSGlobalPropertyCell* cell, |
| 732 JSFunction* function, | 733 JSFunction* function, |
| 733 String* name); | 734 String* name); |
| 734 | 735 |
| 735 #define DECLARE_CALL_GENERATOR(name) \ | 736 #define DECLARE_CALL_GENERATOR(name) \ |
| 736 MUST_USE_RESULT MaybeObject* Compile##name##Call(Object* object, \ | 737 MUST_USE_RESULT MaybeObject* Compile##name##Call(Object* object, \ |
| 737 JSObject* holder, \ | 738 JSObject* holder, \ |
| 738 JSGlobalPropertyCell* cell, \ | 739 JSGlobalPropertyCell* cell, \ |
| 739 JSFunction* function, \ | 740 JSFunction* function, \ |
| 740 String* fname); | 741 String* fname); |
| 741 CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR) | 742 CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR) |
| 742 #undef DECLARE_CALL_GENERATOR | 743 #undef DECLARE_CALL_GENERATOR |
| 743 | 744 |
| 745 MUST_USE_RESULT MaybeObject* CompileFastApiCall( |
| 746 const CallOptimization& optimization, |
| 747 Object* object, |
| 748 JSObject* holder, |
| 749 JSGlobalPropertyCell* cell, |
| 750 JSFunction* function, |
| 751 String* name); |
| 752 |
| 744 const ParameterCount arguments_; | 753 const ParameterCount arguments_; |
| 745 const InLoopFlag in_loop_; | 754 const InLoopFlag in_loop_; |
| 746 const Code::Kind kind_; | 755 const Code::Kind kind_; |
| 747 const Code::ExtraICState extra_ic_state_; | 756 const Code::ExtraICState extra_ic_state_; |
| 748 const InlineCacheHolderFlag cache_holder_; | 757 const InlineCacheHolderFlag cache_holder_; |
| 749 | 758 |
| 750 const ParameterCount& arguments() { return arguments_; } | 759 const ParameterCount& arguments() { return arguments_; } |
| 751 | 760 |
| 752 MUST_USE_RESULT MaybeObject* GetCode(PropertyType type, String* name); | 761 MUST_USE_RESULT MaybeObject* GetCode(PropertyType type, String* name); |
| 753 | 762 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 MUST_USE_RESULT MaybeObject* CompileKeyedStoreStub( | 852 MUST_USE_RESULT MaybeObject* CompileKeyedStoreStub( |
| 844 JSObject* receiver, ExternalArrayType array_type, Code::Flags flags); | 853 JSObject* receiver, ExternalArrayType array_type, Code::Flags flags); |
| 845 | 854 |
| 846 private: | 855 private: |
| 847 MaybeObject* GetCode(Code::Flags flags); | 856 MaybeObject* GetCode(Code::Flags flags); |
| 848 }; | 857 }; |
| 849 | 858 |
| 850 } } // namespace v8::internal | 859 } } // namespace v8::internal |
| 851 | 860 |
| 852 #endif // V8_STUB_CACHE_H_ | 861 #endif // V8_STUB_CACHE_H_ |
| OLD | NEW |