Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: src/stub-cache.h

Issue 151603004: A64: Synchronize with r16587. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/string-stream.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 30 matching lines...) Expand all
41 41
42 42
43 // The stub cache is used for megamorphic calls and property accesses. 43 // The stub cache is used for megamorphic calls and property accesses.
44 // It maps (map, name, type)->Code* 44 // It maps (map, name, type)->Code*
45 45
46 // The design of the table uses the inline cache stubs used for 46 // The design of the table uses the inline cache stubs used for
47 // mono-morphic calls. The beauty of this, we do not have to 47 // mono-morphic calls. The beauty of this, we do not have to
48 // invalidate the cache whenever a prototype map is changed. The stub 48 // invalidate the cache whenever a prototype map is changed. The stub
49 // validates the map chain as in the mono-morphic case. 49 // validates the map chain as in the mono-morphic case.
50 50
51
52 class CallOptimization;
51 class SmallMapList; 53 class SmallMapList;
52 class StubCache; 54 class StubCache;
53 55
54 56
55 class SCTableReference { 57 class SCTableReference {
56 public: 58 public:
57 Address address() const { return address_; } 59 Address address() const { return address_; }
58 60
59 private: 61 private:
60 explicit SCTableReference(Address address) : address_(address) {} 62 explicit SCTableReference(Address address) : address_(address) {}
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 Handle<JSObject> object, 131 Handle<JSObject> object,
130 Handle<JSObject> holder, 132 Handle<JSObject> holder,
131 PropertyIndex field_index, 133 PropertyIndex field_index,
132 Representation representation); 134 Representation representation);
133 135
134 Handle<Code> ComputeLoadCallback(Handle<Name> name, 136 Handle<Code> ComputeLoadCallback(Handle<Name> name,
135 Handle<JSObject> object, 137 Handle<JSObject> object,
136 Handle<JSObject> holder, 138 Handle<JSObject> holder,
137 Handle<ExecutableAccessorInfo> callback); 139 Handle<ExecutableAccessorInfo> callback);
138 140
141 Handle<Code> ComputeLoadCallback(Handle<Name> name,
142 Handle<JSObject> object,
143 Handle<JSObject> holder,
144 const CallOptimization& call_optimization);
145
139 Handle<Code> ComputeLoadViaGetter(Handle<Name> name, 146 Handle<Code> ComputeLoadViaGetter(Handle<Name> name,
140 Handle<JSObject> object, 147 Handle<JSObject> object,
141 Handle<JSObject> holder, 148 Handle<JSObject> holder,
142 Handle<JSFunction> getter); 149 Handle<JSFunction> getter);
143 150
144 Handle<Code> ComputeLoadConstant(Handle<Name> name, 151 Handle<Code> ComputeLoadConstant(Handle<Name> name,
145 Handle<JSObject> object, 152 Handle<JSObject> object,
146 Handle<JSObject> holder, 153 Handle<JSObject> holder,
147 Handle<Object> value); 154 Handle<Object> value);
148 155
(...skipping 17 matching lines...) Expand all
166 Handle<JSObject> holder, 173 Handle<JSObject> holder,
167 PropertyIndex field_index, 174 PropertyIndex field_index,
168 Representation representation); 175 Representation representation);
169 176
170 Handle<Code> ComputeKeyedLoadCallback( 177 Handle<Code> ComputeKeyedLoadCallback(
171 Handle<Name> name, 178 Handle<Name> name,
172 Handle<JSObject> object, 179 Handle<JSObject> object,
173 Handle<JSObject> holder, 180 Handle<JSObject> holder,
174 Handle<ExecutableAccessorInfo> callback); 181 Handle<ExecutableAccessorInfo> callback);
175 182
183 Handle<Code> ComputeKeyedLoadCallback(
184 Handle<Name> name,
185 Handle<JSObject> object,
186 Handle<JSObject> holder,
187 const CallOptimization& call_optimization);
188
176 Handle<Code> ComputeKeyedLoadConstant(Handle<Name> name, 189 Handle<Code> ComputeKeyedLoadConstant(Handle<Name> name,
177 Handle<JSObject> object, 190 Handle<JSObject> object,
178 Handle<JSObject> holder, 191 Handle<JSObject> holder,
179 Handle<Object> value); 192 Handle<Object> value);
180 193
181 Handle<Code> ComputeKeyedLoadInterceptor(Handle<Name> name, 194 Handle<Code> ComputeKeyedLoadInterceptor(Handle<Name> name,
182 Handle<JSObject> object, 195 Handle<JSObject> object,
183 Handle<JSObject> holder); 196 Handle<JSObject> holder);
184 197
185 // --- 198 // ---
(...skipping 16 matching lines...) Expand all
202 Handle<PropertyCell> cell, 215 Handle<PropertyCell> cell,
203 Handle<Object> value, 216 Handle<Object> value,
204 StrictModeFlag strict_mode); 217 StrictModeFlag strict_mode);
205 218
206 Handle<Code> ComputeStoreCallback(Handle<Name> name, 219 Handle<Code> ComputeStoreCallback(Handle<Name> name,
207 Handle<JSObject> object, 220 Handle<JSObject> object,
208 Handle<JSObject> holder, 221 Handle<JSObject> holder,
209 Handle<ExecutableAccessorInfo> callback, 222 Handle<ExecutableAccessorInfo> callback,
210 StrictModeFlag strict_mode); 223 StrictModeFlag strict_mode);
211 224
225 Handle<Code> ComputeStoreCallback(Handle<Name> name,
226 Handle<JSObject> object,
227 Handle<JSObject> holder,
228 const CallOptimization& call_optimation,
229 StrictModeFlag strict_mode);
230
212 Handle<Code> ComputeStoreViaSetter(Handle<Name> name, 231 Handle<Code> ComputeStoreViaSetter(Handle<Name> name,
213 Handle<JSObject> object, 232 Handle<JSObject> object,
214 Handle<JSObject> holder, 233 Handle<JSObject> holder,
215 Handle<JSFunction> setter, 234 Handle<JSFunction> setter,
216 StrictModeFlag strict_mode); 235 StrictModeFlag strict_mode);
217 236
218 Handle<Code> ComputeStoreInterceptor(Handle<Name> name, 237 Handle<Code> ComputeStoreInterceptor(Handle<Name> name,
219 Handle<JSObject> object, 238 Handle<JSObject> object,
220 StrictModeFlag strict_mode); 239 StrictModeFlag strict_mode);
221 240
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 Handle<JSObject> holder, 717 Handle<JSObject> holder,
699 Handle<Name> name, 718 Handle<Name> name,
700 PropertyIndex index, 719 PropertyIndex index,
701 Representation representation); 720 Representation representation);
702 721
703 Handle<Code> CompileLoadCallback(Handle<JSObject> object, 722 Handle<Code> CompileLoadCallback(Handle<JSObject> object,
704 Handle<JSObject> holder, 723 Handle<JSObject> holder,
705 Handle<Name> name, 724 Handle<Name> name,
706 Handle<ExecutableAccessorInfo> callback); 725 Handle<ExecutableAccessorInfo> callback);
707 726
727 Handle<Code> CompileLoadCallback(Handle<JSObject> object,
728 Handle<JSObject> holder,
729 Handle<Name> name,
730 const CallOptimization& call_optimization);
731
708 Handle<Code> CompileLoadConstant(Handle<JSObject> object, 732 Handle<Code> CompileLoadConstant(Handle<JSObject> object,
709 Handle<JSObject> holder, 733 Handle<JSObject> holder,
710 Handle<Name> name, 734 Handle<Name> name,
711 Handle<Object> value); 735 Handle<Object> value);
712 736
713 Handle<Code> CompileLoadInterceptor(Handle<JSObject> object, 737 Handle<Code> CompileLoadInterceptor(Handle<JSObject> object,
714 Handle<JSObject> holder, 738 Handle<JSObject> holder,
715 Handle<Name> name); 739 Handle<Name> name);
716 740
717 protected: 741 protected:
718 virtual Register HandlerFrontendHeader(Handle<JSObject> object, 742 virtual Register HandlerFrontendHeader(Handle<JSObject> object,
719 Register object_reg, 743 Register object_reg,
720 Handle<JSObject> holder, 744 Handle<JSObject> holder,
721 Handle<Name> name, 745 Handle<Name> name,
722 Label* miss); 746 Label* miss);
723 747
724 virtual void HandlerFrontendFooter(Handle<Name> name, 748 virtual void HandlerFrontendFooter(Handle<Name> name,
725 Label* success, 749 Label* success,
726 Label* miss); 750 Label* miss);
727 751
728 Register CallbackHandlerFrontend(Handle<JSObject> object, 752 Register CallbackHandlerFrontend(Handle<JSObject> object,
729 Register object_reg, 753 Register object_reg,
730 Handle<JSObject> holder, 754 Handle<JSObject> holder,
731 Handle<Name> name, 755 Handle<Name> name,
732 Label* success, 756 Label* success,
733 Handle<ExecutableAccessorInfo> callback); 757 Handle<Object> callback);
734 void NonexistentHandlerFrontend(Handle<JSObject> object, 758 void NonexistentHandlerFrontend(Handle<JSObject> object,
735 Handle<JSObject> last, 759 Handle<JSObject> last,
736 Handle<Name> name, 760 Handle<Name> name,
737 Label* success, 761 Label* success,
738 Handle<GlobalObject> global); 762 Handle<GlobalObject> global);
739 763
740 void GenerateLoadField(Register reg, 764 void GenerateLoadField(Register reg,
741 Handle<JSObject> holder, 765 Handle<JSObject> holder,
742 PropertyIndex field, 766 PropertyIndex field,
743 Representation representation); 767 Representation representation);
744 void GenerateLoadConstant(Handle<Object> value); 768 void GenerateLoadConstant(Handle<Object> value);
745 void GenerateLoadCallback(Register reg, 769 void GenerateLoadCallback(Register reg,
746 Handle<ExecutableAccessorInfo> callback); 770 Handle<ExecutableAccessorInfo> callback);
771 void GenerateLoadCallback(const CallOptimization& call_optimization);
747 void GenerateLoadInterceptor(Register holder_reg, 772 void GenerateLoadInterceptor(Register holder_reg,
748 Handle<JSObject> object, 773 Handle<JSObject> object,
749 Handle<JSObject> holder, 774 Handle<JSObject> holder,
750 LookupResult* lookup, 775 LookupResult* lookup,
751 Handle<Name> name); 776 Handle<Name> name);
752 void GenerateLoadPostInterceptor(Register reg, 777 void GenerateLoadPostInterceptor(Register reg,
753 Handle<JSObject> interceptor_holder, 778 Handle<JSObject> interceptor_holder,
754 Handle<Name> name, 779 Handle<Name> name,
755 LookupResult* lookup); 780 LookupResult* lookup);
756 781
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 public: 959 public:
935 StoreStubCompiler(Isolate* isolate, StrictModeFlag strict_mode) 960 StoreStubCompiler(Isolate* isolate, StrictModeFlag strict_mode)
936 : BaseStoreStubCompiler(isolate, strict_mode, registers()) { } 961 : BaseStoreStubCompiler(isolate, strict_mode, registers()) { }
937 962
938 963
939 Handle<Code> CompileStoreCallback(Handle<JSObject> object, 964 Handle<Code> CompileStoreCallback(Handle<JSObject> object,
940 Handle<JSObject> holder, 965 Handle<JSObject> holder,
941 Handle<Name> name, 966 Handle<Name> name,
942 Handle<ExecutableAccessorInfo> callback); 967 Handle<ExecutableAccessorInfo> callback);
943 968
969 Handle<Code> CompileStoreCallback(Handle<JSObject> object,
970 Handle<JSObject> holder,
971 Handle<Name> name,
972 const CallOptimization& call_optimization);
973
944 static void GenerateStoreViaSetter(MacroAssembler* masm, 974 static void GenerateStoreViaSetter(MacroAssembler* masm,
945 Handle<JSFunction> setter); 975 Handle<JSFunction> setter);
946 976
947 Handle<Code> CompileStoreViaSetter(Handle<JSObject> object, 977 Handle<Code> CompileStoreViaSetter(Handle<JSObject> object,
948 Handle<JSObject> holder, 978 Handle<JSObject> holder,
949 Handle<Name> name, 979 Handle<Name> name,
950 Handle<JSFunction> setter); 980 Handle<JSFunction> setter);
951 981
952 Handle<Code> CompileStoreInterceptor(Handle<JSObject> object, 982 Handle<Code> CompileStoreInterceptor(Handle<JSObject> object,
953 Handle<Name> name); 983 Handle<Name> name);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 V(StringFromCharCode) \ 1051 V(StringFromCharCode) \
1022 V(MathFloor) \ 1052 V(MathFloor) \
1023 V(MathAbs) \ 1053 V(MathAbs) \
1024 V(ArrayCode) 1054 V(ArrayCode)
1025 1055
1026 1056
1027 #define SITE_SPECIFIC_CALL_GENERATORS(V) \ 1057 #define SITE_SPECIFIC_CALL_GENERATORS(V) \
1028 V(ArrayCode) 1058 V(ArrayCode)
1029 1059
1030 1060
1031 class CallOptimization;
1032
1033 class CallStubCompiler: public StubCompiler { 1061 class CallStubCompiler: public StubCompiler {
1034 public: 1062 public:
1035 CallStubCompiler(Isolate* isolate, 1063 CallStubCompiler(Isolate* isolate,
1036 int argc, 1064 int argc,
1037 Code::Kind kind, 1065 Code::Kind kind,
1038 Code::ExtraICState extra_state, 1066 Code::ExtraICState extra_state,
1039 InlineCacheHolderFlag cache_holder); 1067 InlineCacheHolderFlag cache_holder);
1040 1068
1041 Handle<Code> CompileCallField(Handle<JSObject> object, 1069 Handle<Code> CompileCallField(Handle<JSObject> object,
1042 Handle<JSObject> holder, 1070 Handle<JSObject> holder,
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 Handle<CallHandlerInfo> api_call_info() const { 1182 Handle<CallHandlerInfo> api_call_info() const {
1155 ASSERT(is_simple_api_call()); 1183 ASSERT(is_simple_api_call());
1156 return api_call_info_; 1184 return api_call_info_;
1157 } 1185 }
1158 1186
1159 // Returns the depth of the object having the expected type in the 1187 // Returns the depth of the object having the expected type in the
1160 // prototype chain between the two arguments. 1188 // prototype chain between the two arguments.
1161 int GetPrototypeDepthOfExpectedType(Handle<JSObject> object, 1189 int GetPrototypeDepthOfExpectedType(Handle<JSObject> object,
1162 Handle<JSObject> holder) const; 1190 Handle<JSObject> holder) const;
1163 1191
1192 bool IsCompatibleReceiver(Object* receiver) {
1193 ASSERT(is_simple_api_call());
1194 if (expected_receiver_type_.is_null()) return true;
1195 return receiver->IsInstanceOf(*expected_receiver_type_);
1196 }
1197
1164 private: 1198 private:
1165 void Initialize(Handle<JSFunction> function); 1199 void Initialize(Handle<JSFunction> function);
1166 1200
1167 // Determines whether the given function can be called using the 1201 // Determines whether the given function can be called using the
1168 // fast api call builtin. 1202 // fast api call builtin.
1169 void AnalyzePossibleApiFunction(Handle<JSFunction> function); 1203 void AnalyzePossibleApiFunction(Handle<JSFunction> function);
1170 1204
1171 Handle<JSFunction> constant_function_; 1205 Handle<JSFunction> constant_function_;
1172 bool is_simple_api_call_; 1206 bool is_simple_api_call_;
1173 Handle<FunctionTemplateInfo> expected_receiver_type_; 1207 Handle<FunctionTemplateInfo> expected_receiver_type_;
1174 Handle<CallHandlerInfo> api_call_info_; 1208 Handle<CallHandlerInfo> api_call_info_;
1175 }; 1209 };
1176 1210
1177 1211
1178 } } // namespace v8::internal 1212 } } // namespace v8::internal
1179 1213
1180 #endif // V8_STUB_CACHE_H_ 1214 #endif // V8_STUB_CACHE_H_
OLDNEW
« no previous file with comments | « src/string-stream.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698