Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: src/mark-compact.cc

Issue 17410013: Use body descriptor to update pointers from cells. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Renamed local variable.wq Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3400 matching lines...) Expand 10 before | Expand all | Expand 10 after
3411 } 3411 }
3412 3412
3413 GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_UPDATE_MISC_POINTERS); 3413 GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_UPDATE_MISC_POINTERS);
3414 3414
3415 // Update pointers from cells. 3415 // Update pointers from cells.
3416 HeapObjectIterator cell_iterator(heap_->cell_space()); 3416 HeapObjectIterator cell_iterator(heap_->cell_space());
3417 for (HeapObject* cell = cell_iterator.Next(); 3417 for (HeapObject* cell = cell_iterator.Next();
3418 cell != NULL; 3418 cell != NULL;
3419 cell = cell_iterator.Next()) { 3419 cell = cell_iterator.Next()) {
3420 if (cell->IsCell()) { 3420 if (cell->IsCell()) {
3421 Address value_address = reinterpret_cast<Address>(cell) + 3421 Cell::BodyDescriptor::IterateBody(cell, &updating_visitor);
3422 (Cell::kValueOffset - kHeapObjectTag);
3423 updating_visitor.VisitPointer(reinterpret_cast<Object**>(value_address));
3424 } 3422 }
3425 } 3423 }
3426 3424
3427 HeapObjectIterator js_global_property_cell_iterator( 3425 HeapObjectIterator property_cell_iterator(heap_->property_cell_space());
3428 heap_->property_cell_space()); 3426 for (HeapObject* cell = property_cell_iterator.Next();
3429 for (HeapObject* cell = js_global_property_cell_iterator.Next();
3430 cell != NULL; 3427 cell != NULL;
3431 cell = js_global_property_cell_iterator.Next()) { 3428 cell = property_cell_iterator.Next()) {
3432 if (cell->IsPropertyCell()) { 3429 if (cell->IsPropertyCell()) {
3433 Address value_address = 3430 PropertyCell::BodyDescriptor::IterateBody(cell, &updating_visitor);
3434 reinterpret_cast<Address>(cell) +
3435 (PropertyCell::kValueOffset - kHeapObjectTag);
3436 updating_visitor.VisitPointer(reinterpret_cast<Object**>(value_address));
3437 Address type_address =
3438 reinterpret_cast<Address>(cell) +
3439 (PropertyCell::kTypeOffset - kHeapObjectTag);
3440 updating_visitor.VisitPointer(reinterpret_cast<Object**>(type_address));
3441 } 3431 }
3442 } 3432 }
3443 3433
3444 // Update pointer from the native contexts list. 3434 // Update pointer from the native contexts list.
3445 updating_visitor.VisitPointer(heap_->native_contexts_list_address()); 3435 updating_visitor.VisitPointer(heap_->native_contexts_list_address());
3446 3436
3447 heap_->string_table()->Iterate(&updating_visitor); 3437 heap_->string_table()->Iterate(&updating_visitor);
3448 3438
3449 // Update pointers from external string table. 3439 // Update pointers from external string table.
3450 heap_->UpdateReferencesInExternalStringTable( 3440 heap_->UpdateReferencesInExternalStringTable(
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
4315 while (buffer != NULL) { 4305 while (buffer != NULL) {
4316 SlotsBuffer* next_buffer = buffer->next(); 4306 SlotsBuffer* next_buffer = buffer->next();
4317 DeallocateBuffer(buffer); 4307 DeallocateBuffer(buffer);
4318 buffer = next_buffer; 4308 buffer = next_buffer;
4319 } 4309 }
4320 *buffer_address = NULL; 4310 *buffer_address = NULL;
4321 } 4311 }
4322 4312
4323 4313
4324 } } // namespace v8::internal 4314 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698