| 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 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2297 int new_number_of_transitions = 0; | 2297 int new_number_of_transitions = 0; |
| 2298 const int header = Map::kProtoTransitionHeaderSize; | 2298 const int header = Map::kProtoTransitionHeaderSize; |
| 2299 const int proto_offset = | 2299 const int proto_offset = |
| 2300 header + Map::kProtoTransitionPrototypeOffset; | 2300 header + Map::kProtoTransitionPrototypeOffset; |
| 2301 const int map_offset = header + Map::kProtoTransitionMapOffset; | 2301 const int map_offset = header + Map::kProtoTransitionMapOffset; |
| 2302 const int step = Map::kProtoTransitionElementsPerEntry; | 2302 const int step = Map::kProtoTransitionElementsPerEntry; |
| 2303 for (int i = 0; i < number_of_transitions; i++) { | 2303 for (int i = 0; i < number_of_transitions; i++) { |
| 2304 Object* prototype = prototype_transitions->get(proto_offset + i * step); | 2304 Object* prototype = prototype_transitions->get(proto_offset + i * step); |
| 2305 Object* cached_map = prototype_transitions->get(map_offset + i * step); | 2305 Object* cached_map = prototype_transitions->get(map_offset + i * step); |
| 2306 if (IsMarked(prototype) && IsMarked(cached_map)) { | 2306 if (IsMarked(prototype) && IsMarked(cached_map)) { |
| 2307 int proto_index = proto_offset + new_number_of_transitions * step; |
| 2308 int map_index = map_offset + new_number_of_transitions * step; |
| 2307 if (new_number_of_transitions != i) { | 2309 if (new_number_of_transitions != i) { |
| 2308 prototype_transitions->set_unchecked( | 2310 prototype_transitions->set_unchecked( |
| 2309 heap_, | 2311 heap_, |
| 2310 proto_offset + new_number_of_transitions * step, | 2312 proto_index, |
| 2311 prototype, | 2313 prototype, |
| 2312 UPDATE_WRITE_BARRIER); | 2314 UPDATE_WRITE_BARRIER); |
| 2313 prototype_transitions->set_unchecked( | 2315 prototype_transitions->set_unchecked( |
| 2314 heap_, | 2316 heap_, |
| 2315 map_offset + new_number_of_transitions * step, | 2317 map_index, |
| 2316 cached_map, | 2318 cached_map, |
| 2317 SKIP_WRITE_BARRIER); | 2319 SKIP_WRITE_BARRIER); |
| 2318 } | 2320 } |
| 2321 Object** slot = |
| 2322 HeapObject::RawField(prototype_transitions, |
| 2323 FixedArray::OffsetOfElementAt(proto_index)); |
| 2324 RecordSlot(slot, slot, prototype); |
| 2319 new_number_of_transitions++; | 2325 new_number_of_transitions++; |
| 2320 } | 2326 } |
| 2321 } | 2327 } |
| 2322 | 2328 |
| 2323 if (new_number_of_transitions != number_of_transitions) { | 2329 if (new_number_of_transitions != number_of_transitions) { |
| 2324 map->SetNumberOfProtoTransitions(new_number_of_transitions); | 2330 map->SetNumberOfProtoTransitions(new_number_of_transitions); |
| 2325 } | 2331 } |
| 2326 | 2332 |
| 2327 // Fill slots that became free with undefined value. | 2333 // Fill slots that became free with undefined value. |
| 2328 for (int i = new_number_of_transitions * step; | 2334 for (int i = new_number_of_transitions * step; |
| (...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3907 while (buffer != NULL) { | 3913 while (buffer != NULL) { |
| 3908 SlotsBuffer* next_buffer = buffer->next(); | 3914 SlotsBuffer* next_buffer = buffer->next(); |
| 3909 DeallocateBuffer(buffer); | 3915 DeallocateBuffer(buffer); |
| 3910 buffer = next_buffer; | 3916 buffer = next_buffer; |
| 3911 } | 3917 } |
| 3912 *buffer_address = NULL; | 3918 *buffer_address = NULL; |
| 3913 } | 3919 } |
| 3914 | 3920 |
| 3915 | 3921 |
| 3916 } } // namespace v8::internal | 3922 } } // namespace v8::internal |
| OLD | NEW |