OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 bool IsDeleted() { return details_.IsDeleted(); } | 258 bool IsDeleted() { return details_.IsDeleted(); } |
259 bool IsFound() { return lookup_type_ != NOT_FOUND; } | 259 bool IsFound() { return lookup_type_ != NOT_FOUND; } |
260 bool IsHandler() { return lookup_type_ == HANDLER_TYPE; } | 260 bool IsHandler() { return lookup_type_ == HANDLER_TYPE; } |
261 | 261 |
262 // Is the result is a property excluding transitions and the null | 262 // Is the result is a property excluding transitions and the null |
263 // descriptor? | 263 // descriptor? |
264 bool IsProperty() { | 264 bool IsProperty() { |
265 return IsFound() && GetPropertyDetails().IsProperty(); | 265 return IsFound() && GetPropertyDetails().IsProperty(); |
266 } | 266 } |
267 | 267 |
268 // Is the result a property or a transition? | |
269 bool IsPropertyOrTransition() { | |
270 return IsFound() && (type() != NULL_DESCRIPTOR); | |
271 } | |
272 | |
273 bool IsCacheable() { return cacheable_; } | 268 bool IsCacheable() { return cacheable_; } |
274 void DisallowCaching() { cacheable_ = false; } | 269 void DisallowCaching() { cacheable_ = false; } |
275 | 270 |
276 Object* GetLazyValue() { | 271 Object* GetLazyValue() { |
277 switch (type()) { | 272 switch (type()) { |
278 case FIELD: | 273 case FIELD: |
279 return holder()->FastPropertyAt(GetFieldIndex()); | 274 return holder()->FastPropertyAt(GetFieldIndex()); |
280 case NORMAL: { | 275 case NORMAL: { |
281 Object* value; | 276 Object* value; |
282 value = holder()->property_dictionary()->ValueAt(GetDictionaryEntry()); | 277 value = holder()->property_dictionary()->ValueAt(GetDictionaryEntry()); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 JSReceiver* holder_; | 371 JSReceiver* holder_; |
377 int number_; | 372 int number_; |
378 bool cacheable_; | 373 bool cacheable_; |
379 PropertyDetails details_; | 374 PropertyDetails details_; |
380 }; | 375 }; |
381 | 376 |
382 | 377 |
383 } } // namespace v8::internal | 378 } } // namespace v8::internal |
384 | 379 |
385 #endif // V8_PROPERTY_H_ | 380 #endif // V8_PROPERTY_H_ |
OLD | NEW |