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

Side by Side Diff: src/ast.h

Issue 755513003: Hydrogen: fix keyed loads with string keys (Closed) Base URL: gh:v8/v8@master
Patch Set: better fix Created 6 years 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 | « no previous file | src/hydrogen.cc » ('j') | src/ic/ic.h » ('J')
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_AST_H_ 5 #ifndef V8_AST_H_
6 #define V8_AST_H_ 6 #define V8_AST_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/assembler.h" 10 #include "src/assembler.h"
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 virtual bool IsMonomorphic() OVERRIDE { 1779 virtual bool IsMonomorphic() OVERRIDE {
1780 return receiver_types_.length() == 1; 1780 return receiver_types_.length() == 1;
1781 } 1781 }
1782 virtual SmallMapList* GetReceiverTypes() OVERRIDE { 1782 virtual SmallMapList* GetReceiverTypes() OVERRIDE {
1783 return &receiver_types_; 1783 return &receiver_types_;
1784 } 1784 }
1785 virtual KeyedAccessStoreMode GetStoreMode() const OVERRIDE { 1785 virtual KeyedAccessStoreMode GetStoreMode() const OVERRIDE {
1786 return STANDARD_STORE; 1786 return STANDARD_STORE;
1787 } 1787 }
1788 virtual IcCheckType GetKeyType() const OVERRIDE { 1788 virtual IcCheckType GetKeyType() const OVERRIDE {
1789 // PROPERTY key types currently aren't implemented for KeyedLoadICs. 1789 return KeyTypeField::decode(bit_field_);
1790 return ELEMENT;
1791 } 1790 }
1792 bool IsUninitialized() const { 1791 bool IsUninitialized() const {
1793 return !is_for_call() && HasNoTypeInformation(); 1792 return !is_for_call() && HasNoTypeInformation();
1794 } 1793 }
1795 bool HasNoTypeInformation() const { 1794 bool HasNoTypeInformation() const {
1796 return IsUninitializedField::decode(bit_field_); 1795 return IsUninitializedField::decode(bit_field_);
1797 } 1796 }
1798 void set_is_uninitialized(bool b) { 1797 void set_is_uninitialized(bool b) {
1799 bit_field_ = IsUninitializedField::update(bit_field_, b); 1798 bit_field_ = IsUninitializedField::update(bit_field_, b);
1800 } 1799 }
1801 void set_is_string_access(bool b) { 1800 void set_is_string_access(bool b) {
1802 bit_field_ = IsStringAccessField::update(bit_field_, b); 1801 bit_field_ = IsStringAccessField::update(bit_field_, b);
1803 } 1802 }
1803 void set_key_type(IcCheckType key_type) {
1804 bit_field_ = KeyTypeField::update(bit_field_, key_type);
1805 }
1804 void mark_for_call() { 1806 void mark_for_call() {
1805 bit_field_ = IsForCallField::update(bit_field_, true); 1807 bit_field_ = IsForCallField::update(bit_field_, true);
1806 } 1808 }
1807 bool is_for_call() const { return IsForCallField::decode(bit_field_); } 1809 bool is_for_call() const { return IsForCallField::decode(bit_field_); }
1808 1810
1809 bool IsSuperAccess() { 1811 bool IsSuperAccess() {
1810 return obj()->IsSuperReference(); 1812 return obj()->IsSuperReference();
1811 } 1813 }
1812 1814
1813 virtual FeedbackVectorRequirements ComputeFeedbackRequirements() OVERRIDE { 1815 virtual FeedbackVectorRequirements ComputeFeedbackRequirements() OVERRIDE {
(...skipping 17 matching lines...) Expand all
1831 obj_(obj), 1833 obj_(obj),
1832 key_(key) {} 1834 key_(key) {}
1833 static int parent_num_ids() { return Expression::num_ids(); } 1835 static int parent_num_ids() { return Expression::num_ids(); }
1834 1836
1835 private: 1837 private:
1836 int local_id(int n) const { return base_id() + parent_num_ids() + n; } 1838 int local_id(int n) const { return base_id() + parent_num_ids() + n; }
1837 1839
1838 class IsForCallField : public BitField8<bool, 0, 1> {}; 1840 class IsForCallField : public BitField8<bool, 0, 1> {};
1839 class IsUninitializedField : public BitField8<bool, 1, 1> {}; 1841 class IsUninitializedField : public BitField8<bool, 1, 1> {};
1840 class IsStringAccessField : public BitField8<bool, 2, 1> {}; 1842 class IsStringAccessField : public BitField8<bool, 2, 1> {};
1843 class KeyTypeField : public BitField16<IcCheckType, 3, 1> {};
Jakob Kummerow 2014/12/10 15:21:18 This must be a BitField8!
1841 uint8_t bit_field_; 1844 uint8_t bit_field_;
1842 FeedbackVectorICSlot property_feedback_slot_; 1845 FeedbackVectorICSlot property_feedback_slot_;
1843 Expression* obj_; 1846 Expression* obj_;
1844 Expression* key_; 1847 Expression* key_;
1845 SmallMapList receiver_types_; 1848 SmallMapList receiver_types_;
1846 }; 1849 };
1847 1850
1848 1851
1849 class Call FINAL : public Expression { 1852 class Call FINAL : public Expression {
1850 public: 1853 public:
(...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after
3706 private: 3709 private:
3707 Zone* zone_; 3710 Zone* zone_;
3708 Visitor visitor_; 3711 Visitor visitor_;
3709 AstValueFactory* ast_value_factory_; 3712 AstValueFactory* ast_value_factory_;
3710 }; 3713 };
3711 3714
3712 3715
3713 } } // namespace v8::internal 3716 } } // namespace v8::internal
3714 3717
3715 #endif // V8_AST_H_ 3718 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | src/ic/ic.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698