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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 Code::Kind, | 131 Code::Kind, |
132 ExtraICState extra_state, | 132 ExtraICState extra_state, |
133 Handle<Name> name, | 133 Handle<Name> name, |
134 Handle<JSObject> object, | 134 Handle<JSObject> object, |
135 Handle<GlobalObject> holder, | 135 Handle<GlobalObject> holder, |
136 Handle<PropertyCell> cell, | 136 Handle<PropertyCell> cell, |
137 Handle<JSFunction> function); | 137 Handle<JSFunction> function); |
138 | 138 |
139 // --- | 139 // --- |
140 | 140 |
141 Handle<Code> ComputeCallInitialize(int argc, RelocInfo::Mode mode); | 141 Handle<Code> ComputeCallInitialize(int argc, ContextualMode mode); |
142 | 142 |
143 Handle<Code> ComputeKeyedCallInitialize(int argc); | 143 Handle<Code> ComputeKeyedCallInitialize(int argc); |
144 | 144 |
145 Handle<Code> ComputeCallPreMonomorphic(int argc, | 145 Handle<Code> ComputeCallPreMonomorphic(int argc, |
146 Code::Kind kind, | 146 Code::Kind kind, |
147 ExtraICState extra_state); | 147 ExtraICState extra_state); |
148 | 148 |
149 Handle<Code> ComputeCallNormal(int argc, | 149 Handle<Code> ComputeCallNormal(int argc, |
150 Code::Kind kind, | 150 Code::Kind kind, |
151 ExtraICState state); | 151 ExtraICState state); |
152 | 152 |
153 Handle<Code> ComputeCallArguments(int argc); | 153 Handle<Code> ComputeCallArguments(int argc); |
154 | 154 |
155 Handle<Code> ComputeCallMegamorphic(int argc, | 155 Handle<Code> ComputeCallMegamorphic(int argc, |
156 Code::Kind kind, | 156 Code::Kind kind, |
157 ExtraICState state); | 157 ExtraICState state); |
158 | 158 |
159 Handle<Code> ComputeCallMiss(int argc, | 159 Handle<Code> ComputeCallMiss(int argc, |
160 Code::Kind kind, | 160 Code::Kind kind, |
161 ExtraICState state); | 161 ExtraICState state); |
162 | 162 |
163 // --- | 163 // --- |
164 | 164 |
165 Handle<Code> ComputeLoad(InlineCacheState ic_state, ExtraICState extra_state); | |
166 Handle<Code> ComputeStore(InlineCacheState ic_state, | |
167 ExtraICState extra_state); | |
168 | |
169 // --- | |
170 | |
165 Handle<Code> ComputeCompareNil(Handle<Map> receiver_map, | 171 Handle<Code> ComputeCompareNil(Handle<Map> receiver_map, |
166 CompareNilICStub& stub); | 172 CompareNilICStub& stub); |
167 | 173 |
168 // --- | 174 // --- |
169 | 175 |
170 Handle<Code> ComputeLoadElementPolymorphic(MapHandleList* receiver_maps); | 176 Handle<Code> ComputeLoadElementPolymorphic(MapHandleList* receiver_maps); |
171 Handle<Code> ComputeStoreElementPolymorphic(MapHandleList* receiver_maps, | 177 Handle<Code> ComputeStoreElementPolymorphic(MapHandleList* receiver_maps, |
172 KeyedAccessStoreMode store_mode, | 178 KeyedAccessStoreMode store_mode, |
173 StrictModeFlag strict_mode); | 179 StrictModeFlag strict_mode); |
174 | 180 |
175 Handle<Code> ComputePolymorphicIC(TypeHandleList* types, | 181 Handle<Code> ComputePolymorphicIC(TypeHandleList* types, |
176 CodeHandleList* handlers, | 182 CodeHandleList* handlers, |
177 int number_of_valid_maps, | 183 int number_of_valid_maps, |
178 Handle<Name> name, | 184 Handle<Name> name, |
179 ExtraICState extra_ic_state); | 185 ExtraICState extra_ic_state); |
180 | 186 |
181 // Finds the Code object stored in the Heap::non_monomorphic_cache(). | 187 // Finds the Code object stored in the Heap::non_monomorphic_cache(). |
182 Code* FindCallInitialize(int argc, RelocInfo::Mode mode, Code::Kind kind); | 188 Code* FindCallInitialize(int argc, ContextualMode mode, Code::Kind kind); |
Toon Verwaest
2013/12/04 18:10:52
We should probably also reset calls to premonomorp
mvstanton
2013/12/04 22:08:10
Good point, I was wondering about that. But you ar
| |
189 Code* FindPreMonomorphicIC(Code::Kind kind, ExtraICState extra_ic_state); | |
183 | 190 |
184 #ifdef ENABLE_DEBUGGER_SUPPORT | 191 #ifdef ENABLE_DEBUGGER_SUPPORT |
185 Handle<Code> ComputeCallDebugBreak(int argc, Code::Kind kind); | 192 Handle<Code> ComputeCallDebugBreak(int argc, Code::Kind kind); |
186 | 193 |
187 Handle<Code> ComputeCallDebugPrepareStepIn(int argc, Code::Kind kind); | 194 Handle<Code> ComputeCallDebugPrepareStepIn(int argc, Code::Kind kind); |
188 #endif | 195 #endif |
189 | 196 |
190 // Update cache for entry hash(name, map). | 197 // Update cache for entry hash(name, map). |
191 Code* Set(Name* name, Map* map, Code* code); | 198 Code* Set(Name* name, Map* map, Code* code); |
192 | 199 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 static const int kInterceptorArgsNameIndex = 0; | 263 static const int kInterceptorArgsNameIndex = 0; |
257 static const int kInterceptorArgsInfoIndex = 1; | 264 static const int kInterceptorArgsInfoIndex = 1; |
258 static const int kInterceptorArgsThisIndex = 2; | 265 static const int kInterceptorArgsThisIndex = 2; |
259 static const int kInterceptorArgsHolderIndex = 3; | 266 static const int kInterceptorArgsHolderIndex = 3; |
260 static const int kInterceptorArgsLength = 4; | 267 static const int kInterceptorArgsLength = 4; |
261 | 268 |
262 private: | 269 private: |
263 explicit StubCache(Isolate* isolate); | 270 explicit StubCache(Isolate* isolate); |
264 | 271 |
265 Handle<Code> ComputeCallInitialize(int argc, | 272 Handle<Code> ComputeCallInitialize(int argc, |
266 RelocInfo::Mode mode, | 273 ContextualMode mode, |
267 Code::Kind kind); | 274 Code::Kind kind); |
268 | 275 |
269 // The stub cache has a primary and secondary level. The two levels have | 276 // The stub cache has a primary and secondary level. The two levels have |
270 // different hashing algorithms in order to avoid simultaneous collisions | 277 // different hashing algorithms in order to avoid simultaneous collisions |
271 // in both caches. Unlike a probing strategy (quadratic or otherwise) the | 278 // in both caches. Unlike a probing strategy (quadratic or otherwise) the |
272 // update strategy on updates is fairly clear and simple: Any existing entry | 279 // update strategy on updates is fairly clear and simple: Any existing entry |
273 // in the primary cache is moved to the secondary cache, and secondary cache | 280 // in the primary cache is moved to the secondary cache, and secondary cache |
274 // entries are overwritten. | 281 // entries are overwritten. |
275 | 282 |
276 // Hash algorithm for the primary table. This algorithm is replicated in | 283 // Hash algorithm for the primary table. This algorithm is replicated in |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 | 378 |
372 // Functions to compile either CallIC or KeyedCallIC. The specific kind | 379 // Functions to compile either CallIC or KeyedCallIC. The specific kind |
373 // is extracted from the code flags. | 380 // is extracted from the code flags. |
374 Handle<Code> CompileCallInitialize(Code::Flags flags); | 381 Handle<Code> CompileCallInitialize(Code::Flags flags); |
375 Handle<Code> CompileCallPreMonomorphic(Code::Flags flags); | 382 Handle<Code> CompileCallPreMonomorphic(Code::Flags flags); |
376 Handle<Code> CompileCallNormal(Code::Flags flags); | 383 Handle<Code> CompileCallNormal(Code::Flags flags); |
377 Handle<Code> CompileCallMegamorphic(Code::Flags flags); | 384 Handle<Code> CompileCallMegamorphic(Code::Flags flags); |
378 Handle<Code> CompileCallArguments(Code::Flags flags); | 385 Handle<Code> CompileCallArguments(Code::Flags flags); |
379 Handle<Code> CompileCallMiss(Code::Flags flags); | 386 Handle<Code> CompileCallMiss(Code::Flags flags); |
380 | 387 |
388 Handle<Code> CompileLoadInitialize(Code::Flags flags); | |
389 Handle<Code> CompileLoadPreMonomorphic(Code::Flags flags); | |
390 Handle<Code> CompileLoadMegamorphic(Code::Flags flags); | |
391 | |
392 Handle<Code> CompileStoreInitialize(Code::Flags flags); | |
393 Handle<Code> CompileStorePreMonomorphic(Code::Flags flags); | |
394 Handle<Code> CompileStoreGeneric(Code::Flags flags); | |
395 Handle<Code> CompileStoreMegamorphic(Code::Flags flags); | |
396 | |
381 #ifdef ENABLE_DEBUGGER_SUPPORT | 397 #ifdef ENABLE_DEBUGGER_SUPPORT |
382 Handle<Code> CompileCallDebugBreak(Code::Flags flags); | 398 Handle<Code> CompileCallDebugBreak(Code::Flags flags); |
383 Handle<Code> CompileCallDebugPrepareStepIn(Code::Flags flags); | 399 Handle<Code> CompileCallDebugPrepareStepIn(Code::Flags flags); |
384 #endif | 400 #endif |
385 | 401 |
386 // Static functions for generating parts of stubs. | 402 // Static functions for generating parts of stubs. |
387 static void GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, | 403 static void GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, |
388 int index, | 404 int index, |
389 Register prototype); | 405 Register prototype); |
390 | 406 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
496 MacroAssembler* masm() { return &masm_; } | 512 MacroAssembler* masm() { return &masm_; } |
497 void set_failure(Failure* failure) { failure_ = failure; } | 513 void set_failure(Failure* failure) { failure_ = failure; } |
498 | 514 |
499 static void LookupPostInterceptor(Handle<JSObject> holder, | 515 static void LookupPostInterceptor(Handle<JSObject> holder, |
500 Handle<Name> name, | 516 Handle<Name> name, |
501 LookupResult* lookup); | 517 LookupResult* lookup); |
502 | 518 |
503 Isolate* isolate() { return isolate_; } | 519 Isolate* isolate() { return isolate_; } |
504 Heap* heap() { return isolate()->heap(); } | 520 Heap* heap() { return isolate()->heap(); } |
505 Factory* factory() { return isolate()->factory(); } | 521 Factory* factory() { return isolate()->factory(); } |
522 ContextualMode contextual_mode() { | |
523 return IC::GetContextualMode(extra_state()); | |
524 } | |
506 | 525 |
507 static void GenerateTailCall(MacroAssembler* masm, Handle<Code> code); | 526 static void GenerateTailCall(MacroAssembler* masm, Handle<Code> code); |
508 | 527 |
509 private: | 528 private: |
510 Isolate* isolate_; | 529 Isolate* isolate_; |
511 const ExtraICState extra_ic_state_; | 530 const ExtraICState extra_ic_state_; |
512 MacroAssembler masm_; | 531 MacroAssembler masm_; |
513 Failure* failure_; | 532 Failure* failure_; |
514 }; | 533 }; |
515 | 534 |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1058 Handle<JSFunction> constant_function_; | 1077 Handle<JSFunction> constant_function_; |
1059 bool is_simple_api_call_; | 1078 bool is_simple_api_call_; |
1060 Handle<FunctionTemplateInfo> expected_receiver_type_; | 1079 Handle<FunctionTemplateInfo> expected_receiver_type_; |
1061 Handle<CallHandlerInfo> api_call_info_; | 1080 Handle<CallHandlerInfo> api_call_info_; |
1062 }; | 1081 }; |
1063 | 1082 |
1064 | 1083 |
1065 } } // namespace v8::internal | 1084 } } // namespace v8::internal |
1066 | 1085 |
1067 #endif // V8_STUB_CACHE_H_ | 1086 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |