OLD | NEW |
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) { | 67 void SetEnumerationIndex(int index) { |
68 details_ = PropertyDetails(details_.attributes(), details_.type(), index); | 68 details_ = PropertyDetails(details_.attributes(), details_.type(), index); |
69 } | 69 } |
70 | 70 |
71 void SetSortedKey(int index) { details_ = details_.set_pointer(index); } | 71 void SetSortedKeyIndex(int index) { details_ = details_.set_pointer(index); } |
72 | 72 |
73 private: | 73 private: |
74 String* key_; | 74 String* key_; |
75 Object* value_; | 75 Object* value_; |
76 PropertyDetails details_; | 76 PropertyDetails details_; |
77 | 77 |
78 protected: | 78 protected: |
79 Descriptor() : details_(Smi::FromInt(0)) {} | 79 Descriptor() : details_(Smi::FromInt(0)) {} |
80 | 80 |
81 void Init(String* key, Object* value, PropertyDetails details) { | 81 void Init(String* key, Object* value, PropertyDetails details) { |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 if (lookup_type_ == DESCRIPTOR_TYPE) { | 377 if (lookup_type_ == DESCRIPTOR_TYPE) { |
378 return GetValueFromMap(holder()->map()); | 378 return GetValueFromMap(holder()->map()); |
379 } | 379 } |
380 // In the dictionary case, the data is held in the value field. | 380 // In the dictionary case, the data is held in the value field. |
381 ASSERT(lookup_type_ == DICTIONARY_TYPE); | 381 ASSERT(lookup_type_ == DICTIONARY_TYPE); |
382 return holder()->GetNormalizedProperty(this); | 382 return holder()->GetNormalizedProperty(this); |
383 } | 383 } |
384 | 384 |
385 Object* GetValueFromMap(Map* map) const { | 385 Object* GetValueFromMap(Map* map) const { |
386 ASSERT(lookup_type_ == DESCRIPTOR_TYPE); | 386 ASSERT(lookup_type_ == DESCRIPTOR_TYPE); |
| 387 ASSERT(number_ < map->NumberOfOwnDescriptors()); |
387 return map->instance_descriptors()->GetValue(number_); | 388 return map->instance_descriptors()->GetValue(number_); |
388 } | 389 } |
389 | 390 |
390 void Iterate(ObjectVisitor* visitor); | 391 void Iterate(ObjectVisitor* visitor); |
391 | 392 |
392 private: | 393 private: |
393 Isolate* isolate_; | 394 Isolate* isolate_; |
394 LookupResult* next_; | 395 LookupResult* next_; |
395 | 396 |
396 // Where did we find the result; | 397 // Where did we find the result; |
(...skipping 10 matching lines...) Expand all Loading... |
407 JSReceiver* holder_; | 408 JSReceiver* holder_; |
408 int number_; | 409 int number_; |
409 bool cacheable_; | 410 bool cacheable_; |
410 PropertyDetails details_; | 411 PropertyDetails details_; |
411 }; | 412 }; |
412 | 413 |
413 | 414 |
414 } } // namespace v8::internal | 415 } } // namespace v8::internal |
415 | 416 |
416 #endif // V8_PROPERTY_H_ | 417 #endif // V8_PROPERTY_H_ |
OLD | NEW |