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

Side by Side Diff: src/property.h

Issue 14622005: Free up 11 bits in fast-mode PropertyDetails by removing the enumeration-index. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/objects-inl.h ('k') | src/property.cc » ('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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 58
59 Name* GetKey() { return key_; } 59 Name* GetKey() { return key_; }
60 Object* GetValue() { return value_; } 60 Object* GetValue() { return value_; }
61 PropertyDetails GetDetails() { return details_; } 61 PropertyDetails GetDetails() { return details_; }
62 62
63 #ifdef OBJECT_PRINT 63 #ifdef OBJECT_PRINT
64 void Print(FILE* out); 64 void Print(FILE* out);
65 #endif 65 #endif
66 66
67 void SetEnumerationIndex(int index) {
68 details_ = PropertyDetails(details_.attributes(), details_.type(),
69 details_.representation(), index);
70 }
71
72 void SetSortedKeyIndex(int index) { details_ = details_.set_pointer(index); } 67 void SetSortedKeyIndex(int index) { details_ = details_.set_pointer(index); }
73 68
74 private: 69 private:
75 Name* key_; 70 Name* key_;
76 Object* value_; 71 Object* value_;
77 PropertyDetails details_; 72 PropertyDetails details_;
78 73
79 protected: 74 protected:
80 Descriptor() : details_(Smi::FromInt(0)) {} 75 Descriptor() : details_(Smi::FromInt(0)) {}
81 76
82 void Init(Name* key, Object* value, PropertyDetails details) { 77 void Init(Name* key, Object* value, PropertyDetails details) {
83 key_ = key; 78 key_ = key;
84 value_ = value; 79 value_ = value;
85 details_ = details; 80 details_ = details;
86 } 81 }
87 82
88 Descriptor(Name* key, Object* value, PropertyDetails details) 83 Descriptor(Name* key, Object* value, PropertyDetails details)
89 : key_(key), 84 : key_(key),
90 value_(value), 85 value_(value),
91 details_(details) { } 86 details_(details) { }
92 87
93 Descriptor(Name* key, 88 Descriptor(Name* key,
94 Object* value, 89 Object* value,
95 PropertyAttributes attributes, 90 PropertyAttributes attributes,
96 PropertyType type, 91 PropertyType type,
97 Representation representation, 92 Representation representation)
98 int index)
99 : key_(key), 93 : key_(key),
100 value_(value), 94 value_(value),
101 details_(attributes, type, representation, index) { } 95 details_(attributes, type, representation) { }
102 96
103 friend class DescriptorArray; 97 friend class DescriptorArray;
104 }; 98 };
105 99
106 100
107 class FieldDescriptor: public Descriptor { 101 class FieldDescriptor: public Descriptor {
108 public: 102 public:
109 FieldDescriptor(Name* key, 103 FieldDescriptor(Name* key,
110 int field_index, 104 int field_index,
111 PropertyAttributes attributes, 105 PropertyAttributes attributes,
112 Representation representation, 106 Representation representation)
113 int index = 0)
114 : Descriptor(key, Smi::FromInt(field_index), attributes, 107 : Descriptor(key, Smi::FromInt(field_index), attributes,
115 FIELD, representation, index) {} 108 FIELD, representation) {}
116 }; 109 };
117 110
118 111
119 class ConstantFunctionDescriptor: public Descriptor { 112 class ConstantFunctionDescriptor: public Descriptor {
120 public: 113 public:
121 ConstantFunctionDescriptor(Name* key, 114 ConstantFunctionDescriptor(Name* key,
122 JSFunction* function, 115 JSFunction* function,
123 PropertyAttributes attributes, 116 PropertyAttributes attributes)
124 int index) 117 : Descriptor(key, function, attributes, CONSTANT_FUNCTION,
125 : Descriptor(key, function, attributes, 118 Representation::Tagged()) {}
126 CONSTANT_FUNCTION, Representation::Tagged(), index) {}
127 }; 119 };
128 120
129 121
130 class CallbacksDescriptor: public Descriptor { 122 class CallbacksDescriptor: public Descriptor {
131 public: 123 public:
132 CallbacksDescriptor(Name* key, 124 CallbacksDescriptor(Name* key,
133 Object* foreign, 125 Object* foreign,
134 PropertyAttributes attributes, 126 PropertyAttributes attributes)
135 int index = 0)
136 : Descriptor(key, foreign, attributes, CALLBACKS, 127 : Descriptor(key, foreign, attributes, CALLBACKS,
137 Representation::Tagged(), index) {} 128 Representation::Tagged()) {}
138 }; 129 };
139 130
140 131
141 // Holds a property index value distinguishing if it is a field index or an 132 // Holds a property index value distinguishing if it is a field index or an
142 // index inside the object header. 133 // index inside the object header.
143 class PropertyIndex { 134 class PropertyIndex {
144 public: 135 public:
145 static PropertyIndex NewFieldIndex(int index) { 136 static PropertyIndex NewFieldIndex(int index) {
146 return PropertyIndex(index, false); 137 return PropertyIndex(index, false);
147 } 138 }
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 JSReceiver* holder_; 483 JSReceiver* holder_;
493 int number_; 484 int number_;
494 bool cacheable_; 485 bool cacheable_;
495 PropertyDetails details_; 486 PropertyDetails details_;
496 }; 487 };
497 488
498 489
499 } } // namespace v8::internal 490 } } // namespace v8::internal
500 491
501 #endif // V8_PROPERTY_H_ 492 #endif // V8_PROPERTY_H_
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/property.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698