| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 Label* miss_label, | 433 Label* miss_label, |
| 434 bool support_wrappers); | 434 bool support_wrappers); |
| 435 | 435 |
| 436 static void GenerateLoadFunctionPrototype(MacroAssembler* masm, | 436 static void GenerateLoadFunctionPrototype(MacroAssembler* masm, |
| 437 Register receiver, | 437 Register receiver, |
| 438 Register scratch1, | 438 Register scratch1, |
| 439 Register scratch2, | 439 Register scratch2, |
| 440 Label* miss_label); | 440 Label* miss_label); |
| 441 | 441 |
| 442 static void GenerateStoreField(MacroAssembler* masm, | 442 static void GenerateStoreField(MacroAssembler* masm, |
| 443 JSObject* object, | 443 Handle<JSObject> object, |
| 444 int index, | 444 int index, |
| 445 Map* transition, | 445 Handle<Map> transition, |
| 446 Register receiver_reg, | 446 Register receiver_reg, |
| 447 Register name_reg, | 447 Register name_reg, |
| 448 Register scratch, | 448 Register scratch, |
| 449 Label* miss_label); | 449 Label* miss_label); |
| 450 | 450 |
| 451 static void GenerateLoadMiss(MacroAssembler* masm, | 451 static void GenerateLoadMiss(MacroAssembler* masm, |
| 452 Code::Kind kind); | 452 Code::Kind kind); |
| 453 | 453 |
| 454 static void GenerateKeyedLoadMissForceGeneric(MacroAssembler* masm); | 454 static void GenerateKeyedLoadMissForceGeneric(MacroAssembler* masm); |
| 455 | 455 |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 ElementsKind elements_kind); | 681 ElementsKind elements_kind); |
| 682 | 682 |
| 683 static void GenerateLoadFastElement(MacroAssembler* masm); | 683 static void GenerateLoadFastElement(MacroAssembler* masm); |
| 684 | 684 |
| 685 static void GenerateLoadFastDoubleElement(MacroAssembler* masm); | 685 static void GenerateLoadFastDoubleElement(MacroAssembler* masm); |
| 686 | 686 |
| 687 static void GenerateLoadDictionaryElement(MacroAssembler* masm); | 687 static void GenerateLoadDictionaryElement(MacroAssembler* masm); |
| 688 | 688 |
| 689 private: | 689 private: |
| 690 MaybeObject* TryGetCode(PropertyType type, | 690 MaybeObject* TryGetCode(PropertyType type, |
| 691 String* name, | 691 String* name, |
| 692 InlineCacheState state = MONOMORPHIC); | 692 InlineCacheState state = MONOMORPHIC); |
| 693 | 693 |
| 694 Handle<Code> GetCode(PropertyType type, | 694 Handle<Code> GetCode(PropertyType type, |
| 695 Handle<String> name, | 695 Handle<String> name, |
| 696 InlineCacheState state = MONOMORPHIC); | 696 InlineCacheState state = MONOMORPHIC); |
| 697 }; | 697 }; |
| 698 | 698 |
| 699 | 699 |
| 700 class StoreStubCompiler: public StubCompiler { | 700 class StoreStubCompiler: public StubCompiler { |
| 701 public: | 701 public: |
| 702 StoreStubCompiler(Isolate* isolate, StrictModeFlag strict_mode) | 702 StoreStubCompiler(Isolate* isolate, StrictModeFlag strict_mode) |
| 703 : StubCompiler(isolate), strict_mode_(strict_mode) { } | 703 : StubCompiler(isolate), strict_mode_(strict_mode) { } |
| 704 | 704 |
| 705 | 705 |
| 706 Handle<Code> CompileStoreField(Handle<JSObject> object, | 706 Handle<Code> CompileStoreField(Handle<JSObject> object, |
| 707 int index, | 707 int index, |
| 708 Handle<Map> transition, | 708 Handle<Map> transition, |
| 709 Handle<String> name); | 709 Handle<String> name); |
| 710 | 710 |
| 711 MUST_USE_RESULT MaybeObject* CompileStoreField(JSObject* object, | |
| 712 int index, | |
| 713 Map* transition, | |
| 714 String* name); | |
| 715 | |
| 716 Handle<Code> CompileStoreCallback(Handle<JSObject> object, | 711 Handle<Code> CompileStoreCallback(Handle<JSObject> object, |
| 717 Handle<AccessorInfo> callback, | 712 Handle<AccessorInfo> callback, |
| 718 Handle<String> name); | 713 Handle<String> name); |
| 719 | 714 |
| 720 MUST_USE_RESULT MaybeObject* CompileStoreCallback(JSObject* object, | 715 MUST_USE_RESULT MaybeObject* CompileStoreCallback(JSObject* object, |
| 721 AccessorInfo* callback, | 716 AccessorInfo* callback, |
| 722 String* name); | 717 String* name); |
| 723 Handle<Code> CompileStoreInterceptor(Handle<JSObject> object, | 718 Handle<Code> CompileStoreInterceptor(Handle<JSObject> object, |
| 724 Handle<String> name); | 719 Handle<String> name); |
| 725 | 720 |
| 726 MUST_USE_RESULT MaybeObject* CompileStoreInterceptor(JSObject* object, | 721 MUST_USE_RESULT MaybeObject* CompileStoreInterceptor(JSObject* object, |
| 727 String* name); | 722 String* name); |
| 728 | 723 |
| 729 Handle<Code> CompileStoreGlobal(Handle<GlobalObject> object, | 724 Handle<Code> CompileStoreGlobal(Handle<GlobalObject> object, |
| 730 Handle<JSGlobalPropertyCell> holder, | 725 Handle<JSGlobalPropertyCell> holder, |
| 731 Handle<String> name); | 726 Handle<String> name); |
| 732 | 727 |
| 733 MUST_USE_RESULT MaybeObject* CompileStoreGlobal(GlobalObject* object, | 728 private: |
| 734 JSGlobalPropertyCell* holder, | 729 MaybeObject* TryGetCode(PropertyType type, String* name); |
| 735 String* name); | |
| 736 | 730 |
| 737 | 731 Handle<Code> GetCode(PropertyType type, Handle<String> name); |
| 738 private: | |
| 739 MaybeObject* GetCode(PropertyType type, String* name); | |
| 740 | 732 |
| 741 StrictModeFlag strict_mode_; | 733 StrictModeFlag strict_mode_; |
| 742 }; | 734 }; |
| 743 | 735 |
| 744 | 736 |
| 745 class KeyedStoreStubCompiler: public StubCompiler { | 737 class KeyedStoreStubCompiler: public StubCompiler { |
| 746 public: | 738 public: |
| 747 KeyedStoreStubCompiler(Isolate* isolate, StrictModeFlag strict_mode) | 739 KeyedStoreStubCompiler(Isolate* isolate, StrictModeFlag strict_mode) |
| 748 : StubCompiler(isolate), strict_mode_(strict_mode) { } | 740 : StubCompiler(isolate), strict_mode_(strict_mode) { } |
| 749 | 741 |
| 750 Handle<Code> CompileStoreField(Handle<JSObject> object, | 742 Handle<Code> CompileStoreField(Handle<JSObject> object, |
| 751 int index, | 743 int index, |
| 752 Handle<Map> transition, | 744 Handle<Map> transition, |
| 753 Handle<String> name); | 745 Handle<String> name); |
| 754 | 746 |
| 755 MUST_USE_RESULT MaybeObject* CompileStoreField(JSObject* object, | |
| 756 int index, | |
| 757 Map* transition, | |
| 758 String* name); | |
| 759 | |
| 760 Handle<Code> CompileStoreElement(Handle<Map> receiver_map); | 747 Handle<Code> CompileStoreElement(Handle<Map> receiver_map); |
| 761 | 748 |
| 762 MUST_USE_RESULT MaybeObject* CompileStoreElement(Map* receiver_map); | |
| 763 | |
| 764 Handle<Code> CompileStorePolymorphic(MapHandleList* receiver_maps, | 749 Handle<Code> CompileStorePolymorphic(MapHandleList* receiver_maps, |
| 765 CodeHandleList* handler_stubs, | 750 CodeHandleList* handler_stubs, |
| 766 MapHandleList* transitioned_maps); | 751 MapHandleList* transitioned_maps); |
| 767 | 752 |
| 768 MUST_USE_RESULT MaybeObject* CompileStorePolymorphic( | |
| 769 MapList* receiver_maps, | |
| 770 CodeList* handler_stubs, | |
| 771 MapList* transitioned_maps); | |
| 772 | |
| 773 static void GenerateStoreFastElement(MacroAssembler* masm, | 753 static void GenerateStoreFastElement(MacroAssembler* masm, |
| 774 bool is_js_array, | 754 bool is_js_array, |
| 775 ElementsKind element_kind); | 755 ElementsKind element_kind); |
| 776 | 756 |
| 777 static void GenerateStoreFastDoubleElement(MacroAssembler* masm, | 757 static void GenerateStoreFastDoubleElement(MacroAssembler* masm, |
| 778 bool is_js_array); | 758 bool is_js_array); |
| 779 | 759 |
| 780 static void GenerateStoreExternalArray(MacroAssembler* masm, | 760 static void GenerateStoreExternalArray(MacroAssembler* masm, |
| 781 ElementsKind elements_kind); | 761 ElementsKind elements_kind); |
| 782 | 762 |
| 783 static void GenerateStoreDictionaryElement(MacroAssembler* masm); | 763 static void GenerateStoreDictionaryElement(MacroAssembler* masm); |
| 784 | 764 |
| 785 private: | 765 private: |
| 786 MaybeObject* GetCode(PropertyType type, | 766 Handle<Code> GetCode(PropertyType type, |
| 787 String* name, | 767 Handle<String> name, |
| 788 InlineCacheState state = MONOMORPHIC); | 768 InlineCacheState state = MONOMORPHIC); |
| 789 | 769 |
| 790 StrictModeFlag strict_mode_; | 770 StrictModeFlag strict_mode_; |
| 791 }; | 771 }; |
| 792 | 772 |
| 793 | 773 |
| 794 // Subset of FUNCTIONS_WITH_ID_LIST with custom constant/global call | 774 // Subset of FUNCTIONS_WITH_ID_LIST with custom constant/global call |
| 795 // IC stubs. | 775 // IC stubs. |
| 796 #define CUSTOM_CALL_IC_GENERATORS(V) \ | 776 #define CUSTOM_CALL_IC_GENERATORS(V) \ |
| 797 V(ArrayPush) \ | 777 V(ArrayPush) \ |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 JSFunction* constant_function_; | 952 JSFunction* constant_function_; |
| 973 bool is_simple_api_call_; | 953 bool is_simple_api_call_; |
| 974 FunctionTemplateInfo* expected_receiver_type_; | 954 FunctionTemplateInfo* expected_receiver_type_; |
| 975 CallHandlerInfo* api_call_info_; | 955 CallHandlerInfo* api_call_info_; |
| 976 }; | 956 }; |
| 977 | 957 |
| 978 | 958 |
| 979 } } // namespace v8::internal | 959 } } // namespace v8::internal |
| 980 | 960 |
| 981 #endif // V8_STUB_CACHE_H_ | 961 #endif // V8_STUB_CACHE_H_ |
| OLD | NEW |