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

Side by Side Diff: src/property.h

Issue 660095: Merge revision 3813 to 3930 from bleeding_edge to partial snapshots branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: '' Created 10 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
« no previous file with comments | « src/parser.cc ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 lookup_type_ = INTERCEPTOR_TYPE; 194 lookup_type_ = INTERCEPTOR_TYPE;
195 holder_ = holder; 195 holder_ = holder;
196 details_ = PropertyDetails(NONE, INTERCEPTOR); 196 details_ = PropertyDetails(NONE, INTERCEPTOR);
197 } 197 }
198 198
199 void NotFound() { 199 void NotFound() {
200 lookup_type_ = NOT_FOUND; 200 lookup_type_ = NOT_FOUND;
201 } 201 }
202 202
203 JSObject* holder() { 203 JSObject* holder() {
204 ASSERT(IsValid()); 204 ASSERT(IsFound());
205 return holder_; 205 return holder_;
206 } 206 }
207 207
208 PropertyType type() { 208 PropertyType type() {
209 ASSERT(IsValid()); 209 ASSERT(IsFound());
210 return details_.type(); 210 return details_.type();
211 } 211 }
212 212
213 bool IsTransitionType() {
214 PropertyType t = type();
215 if (t == MAP_TRANSITION || t == CONSTANT_TRANSITION) return true;
216 return false;
217 }
218
219 PropertyAttributes GetAttributes() { 213 PropertyAttributes GetAttributes() {
220 ASSERT(IsValid()); 214 ASSERT(IsFound());
221 return details_.attributes(); 215 return details_.attributes();
222 } 216 }
223 217
224 PropertyDetails GetPropertyDetails() { 218 PropertyDetails GetPropertyDetails() {
225 return details_; 219 return details_;
226 } 220 }
227 221
228 bool IsReadOnly() { return details_.IsReadOnly(); } 222 bool IsReadOnly() { return details_.IsReadOnly(); }
229 bool IsDontDelete() { return details_.IsDontDelete(); } 223 bool IsDontDelete() { return details_.IsDontDelete(); }
230 bool IsDontEnum() { return details_.IsDontEnum(); } 224 bool IsDontEnum() { return details_.IsDontEnum(); }
231 bool IsDeleted() { return details_.IsDeleted(); } 225 bool IsDeleted() { return details_.IsDeleted(); }
226 bool IsFound() { return lookup_type_ != NOT_FOUND; }
232 227
233 bool IsValid() { return lookup_type_ != NOT_FOUND; } 228 // Is the result is a property excluding transitions and the null
234 bool IsNotFound() { return lookup_type_ == NOT_FOUND; } 229 // descriptor?
230 bool IsProperty() {
231 return IsFound() && (type() < FIRST_PHANTOM_PROPERTY_TYPE);
232 }
235 233
236 // Tells whether the result is a property. 234 // Is the result a property or a transition?
237 // Excluding transitions and the null descriptor. 235 bool IsPropertyOrTransition() {
238 bool IsProperty() { 236 return IsFound() && (type() != NULL_DESCRIPTOR);
239 return IsValid() && type() < FIRST_PHANTOM_PROPERTY_TYPE;
240 } 237 }
241 238
242 bool IsCacheable() { return cacheable_; } 239 bool IsCacheable() { return cacheable_; }
243 void DisallowCaching() { cacheable_ = false; } 240 void DisallowCaching() { cacheable_ = false; }
244 241
245 Object* GetLazyValue() { 242 Object* GetLazyValue() {
246 switch (type()) { 243 switch (type()) {
247 case FIELD: 244 case FIELD:
248 return holder()->FastPropertyAt(GetFieldIndex()); 245 return holder()->FastPropertyAt(GetFieldIndex());
249 case NORMAL: { 246 case NORMAL: {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 JSObject* holder_; 306 JSObject* holder_;
310 int number_; 307 int number_;
311 bool cacheable_; 308 bool cacheable_;
312 PropertyDetails details_; 309 PropertyDetails details_;
313 }; 310 };
314 311
315 312
316 } } // namespace v8::internal 313 } } // namespace v8::internal
317 314
318 #endif // V8_PROPERTY_H_ 315 #endif // V8_PROPERTY_H_
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/property.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698