| OLD | NEW |
| 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 Loading... |
| 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 // Tells whether the value needs to be loaded. | 242 // Tells whether the value needs to be loaded. |
| 246 bool IsLoaded() { | 243 bool IsLoaded() { |
| 247 if (lookup_type_ == DESCRIPTOR_TYPE || lookup_type_ == DICTIONARY_TYPE) { | 244 if (lookup_type_ == DESCRIPTOR_TYPE || lookup_type_ == DICTIONARY_TYPE) { |
| 248 Object* target = GetLazyValue(); | 245 Object* target = GetLazyValue(); |
| 249 return !target->IsJSObject() || JSObject::cast(target)->IsLoaded(); | 246 return !target->IsJSObject() || JSObject::cast(target)->IsLoaded(); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 JSObject* holder_; | 315 JSObject* holder_; |
| 319 int number_; | 316 int number_; |
| 320 bool cacheable_; | 317 bool cacheable_; |
| 321 PropertyDetails details_; | 318 PropertyDetails details_; |
| 322 }; | 319 }; |
| 323 | 320 |
| 324 | 321 |
| 325 } } // namespace v8::internal | 322 } } // namespace v8::internal |
| 326 | 323 |
| 327 #endif // V8_PROPERTY_H_ | 324 #endif // V8_PROPERTY_H_ |
| OLD | NEW |