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

Side by Side Diff: src/property-details.h

Issue 9320066: Removed IsTransitionType predicate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | Annotate | Revision Log
« src/property.cc ('K') | « src/property.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
Jakob Kummerow 2012/02/03 13:17:14 nit: 2012
Sven Panne 2012/02/03 13:33:14 Done.
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
11 // with the distribution. 11 // with the distribution.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 ELEMENTS_TRANSITION = 7, 66 ELEMENTS_TRANSITION = 7,
67 CONSTANT_TRANSITION = 8, // only in fast mode 67 CONSTANT_TRANSITION = 8, // only in fast mode
68 NULL_DESCRIPTOR = 9, // only in fast mode 68 NULL_DESCRIPTOR = 9, // only in fast mode
69 // There are no IC stubs for NULL_DESCRIPTORS. Therefore, 69 // There are no IC stubs for NULL_DESCRIPTORS. Therefore,
70 // NULL_DESCRIPTOR can be used as the type flag for IC stubs for 70 // NULL_DESCRIPTOR can be used as the type flag for IC stubs for
71 // nonexistent properties. 71 // nonexistent properties.
72 NONEXISTENT = NULL_DESCRIPTOR 72 NONEXISTENT = NULL_DESCRIPTOR
73 }; 73 };
74 74
75 75
76 inline bool IsTransitionType(PropertyType type) {
77 switch (type) {
78 case MAP_TRANSITION:
79 case CONSTANT_TRANSITION:
80 case ELEMENTS_TRANSITION:
81 return true;
82 case NORMAL:
83 case FIELD:
84 case CONSTANT_FUNCTION:
85 case CALLBACKS:
86 case HANDLER:
87 case INTERCEPTOR:
88 case NULL_DESCRIPTOR:
89 return false;
90 }
91 UNREACHABLE(); // keep the compiler happy
92 return false;
93 }
94
95
96 inline bool IsRealProperty(PropertyType type) { 76 inline bool IsRealProperty(PropertyType type) {
97 switch (type) { 77 switch (type) {
98 case NORMAL: 78 case NORMAL:
99 case FIELD: 79 case FIELD:
100 case CONSTANT_FUNCTION: 80 case CONSTANT_FUNCTION:
101 case CALLBACKS: 81 case CALLBACKS:
102 case HANDLER: 82 case HANDLER:
103 case INTERCEPTOR: 83 case INTERCEPTOR:
104 return true; 84 return true;
105 case MAP_TRANSITION: 85 case MAP_TRANSITION:
(...skipping 26 matching lines...) Expand all
132 ASSERT(attributes == this->attributes()); 112 ASSERT(attributes == this->attributes());
133 ASSERT(index == this->index()); 113 ASSERT(index == this->index());
134 } 114 }
135 115
136 // Conversion for storing details as Object*. 116 // Conversion for storing details as Object*.
137 explicit inline PropertyDetails(Smi* smi); 117 explicit inline PropertyDetails(Smi* smi);
138 inline Smi* AsSmi(); 118 inline Smi* AsSmi();
139 119
140 PropertyType type() { return TypeField::decode(value_); } 120 PropertyType type() { return TypeField::decode(value_); }
141 121
142 bool IsTransition() {
143 PropertyType t = type();
144 ASSERT(t != INTERCEPTOR);
145 return IsTransitionType(t);
146 }
147
148 bool IsProperty() { 122 bool IsProperty() {
149 return IsRealProperty(type()); 123 return IsRealProperty(type());
150 } 124 }
151 125
152 PropertyAttributes attributes() { return AttributesField::decode(value_); } 126 PropertyAttributes attributes() { return AttributesField::decode(value_); }
153 127
154 int index() { return StorageField::decode(value_); } 128 int index() { return StorageField::decode(value_); }
155 129
156 inline PropertyDetails AsDeleted(); 130 inline PropertyDetails AsDeleted();
157 131
(...skipping 15 matching lines...) Expand all
173 147
174 static const int kInitialIndex = 1; 148 static const int kInitialIndex = 1;
175 149
176 private: 150 private:
177 uint32_t value_; 151 uint32_t value_;
178 }; 152 };
179 153
180 } } // namespace v8::internal 154 } } // namespace v8::internal
181 155
182 #endif // V8_PROPERTY_DETAILS_H_ 156 #endif // V8_PROPERTY_DETAILS_H_
OLDNEW
« src/property.cc ('K') | « src/property.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698