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

Side by Side Diff: src/ic/ic.h

Issue 898983002: Add strong mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Code review + fixes Created 5 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
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/objects.h » ('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 // 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 10
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 private: 513 private:
514 static void Clear(Isolate* isolate, Address address, Code* target, 514 static void Clear(Isolate* isolate, Address address, Code* target,
515 ConstantPoolArray* constant_pool); 515 ConstantPoolArray* constant_pool);
516 516
517 friend class IC; 517 friend class IC;
518 }; 518 };
519 519
520 520
521 class StoreIC : public IC { 521 class StoreIC : public IC {
522 public: 522 public:
523 STATIC_ASSERT(i::LANGUAGE_END == 2); 523 STATIC_ASSERT(i::LANGUAGE_END == 3);
524 class LanguageModeState : public BitField<LanguageMode, 1, 1> {}; 524 class LanguageModeState : public BitField<LanguageMode, 1, 2> {};
525 static ExtraICState ComputeExtraICState(LanguageMode flag) { 525 static ExtraICState ComputeExtraICState(LanguageMode flag) {
526 return LanguageModeState::encode(flag); 526 return LanguageModeState::encode(flag);
527 } 527 }
528 static LanguageMode GetLanguageMode(ExtraICState state) { 528 static LanguageMode GetLanguageMode(ExtraICState state) {
529 return LanguageModeState::decode(state); 529 return LanguageModeState::decode(state);
530 } 530 }
531 531
532 // For convenience, a statically declared encoding of strict mode extra 532 // For convenience, a statically declared encoding of strict mode extra
533 // IC state. 533 // IC state.
534 static const ExtraICState kStrictModeState = STRICT 534 static const ExtraICState kStrictModeState = STRICT
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 enum KeyedStoreCheckMap { kDontCheckMap, kCheckMap }; 598 enum KeyedStoreCheckMap { kDontCheckMap, kCheckMap };
599 599
600 600
601 enum KeyedStoreIncrementLength { kDontIncrementLength, kIncrementLength }; 601 enum KeyedStoreIncrementLength { kDontIncrementLength, kIncrementLength };
602 602
603 603
604 class KeyedStoreIC : public StoreIC { 604 class KeyedStoreIC : public StoreIC {
605 public: 605 public:
606 // ExtraICState bits (building on IC) 606 // ExtraICState bits (building on IC)
607 // ExtraICState bits 607 // ExtraICState bits
608 // When more language modes are added, these BitFields need to move too.
609 STATIC_ASSERT(i::LANGUAGE_END == 3);
608 class ExtraICStateKeyedAccessStoreMode 610 class ExtraICStateKeyedAccessStoreMode
609 : public BitField<KeyedAccessStoreMode, 2, 4> {}; // NOLINT 611 : public BitField<KeyedAccessStoreMode, 3, 4> {}; // NOLINT
610 612
611 class IcCheckTypeField : public BitField<IcCheckType, 6, 1> {}; 613 class IcCheckTypeField : public BitField<IcCheckType, 7, 1> {};
612 614
613 static ExtraICState ComputeExtraICState(LanguageMode flag, 615 static ExtraICState ComputeExtraICState(LanguageMode flag,
614 KeyedAccessStoreMode mode) { 616 KeyedAccessStoreMode mode) {
615 return LanguageModeState::encode(flag) | 617 return LanguageModeState::encode(flag) |
616 ExtraICStateKeyedAccessStoreMode::encode(mode) | 618 ExtraICStateKeyedAccessStoreMode::encode(mode) |
617 IcCheckTypeField::encode(ELEMENT); 619 IcCheckTypeField::encode(ELEMENT);
618 } 620 }
619 621
620 static KeyedAccessStoreMode GetKeyedAccessStoreMode( 622 static KeyedAccessStoreMode GetKeyedAccessStoreMode(
621 ExtraICState extra_state) { 623 ExtraICState extra_state) {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 772
771 // Support functions for interceptor handlers. 773 // Support functions for interceptor handlers.
772 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); 774 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly);
773 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); 775 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor);
774 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); 776 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor);
775 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); 777 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor);
776 } 778 }
777 } // namespace v8::internal 779 } // namespace v8::internal
778 780
779 #endif // V8_IC_H_ 781 #endif // V8_IC_H_
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698