OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_IC_H_ | 5 #ifndef V8_IC_H_ |
6 #define V8_IC_H_ | 6 #define V8_IC_H_ |
7 | 7 |
8 #include "src/ic/ic-state.h" | 8 #include "src/ic/ic-state.h" |
9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 307 |
308 Handle<Object> GetMapIndependentHandler(LookupIterator* lookup) override; | 308 Handle<Object> GetMapIndependentHandler(LookupIterator* lookup) override; |
309 | 309 |
310 Handle<Object> CompileHandler(LookupIterator* lookup, Handle<Object> unused, | 310 Handle<Object> CompileHandler(LookupIterator* lookup, Handle<Object> unused, |
311 CacheHolderFlag cache_holder) override; | 311 CacheHolderFlag cache_holder) override; |
312 | 312 |
313 private: | 313 private: |
314 // Creates a data handler that represents a load of a field by given index. | 314 // Creates a data handler that represents a load of a field by given index. |
315 Handle<Object> SimpleFieldLoad(FieldIndex index); | 315 Handle<Object> SimpleFieldLoad(FieldIndex index); |
316 | 316 |
317 // Returns 0 if the validity cell check is enough to ensure that the | |
318 // prototype chain from |receiver_map| till |holder| did not change. | |
319 // If the |holder| is an empty handle then the full prototype chain is | |
320 // checked. | |
321 // Returns -1 if the handler has to be compiled or the number of prototype | |
322 // checks otherwise. | |
323 int GetPrototypeCheckCount(Handle<Map> receiver_map, Handle<JSObject> holder); | |
324 | |
325 // Creates a data handler that represents a prototype chain check followed | 317 // Creates a data handler that represents a prototype chain check followed |
326 // by given Smi-handler that encoded a load from the holder. | 318 // by given Smi-handler that encoded a load from the holder. |
327 // Can be used only if GetPrototypeCheckCount() returns non negative value. | 319 // Can be used only if GetPrototypeCheckCount() returns non negative value. |
328 Handle<Object> LoadFromPrototype(Handle<Map> receiver_map, | 320 Handle<Object> LoadFromPrototype(Handle<Map> receiver_map, |
329 Handle<JSObject> holder, Handle<Name> name, | 321 Handle<JSObject> holder, Handle<Name> name, |
330 Handle<Object> smi_handler); | 322 Handle<Object> smi_handler); |
331 | 323 |
332 // Creates a data handler that represents a load of a non-existent property. | 324 // Creates a data handler that represents a load of a non-existent property. |
333 Handle<Object> LoadNonExistent(Handle<Map> receiver_map, Handle<Name> name); | 325 Handle<Object> LoadNonExistent(Handle<Map> receiver_map, Handle<Name> name); |
334 | 326 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 | 410 |
419 // Update the inline cache and the global stub cache based on the | 411 // Update the inline cache and the global stub cache based on the |
420 // lookup result. | 412 // lookup result. |
421 void UpdateCaches(LookupIterator* lookup, Handle<Object> value, | 413 void UpdateCaches(LookupIterator* lookup, Handle<Object> value, |
422 JSReceiver::StoreFromKeyed store_mode); | 414 JSReceiver::StoreFromKeyed store_mode); |
423 Handle<Object> GetMapIndependentHandler(LookupIterator* lookup) override; | 415 Handle<Object> GetMapIndependentHandler(LookupIterator* lookup) override; |
424 Handle<Object> CompileHandler(LookupIterator* lookup, Handle<Object> value, | 416 Handle<Object> CompileHandler(LookupIterator* lookup, Handle<Object> value, |
425 CacheHolderFlag cache_holder) override; | 417 CacheHolderFlag cache_holder) override; |
426 | 418 |
427 private: | 419 private: |
| 420 Handle<Object> StoreTransition(Handle<Map> receiver_map, |
| 421 Handle<JSObject> holder, |
| 422 Handle<Map> transition, Handle<Name> name); |
| 423 |
428 friend class IC; | 424 friend class IC; |
429 }; | 425 }; |
430 | 426 |
431 | 427 |
432 enum KeyedStoreCheckMap { kDontCheckMap, kCheckMap }; | 428 enum KeyedStoreCheckMap { kDontCheckMap, kCheckMap }; |
433 | 429 |
434 | 430 |
435 enum KeyedStoreIncrementLength { kDontIncrementLength, kIncrementLength }; | 431 enum KeyedStoreIncrementLength { kDontIncrementLength, kIncrementLength }; |
436 | 432 |
437 | 433 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 | 517 |
522 // Helper for BinaryOpIC and CompareIC. | 518 // Helper for BinaryOpIC and CompareIC. |
523 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 519 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
524 void PatchInlinedSmiCode(Isolate* isolate, Address address, | 520 void PatchInlinedSmiCode(Isolate* isolate, Address address, |
525 InlinedSmiCheck check); | 521 InlinedSmiCheck check); |
526 | 522 |
527 } // namespace internal | 523 } // namespace internal |
528 } // namespace v8 | 524 } // namespace v8 |
529 | 525 |
530 #endif // V8_IC_H_ | 526 #endif // V8_IC_H_ |
OLD | NEW |