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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 enum KeyedStoreIncrementLength { kDontIncrementLength, kIncrementLength }; | 518 enum KeyedStoreIncrementLength { kDontIncrementLength, kIncrementLength }; |
519 | 519 |
520 | 520 |
521 class KeyedStoreIC : public StoreIC { | 521 class KeyedStoreIC : public StoreIC { |
522 public: | 522 public: |
523 // ExtraICState bits (building on IC) | 523 // ExtraICState bits (building on IC) |
524 // ExtraICState bits | 524 // ExtraICState bits |
525 // When more language modes are added, these BitFields need to move too. | 525 // When more language modes are added, these BitFields need to move too. |
526 STATIC_ASSERT(i::LANGUAGE_END == 3); | 526 STATIC_ASSERT(i::LANGUAGE_END == 3); |
527 class ExtraICStateKeyedAccessStoreMode | 527 class ExtraICStateKeyedAccessStoreMode |
528 : public BitField<KeyedAccessStoreMode, 3, 4> {}; // NOLINT | 528 : public BitField<KeyedAccessStoreMode, 3, 3> {}; // NOLINT |
529 | 529 |
530 class IcCheckTypeField : public BitField<IcCheckType, 7, 1> {}; | 530 class IcCheckTypeField : public BitField<IcCheckType, 6, 1> {}; |
531 | 531 |
532 static ExtraICState ComputeExtraICState(LanguageMode flag, | 532 static ExtraICState ComputeExtraICState(LanguageMode flag, |
533 KeyedAccessStoreMode mode) { | 533 KeyedAccessStoreMode mode) { |
534 return StoreICState(flag).GetExtraICState() | | 534 return StoreICState(flag).GetExtraICState() | |
535 ExtraICStateKeyedAccessStoreMode::encode(mode) | | 535 ExtraICStateKeyedAccessStoreMode::encode(mode) | |
536 IcCheckTypeField::encode(ELEMENT); | 536 IcCheckTypeField::encode(ELEMENT); |
537 } | 537 } |
538 | 538 |
539 static KeyedAccessStoreMode GetKeyedAccessStoreMode( | 539 static KeyedAccessStoreMode GetKeyedAccessStoreMode( |
540 ExtraICState extra_state) { | 540 ExtraICState extra_state) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 | 592 |
593 private: | 593 private: |
594 inline void set_target(Code* code); | 594 inline void set_target(Code* code); |
595 | 595 |
596 static void Clear(Isolate* isolate, Address address, Code* target, | 596 static void Clear(Isolate* isolate, Address address, Code* target, |
597 Address constant_pool); | 597 Address constant_pool); |
598 | 598 |
599 Handle<Map> ComputeTransitionedMap(Handle<Map> map, | 599 Handle<Map> ComputeTransitionedMap(Handle<Map> map, |
600 KeyedAccessStoreMode store_mode); | 600 KeyedAccessStoreMode store_mode); |
601 | 601 |
| 602 void ValidateStoreMode(Handle<Code> stub); |
| 603 |
602 friend class IC; | 604 friend class IC; |
603 }; | 605 }; |
604 | 606 |
605 | 607 |
606 // Type Recording BinaryOpIC, that records the types of the inputs and outputs. | 608 // Type Recording BinaryOpIC, that records the types of the inputs and outputs. |
607 class BinaryOpIC : public IC { | 609 class BinaryOpIC : public IC { |
608 public: | 610 public: |
609 explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) {} | 611 explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) {} |
610 | 612 |
611 static Builtins::JavaScript TokenToJSBuiltin(Token::Value op, | 613 static Builtins::JavaScript TokenToJSBuiltin(Token::Value op, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 | 676 |
675 | 677 |
676 // Helper for BinaryOpIC and CompareIC. | 678 // Helper for BinaryOpIC and CompareIC. |
677 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 679 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
678 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); | 680 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); |
679 | 681 |
680 } | 682 } |
681 } // namespace v8::internal | 683 } // namespace v8::internal |
682 | 684 |
683 #endif // V8_IC_H_ | 685 #endif // V8_IC_H_ |
OLD | NEW |