| 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 3434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3445 inline void SetSortedKey(int pointer, int descriptor_number); | 3445 inline void SetSortedKey(int pointer, int descriptor_number); |
| 3446 inline void InitializeRepresentations(Representation representation); | 3446 inline void InitializeRepresentations(Representation representation); |
| 3447 inline void SetRepresentation(int descriptor_number, | 3447 inline void SetRepresentation(int descriptor_number, |
| 3448 Representation representation); | 3448 Representation representation); |
| 3449 | 3449 |
| 3450 // Accessor for complete descriptor. | 3450 // Accessor for complete descriptor. |
| 3451 inline void Get(int descriptor_number, Descriptor* desc); | 3451 inline void Get(int descriptor_number, Descriptor* desc); |
| 3452 inline void Set(int descriptor_number, | 3452 inline void Set(int descriptor_number, |
| 3453 Descriptor* desc, | 3453 Descriptor* desc, |
| 3454 const WhitenessWitness&); | 3454 const WhitenessWitness&); |
| 3455 inline void Set(int descriptor_number, Descriptor* desc); | 3455 void Replace(int descriptor_number, Descriptor* descriptor); |
| 3456 | 3456 |
| 3457 // Append automatically sets the enumeration index. This should only be used | 3457 // Append automatically sets the enumeration index. This should only be used |
| 3458 // to add descriptors in bulk at the end, followed by sorting the descriptor | 3458 // to add descriptors in bulk at the end, followed by sorting the descriptor |
| 3459 // array. | 3459 // array. |
| 3460 inline void Append(Descriptor* desc, const WhitenessWitness&); | 3460 inline void Append(Descriptor* desc, const WhitenessWitness&); |
| 3461 inline void Append(Descriptor* desc); | 3461 inline void Append(Descriptor* desc); |
| 3462 | 3462 |
| 3463 // Transfer a complete descriptor from the src descriptor array to this | |
| 3464 // descriptor array. | |
| 3465 void CopyFrom(int dst_index, | |
| 3466 DescriptorArray* src, | |
| 3467 int src_index, | |
| 3468 const WhitenessWitness&); | |
| 3469 static Handle<DescriptorArray> Merge(Handle<Map> left_map, | 3463 static Handle<DescriptorArray> Merge(Handle<Map> left_map, |
| 3470 int verbatim, | 3464 int verbatim, |
| 3471 int valid, | 3465 int valid, |
| 3472 int new_size, | 3466 int new_size, |
| 3473 int modify_index, | 3467 int modify_index, |
| 3474 StoreMode store_mode, | 3468 StoreMode store_mode, |
| 3475 Handle<Map> right_map) | 3469 Handle<Map> right_map) |
| 3476 V8_WARN_UNUSED_RESULT; | 3470 V8_WARN_UNUSED_RESULT; |
| 3477 | 3471 |
| 3478 bool IsMoreGeneralThan(int verbatim, | 3472 bool IsMoreGeneralThan(int verbatim, |
| 3479 int valid, | 3473 int valid, |
| 3480 int new_size, | 3474 int new_size, |
| 3481 DescriptorArray* other); | 3475 DescriptorArray* other); |
| 3482 | 3476 |
| 3483 static Handle<DescriptorArray> CopyUpTo(Handle<DescriptorArray> desc, | 3477 static Handle<DescriptorArray> CopyUpTo(Handle<DescriptorArray> desc, |
| 3484 int enumeration_index); | 3478 int enumeration_index, |
| 3479 int slack = 0); |
| 3485 | 3480 |
| 3486 static Handle<DescriptorArray> CopyUpToAddAttributes( | 3481 static Handle<DescriptorArray> CopyUpToAddAttributes( |
| 3487 Handle<DescriptorArray> desc, | 3482 Handle<DescriptorArray> desc, |
| 3488 int enumeration_index, | 3483 int enumeration_index, |
| 3489 PropertyAttributes attributes); | 3484 PropertyAttributes attributes, |
| 3485 int slack = 0); |
| 3490 | 3486 |
| 3491 // Sort the instance descriptors by the hash codes of their keys. | 3487 // Sort the instance descriptors by the hash codes of their keys. |
| 3492 void Sort(); | 3488 void Sort(); |
| 3493 | 3489 |
| 3494 // Search the instance descriptors for given name. | 3490 // Search the instance descriptors for given name. |
| 3495 INLINE(int Search(Name* name, int number_of_own_descriptors)); | 3491 INLINE(int Search(Name* name, int number_of_own_descriptors)); |
| 3496 | 3492 |
| 3497 // As the above, but uses DescriptorLookupCache and updates it when | 3493 // As the above, but uses DescriptorLookupCache and updates it when |
| 3498 // necessary. | 3494 // necessary. |
| 3499 INLINE(int SearchWithCache(Name* name, Map* map)); | 3495 INLINE(int SearchWithCache(Name* name, Map* map)); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3582 (descriptor_number * kDescriptorSize) + | 3578 (descriptor_number * kDescriptorSize) + |
| 3583 kDescriptorDetails; | 3579 kDescriptorDetails; |
| 3584 } | 3580 } |
| 3585 | 3581 |
| 3586 static int ToValueIndex(int descriptor_number) { | 3582 static int ToValueIndex(int descriptor_number) { |
| 3587 return kFirstIndex + | 3583 return kFirstIndex + |
| 3588 (descriptor_number * kDescriptorSize) + | 3584 (descriptor_number * kDescriptorSize) + |
| 3589 kDescriptorValue; | 3585 kDescriptorValue; |
| 3590 } | 3586 } |
| 3591 | 3587 |
| 3588 // Transfer a complete descriptor from the src descriptor array to this |
| 3589 // descriptor array. |
| 3590 void CopyFrom(int index, |
| 3591 DescriptorArray* src, |
| 3592 const WhitenessWitness&); |
| 3593 |
| 3594 inline void Set(int descriptor_number, Descriptor* desc); |
| 3595 |
| 3592 // Swap first and second descriptor. | 3596 // Swap first and second descriptor. |
| 3593 inline void SwapSortedKeys(int first, int second); | 3597 inline void SwapSortedKeys(int first, int second); |
| 3594 | 3598 |
| 3595 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); | 3599 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); |
| 3596 }; | 3600 }; |
| 3597 | 3601 |
| 3598 | 3602 |
| 3599 enum SearchMode { ALL_ENTRIES, VALID_ENTRIES }; | 3603 enum SearchMode { ALL_ENTRIES, VALID_ENTRIES }; |
| 3600 | 3604 |
| 3601 template<SearchMode search_mode, typename T> | 3605 template<SearchMode search_mode, typename T> |
| (...skipping 7409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11011 } else { | 11015 } else { |
| 11012 value &= ~(1 << bit_position); | 11016 value &= ~(1 << bit_position); |
| 11013 } | 11017 } |
| 11014 return value; | 11018 return value; |
| 11015 } | 11019 } |
| 11016 }; | 11020 }; |
| 11017 | 11021 |
| 11018 } } // namespace v8::internal | 11022 } } // namespace v8::internal |
| 11019 | 11023 |
| 11020 #endif // V8_OBJECTS_H_ | 11024 #endif // V8_OBJECTS_H_ |
| OLD | NEW |