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

Side by Side Diff: src/spaces.cc

Issue 6928010: Make the marking stack into a deque (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 7 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
OLDNEW
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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 } 391 }
392 392
393 393
394 NewSpacePage* NewSpacePage::Initialize(Heap* heap, Address start) { 394 NewSpacePage* NewSpacePage::Initialize(Heap* heap, Address start) {
395 MemoryChunk* chunk = MemoryChunk::Initialize(heap, 395 MemoryChunk* chunk = MemoryChunk::Initialize(heap,
396 start, 396 start,
397 Page::kPageSize, 397 Page::kPageSize,
398 NOT_EXECUTABLE, 398 NOT_EXECUTABLE,
399 heap->new_space()); 399 heap->new_space());
400 chunk->initialize_scan_on_scavenge(true); 400 chunk->initialize_scan_on_scavenge(true);
401 chunk->set_in_new_space(true);
401 return static_cast<NewSpacePage*>(chunk); 402 return static_cast<NewSpacePage*>(chunk);
402 } 403 }
403 404
404 405
405 MemoryChunk* MemoryChunk::Initialize(Heap* heap, 406 MemoryChunk* MemoryChunk::Initialize(Heap* heap,
406 Address base, 407 Address base,
407 size_t size, 408 size_t size,
408 Executability executable, 409 Executability executable,
409 Space* owner) { 410 Space* owner) {
410 MemoryChunk* chunk = FromAddress(base); 411 MemoryChunk* chunk = FromAddress(base);
411 412
412 ASSERT(base == chunk->address()); 413 ASSERT(base == chunk->address());
413 414
414 chunk->heap_ = heap; 415 chunk->heap_ = heap;
415 chunk->size_ = size; 416 chunk->size_ = size;
416 chunk->flags_ = 0; 417 chunk->flags_ = 0;
417 chunk->set_owner(owner); 418 chunk->set_owner(owner);
418 chunk->markbits()->Clear(); 419 chunk->markbits()->Clear();
419 chunk->initialize_scan_on_scavenge(false); 420 chunk->initialize_scan_on_scavenge(false);
421 chunk->set_in_new_space(false);
420 ASSERT(OFFSET_OF(MemoryChunk, scan_on_scavenge_) == kScanOnScavengeOffset); 422 ASSERT(OFFSET_OF(MemoryChunk, scan_on_scavenge_) == kScanOnScavengeOffset);
423 ASSERT(OFFSET_OF(MemoryChunk, in_new_space_) == kInNewSpaceOffset);
421 ASSERT(OFFSET_OF(MemoryChunk, flags_) == kFlagsOffset); 424 ASSERT(OFFSET_OF(MemoryChunk, flags_) == kFlagsOffset);
422 425
423 if (executable == EXECUTABLE) chunk->SetFlag(IS_EXECUTABLE); 426 if (executable == EXECUTABLE) chunk->SetFlag(IS_EXECUTABLE);
424 427
425 if (owner == heap->old_data_space()) chunk->SetFlag(CONTAINS_ONLY_DATA); 428 if (owner == heap->old_data_space()) chunk->SetFlag(CONTAINS_ONLY_DATA);
426 429
427 return chunk; 430 return chunk;
428 } 431 }
429 432
430 433
(...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after
2216 for (HeapObject* obj = obj_it.next(); obj != NULL; obj = obj_it.next()) { 2219 for (HeapObject* obj = obj_it.next(); obj != NULL; obj = obj_it.next()) {
2217 if (obj->IsCode()) { 2220 if (obj->IsCode()) {
2218 Code* code = Code::cast(obj); 2221 Code* code = Code::cast(obj);
2219 isolate->code_kind_statistics()[code->kind()] += code->Size(); 2222 isolate->code_kind_statistics()[code->kind()] += code->Size();
2220 } 2223 }
2221 } 2224 }
2222 } 2225 }
2223 #endif // DEBUG 2226 #endif // DEBUG
2224 2227
2225 } } // namespace v8::internal 2228 } } // namespace v8::internal
OLDNEW
« src/spaces.h ('K') | « src/spaces.h ('k') | test/cctest/test-mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698