| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 Handle<Code> CompileMonomorphicIC(Handle<Type> type, | 547 Handle<Code> CompileMonomorphicIC(Handle<Type> type, |
| 548 Handle<Code> handler, | 548 Handle<Code> handler, |
| 549 Handle<Name> name); | 549 Handle<Name> name); |
| 550 | 550 |
| 551 Handle<Code> CompilePolymorphicIC(TypeHandleList* types, | 551 Handle<Code> CompilePolymorphicIC(TypeHandleList* types, |
| 552 CodeHandleList* handlers, | 552 CodeHandleList* handlers, |
| 553 Handle<Name> name, | 553 Handle<Name> name, |
| 554 Code::StubType type, | 554 Code::StubType type, |
| 555 IcCheckType check); | 555 IcCheckType check); |
| 556 | 556 |
| 557 virtual void GenerateNameCheck(Handle<Name> name, | |
| 558 Register name_reg, | |
| 559 Label* miss) { } | |
| 560 | |
| 561 static Builtins::Name MissBuiltin(Code::Kind kind) { | 557 static Builtins::Name MissBuiltin(Code::Kind kind) { |
| 562 switch (kind) { | 558 switch (kind) { |
| 563 case Code::LOAD_IC: return Builtins::kLoadIC_Miss; | 559 case Code::LOAD_IC: return Builtins::kLoadIC_Miss; |
| 564 case Code::STORE_IC: return Builtins::kStoreIC_Miss; | 560 case Code::STORE_IC: return Builtins::kStoreIC_Miss; |
| 565 case Code::KEYED_LOAD_IC: return Builtins::kKeyedLoadIC_Miss; | 561 case Code::KEYED_LOAD_IC: return Builtins::kKeyedLoadIC_Miss; |
| 566 case Code::KEYED_STORE_IC: return Builtins::kKeyedStoreIC_Miss; | 562 case Code::KEYED_STORE_IC: return Builtins::kKeyedStoreIC_Miss; |
| 567 default: UNREACHABLE(); | 563 default: UNREACHABLE(); |
| 568 } | 564 } |
| 569 return Builtins::kLoadIC_Miss; | 565 return Builtins::kLoadIC_Miss; |
| 570 } | 566 } |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 : LoadStubCompiler(isolate, extra_ic_state, cache_holder, | 736 : LoadStubCompiler(isolate, extra_ic_state, cache_holder, |
| 741 Code::KEYED_LOAD_IC) { } | 737 Code::KEYED_LOAD_IC) { } |
| 742 | 738 |
| 743 Handle<Code> CompileLoadElement(Handle<Map> receiver_map); | 739 Handle<Code> CompileLoadElement(Handle<Map> receiver_map); |
| 744 | 740 |
| 745 void CompileElementHandlers(MapHandleList* receiver_maps, | 741 void CompileElementHandlers(MapHandleList* receiver_maps, |
| 746 CodeHandleList* handlers); | 742 CodeHandleList* handlers); |
| 747 | 743 |
| 748 static void GenerateLoadDictionaryElement(MacroAssembler* masm); | 744 static void GenerateLoadDictionaryElement(MacroAssembler* masm); |
| 749 | 745 |
| 750 protected: | 746 private: |
| 751 static Register* registers(); | 747 static Register* registers(); |
| 752 | |
| 753 private: | |
| 754 virtual void GenerateNameCheck(Handle<Name> name, | |
| 755 Register name_reg, | |
| 756 Label* miss); | |
| 757 friend class BaseLoadStoreStubCompiler; | 748 friend class BaseLoadStoreStubCompiler; |
| 758 }; | 749 }; |
| 759 | 750 |
| 760 | 751 |
| 761 class StoreStubCompiler: public BaseLoadStoreStubCompiler { | 752 class StoreStubCompiler: public BaseLoadStoreStubCompiler { |
| 762 public: | 753 public: |
| 763 StoreStubCompiler(Isolate* isolate, | 754 StoreStubCompiler(Isolate* isolate, |
| 764 ExtraICState extra_ic_state, | 755 ExtraICState extra_ic_state, |
| 765 Code::Kind kind = Code::STORE_IC) | 756 Code::Kind kind = Code::STORE_IC) |
| 766 : BaseLoadStoreStubCompiler(isolate, kind, extra_ic_state) {} | 757 : BaseLoadStoreStubCompiler(isolate, kind, extra_ic_state) {} |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 Handle<Code> CompileStoreElement(Handle<Map> receiver_map); | 863 Handle<Code> CompileStoreElement(Handle<Map> receiver_map); |
| 873 | 864 |
| 874 Handle<Code> CompileStorePolymorphic(MapHandleList* receiver_maps, | 865 Handle<Code> CompileStorePolymorphic(MapHandleList* receiver_maps, |
| 875 CodeHandleList* handler_stubs, | 866 CodeHandleList* handler_stubs, |
| 876 MapHandleList* transitioned_maps); | 867 MapHandleList* transitioned_maps); |
| 877 | 868 |
| 878 Handle<Code> CompileStoreElementPolymorphic(MapHandleList* receiver_maps); | 869 Handle<Code> CompileStoreElementPolymorphic(MapHandleList* receiver_maps); |
| 879 | 870 |
| 880 static void GenerateStoreDictionaryElement(MacroAssembler* masm); | 871 static void GenerateStoreDictionaryElement(MacroAssembler* masm); |
| 881 | 872 |
| 882 protected: | 873 private: |
| 883 static Register* registers(); | 874 static Register* registers(); |
| 884 | 875 |
| 885 KeyedAccessStoreMode store_mode() { | 876 KeyedAccessStoreMode store_mode() { |
| 886 return KeyedStoreIC::GetKeyedAccessStoreMode(extra_state()); | 877 return KeyedStoreIC::GetKeyedAccessStoreMode(extra_state()); |
| 887 } | 878 } |
| 888 | 879 |
| 889 private: | |
| 890 Register transition_map() { | 880 Register transition_map() { |
| 891 return registers()[3]; | 881 return registers()[3]; |
| 892 } | 882 } |
| 893 | 883 |
| 894 virtual void GenerateNameCheck(Handle<Name> name, | |
| 895 Register name_reg, | |
| 896 Label* miss); | |
| 897 friend class BaseLoadStoreStubCompiler; | 884 friend class BaseLoadStoreStubCompiler; |
| 898 }; | 885 }; |
| 899 | 886 |
| 900 | 887 |
| 901 // Subset of FUNCTIONS_WITH_ID_LIST with custom constant/global call | 888 // Subset of FUNCTIONS_WITH_ID_LIST with custom constant/global call |
| 902 // IC stubs. | 889 // IC stubs. |
| 903 #define CUSTOM_CALL_IC_GENERATORS(V) \ | 890 #define CUSTOM_CALL_IC_GENERATORS(V) \ |
| 904 V(ArrayPush) \ | 891 V(ArrayPush) \ |
| 905 V(ArrayPop) \ | 892 V(ArrayPop) \ |
| 906 V(StringFromCharCode) \ | 893 V(StringFromCharCode) \ |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 Handle<JSFunction> constant_function_; | 1053 Handle<JSFunction> constant_function_; |
| 1067 bool is_simple_api_call_; | 1054 bool is_simple_api_call_; |
| 1068 Handle<FunctionTemplateInfo> expected_receiver_type_; | 1055 Handle<FunctionTemplateInfo> expected_receiver_type_; |
| 1069 Handle<CallHandlerInfo> api_call_info_; | 1056 Handle<CallHandlerInfo> api_call_info_; |
| 1070 }; | 1057 }; |
| 1071 | 1058 |
| 1072 | 1059 |
| 1073 } } // namespace v8::internal | 1060 } } // namespace v8::internal |
| 1074 | 1061 |
| 1075 #endif // V8_STUB_CACHE_H_ | 1062 #endif // V8_STUB_CACHE_H_ |
| OLD | NEW |