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 2635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2646 | 2646 |
2647 int new_number_of_transitions = 0; | 2647 int new_number_of_transitions = 0; |
2648 const int header = Map::kProtoTransitionHeaderSize; | 2648 const int header = Map::kProtoTransitionHeaderSize; |
2649 const int proto_offset = header + Map::kProtoTransitionPrototypeOffset; | 2649 const int proto_offset = header + Map::kProtoTransitionPrototypeOffset; |
2650 const int map_offset = header + Map::kProtoTransitionMapOffset; | 2650 const int map_offset = header + Map::kProtoTransitionMapOffset; |
2651 const int step = Map::kProtoTransitionElementsPerEntry; | 2651 const int step = Map::kProtoTransitionElementsPerEntry; |
2652 for (int i = 0; i < number_of_transitions; i++) { | 2652 for (int i = 0; i < number_of_transitions; i++) { |
2653 Object* prototype = prototype_transitions->get(proto_offset + i * step); | 2653 Object* prototype = prototype_transitions->get(proto_offset + i * step); |
2654 Object* cached_map = prototype_transitions->get(map_offset + i * step); | 2654 Object* cached_map = prototype_transitions->get(map_offset + i * step); |
2655 if (IsMarked(prototype) && IsMarked(cached_map)) { | 2655 if (IsMarked(prototype) && IsMarked(cached_map)) { |
| 2656 ASSERT(!prototype->IsUndefined()); |
2656 int proto_index = proto_offset + new_number_of_transitions * step; | 2657 int proto_index = proto_offset + new_number_of_transitions * step; |
2657 int map_index = map_offset + new_number_of_transitions * step; | 2658 int map_index = map_offset + new_number_of_transitions * step; |
2658 if (new_number_of_transitions != i) { | 2659 if (new_number_of_transitions != i) { |
2659 prototype_transitions->set( | 2660 prototype_transitions->set( |
2660 proto_index, | 2661 proto_index, |
2661 prototype, | 2662 prototype, |
2662 UPDATE_WRITE_BARRIER); | 2663 UPDATE_WRITE_BARRIER); |
2663 prototype_transitions->set( | 2664 prototype_transitions->set( |
2664 map_index, | 2665 map_index, |
2665 cached_map, | 2666 cached_map, |
(...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4476 while (buffer != NULL) { | 4477 while (buffer != NULL) { |
4477 SlotsBuffer* next_buffer = buffer->next(); | 4478 SlotsBuffer* next_buffer = buffer->next(); |
4478 DeallocateBuffer(buffer); | 4479 DeallocateBuffer(buffer); |
4479 buffer = next_buffer; | 4480 buffer = next_buffer; |
4480 } | 4481 } |
4481 *buffer_address = NULL; | 4482 *buffer_address = NULL; |
4482 } | 4483 } |
4483 | 4484 |
4484 | 4485 |
4485 } } // namespace v8::internal | 4486 } } // namespace v8::internal |
OLD | NEW |