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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED); | 373 JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED); |
374 | 374 |
375 bool LookupForWrite(LookupIterator* it, Handle<Object> value, | 375 bool LookupForWrite(LookupIterator* it, Handle<Object> value, |
376 JSReceiver::StoreFromKeyed store_mode); | 376 JSReceiver::StoreFromKeyed store_mode); |
377 | 377 |
378 static void Clear(Isolate* isolate, Code* host, StoreICNexus* nexus); | 378 static void Clear(Isolate* isolate, Code* host, StoreICNexus* nexus); |
379 | 379 |
380 protected: | 380 protected: |
381 // Stub accessors. | 381 // Stub accessors. |
382 Handle<Code> slow_stub() const { | 382 Handle<Code> slow_stub() const { |
383 // TODO(ishell): don't hard-code language mode into the handler because | 383 // StoreIC and KeyedStoreIC share the same slow stub. |
384 // this handler can be re-used through megamorphic stub cache for wrong | 384 return isolate()->builtins()->KeyedStoreIC_Slow(); |
385 // language mode. | |
386 // The slow stub must decode the language mode from the IC kind. | |
387 switch (language_mode()) { | |
388 case SLOPPY: | |
389 return isolate()->builtins()->StoreIC_SlowSloppy(); | |
390 case STRICT: | |
391 return isolate()->builtins()->StoreIC_SlowStrict(); | |
392 default: | |
393 UNREACHABLE(); | |
394 return Handle<Code>(); | |
395 } | |
396 } | 385 } |
397 | 386 |
398 // Update the inline cache and the global stub cache based on the | 387 // Update the inline cache and the global stub cache based on the |
399 // lookup result. | 388 // lookup result. |
400 void UpdateCaches(LookupIterator* lookup, Handle<Object> value, | 389 void UpdateCaches(LookupIterator* lookup, Handle<Object> value, |
401 JSReceiver::StoreFromKeyed store_mode); | 390 JSReceiver::StoreFromKeyed store_mode); |
402 Handle<Object> GetMapIndependentHandler(LookupIterator* lookup) override; | 391 Handle<Object> GetMapIndependentHandler(LookupIterator* lookup) override; |
403 Handle<Object> CompileHandler(LookupIterator* lookup, Handle<Object> value, | 392 Handle<Object> CompileHandler(LookupIterator* lookup, Handle<Object> value, |
404 CacheHolderFlag cache_holder) override; | 393 CacheHolderFlag cache_holder) override; |
405 | 394 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 | 484 |
496 // Helper for BinaryOpIC and CompareIC. | 485 // Helper for BinaryOpIC and CompareIC. |
497 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 486 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
498 void PatchInlinedSmiCode(Isolate* isolate, Address address, | 487 void PatchInlinedSmiCode(Isolate* isolate, Address address, |
499 InlinedSmiCheck check); | 488 InlinedSmiCheck check); |
500 | 489 |
501 } // namespace internal | 490 } // namespace internal |
502 } // namespace v8 | 491 } // namespace v8 |
503 | 492 |
504 #endif // V8_IC_H_ | 493 #endif // V8_IC_H_ |
OLD | NEW |