Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2176 if (new_number_of_transitions != i) { | 2176 if (new_number_of_transitions != i) { |
| 2177 prototype_transitions->set_unchecked( | 2177 prototype_transitions->set_unchecked( |
| 2178 heap_, | 2178 heap_, |
| 2179 proto_offset + new_number_of_transitions * step, | 2179 proto_offset + new_number_of_transitions * step, |
| 2180 prototype, | 2180 prototype, |
| 2181 UPDATE_WRITE_BARRIER); | 2181 UPDATE_WRITE_BARRIER); |
| 2182 prototype_transitions->set_unchecked( | 2182 prototype_transitions->set_unchecked( |
| 2183 heap_, | 2183 heap_, |
| 2184 map_offset + new_number_of_transitions * step, | 2184 map_offset + new_number_of_transitions * step, |
| 2185 cached_map, | 2185 cached_map, |
| 2186 SKIP_WRITE_BARRIER); | 2186 SKIP_WRITE_BARRIER);//Is this OK? |
|
Vyacheslav Egorov (Chromium)
2011/09/08 11:56:23
Yes it is we are in the middle of the GC so all in
| |
| 2187 } | 2187 } |
| 2188 } | 2188 } |
| 2189 | 2189 |
| 2190 // Fill slots that became free with undefined value. | 2190 // Fill slots that became free with undefined value. |
| 2191 Object* undefined = heap()->undefined_value(); | 2191 Object* undefined = heap()->undefined_value(); |
| 2192 for (int i = new_number_of_transitions * step; | 2192 for (int i = new_number_of_transitions * step; |
| 2193 i < number_of_transitions * step; | 2193 i < number_of_transitions * step; |
| 2194 i++) { | 2194 i++) { |
| 2195 // The undefined object is on a page that is never compacted and never | |
|
Vyacheslav Egorov (Chromium)
2011/09/08 11:56:23
And it's also root. And we are in the middle of GC
| |
| 2196 // in new space so it is OK to skip the write barrier. | |
| 2195 prototype_transitions->set_unchecked(heap_, | 2197 prototype_transitions->set_unchecked(heap_, |
| 2196 header + i, | 2198 header + i, |
| 2197 undefined, | 2199 undefined, |
| 2198 SKIP_WRITE_BARRIER); | 2200 SKIP_WRITE_BARRIER); |
| 2199 | 2201 |
| 2200 Object** undefined_slot = | 2202 Object** undefined_slot = |
| 2201 prototype_transitions->data_start() + i; | 2203 prototype_transitions->data_start() + i; |
| 2202 RecordSlot(undefined_slot, undefined_slot, undefined); | 2204 RecordSlot(undefined_slot, undefined_slot, undefined); |
| 2203 } | 2205 } |
| 2204 map->SetNumberOfProtoTransitions(new_number_of_transitions); | 2206 map->SetNumberOfProtoTransitions(new_number_of_transitions); |
| (...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3523 while (buffer != NULL) { | 3525 while (buffer != NULL) { |
| 3524 SlotsBuffer* next_buffer = buffer->next(); | 3526 SlotsBuffer* next_buffer = buffer->next(); |
| 3525 DeallocateBuffer(buffer); | 3527 DeallocateBuffer(buffer); |
| 3526 buffer = next_buffer; | 3528 buffer = next_buffer; |
| 3527 } | 3529 } |
| 3528 *buffer_address = NULL; | 3530 *buffer_address = NULL; |
| 3529 } | 3531 } |
| 3530 | 3532 |
| 3531 | 3533 |
| 3532 } } // namespace v8::internal | 3534 } } // namespace v8::internal |
| OLD | NEW |