OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 9429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9440 if (descriptors_owner_died) { | 9440 if (descriptors_owner_died) { |
9441 if (number_of_own_descriptors > 0) { | 9441 if (number_of_own_descriptors > 0) { |
9442 TrimDescriptorArray(heap, this, descriptors, number_of_own_descriptors); | 9442 TrimDescriptorArray(heap, this, descriptors, number_of_own_descriptors); |
9443 ASSERT(descriptors->number_of_descriptors() == number_of_own_descriptors); | 9443 ASSERT(descriptors->number_of_descriptors() == number_of_own_descriptors); |
9444 set_owns_descriptors(true); | 9444 set_owns_descriptors(true); |
9445 } else { | 9445 } else { |
9446 ASSERT(descriptors == GetHeap()->empty_descriptor_array()); | 9446 ASSERT(descriptors == GetHeap()->empty_descriptor_array()); |
9447 } | 9447 } |
9448 } | 9448 } |
9449 | 9449 |
| 9450 // Note that we never eliminate a transition array, though we might right-trim |
| 9451 // such that number_of_transitions() == 0. If this assumption changes, |
| 9452 // TransitionArray::CopyInsert() will need to deal with the case that a |
| 9453 // transition array disappeared during GC. |
9450 int trim = t->number_of_transitions() - transition_index; | 9454 int trim = t->number_of_transitions() - transition_index; |
9451 if (trim > 0) { | 9455 if (trim > 0) { |
9452 RightTrimFixedArray<Heap::FROM_GC>(heap, t, t->IsSimpleTransition() | 9456 RightTrimFixedArray<Heap::FROM_GC>(heap, t, t->IsSimpleTransition() |
9453 ? trim : trim * TransitionArray::kTransitionSize); | 9457 ? trim : trim * TransitionArray::kTransitionSize); |
9454 } | 9458 } |
| 9459 ASSERT(HasTransitionArray()); |
9455 } | 9460 } |
9456 | 9461 |
9457 | 9462 |
9458 int Map::Hash() { | 9463 int Map::Hash() { |
9459 // For performance reasons we only hash the 3 most variable fields of a map: | 9464 // For performance reasons we only hash the 3 most variable fields of a map: |
9460 // constructor, prototype and bit_field2. | 9465 // constructor, prototype and bit_field2. |
9461 | 9466 |
9462 // Shift away the tag. | 9467 // Shift away the tag. |
9463 int hash = (static_cast<uint32_t>( | 9468 int hash = (static_cast<uint32_t>( |
9464 reinterpret_cast<uintptr_t>(constructor())) >> 2); | 9469 reinterpret_cast<uintptr_t>(constructor())) >> 2); |
(...skipping 7164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16629 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16634 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16630 static const char* error_messages_[] = { | 16635 static const char* error_messages_[] = { |
16631 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16636 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16632 }; | 16637 }; |
16633 #undef ERROR_MESSAGES_TEXTS | 16638 #undef ERROR_MESSAGES_TEXTS |
16634 return error_messages_[reason]; | 16639 return error_messages_[reason]; |
16635 } | 16640 } |
16636 | 16641 |
16637 | 16642 |
16638 } } // namespace v8::internal | 16643 } } // namespace v8::internal |
OLD | NEW |