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

Side by Side Diff: src/spaces-inl.h

Issue 10096005: A very small marking bitmap (2 bits) is sufficient for large object page since just one object in i… Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 8 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 | « src/spaces.cc ('k') | 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 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 21 matching lines...) Expand all
32 #include "spaces.h" 32 #include "spaces.h"
33 #include "v8memory.h" 33 #include "v8memory.h"
34 34
35 namespace v8 { 35 namespace v8 {
36 namespace internal { 36 namespace internal {
37 37
38 38
39 // ----------------------------------------------------------------------------- 39 // -----------------------------------------------------------------------------
40 // Bitmap 40 // Bitmap
41 41
42 int Bitmap::CellsCount() {
43 MemoryChunk* chunk = MemoryChunk::FromAddress(address());
44 ASSERT(chunk->is_valid());
45 size_t rLength = (chunk->area_start() - address()) << kBitsPerByteLog2;
46 if (rLength > kLength) rLength = kLength;
47 rLength &= ~(kBitsPerCell - 1);
48 return CellsForLength(rLength);
49 }
50
42 void Bitmap::Clear(MemoryChunk* chunk) { 51 void Bitmap::Clear(MemoryChunk* chunk) {
43 Bitmap* bitmap = chunk->markbits(); 52 Bitmap* bitmap = chunk->markbits();
44 for (int i = 0; i < bitmap->CellsCount(); i++) bitmap->cells()[i] = 0; 53 for (int i = 0; i < bitmap->CellsCount(); i++) bitmap->cells()[i] = 0;
45 chunk->ResetLiveBytes(); 54 chunk->ResetLiveBytes();
46 } 55 }
47 56
48 57
49 // ----------------------------------------------------------------------------- 58 // -----------------------------------------------------------------------------
50 // PageIterator 59 // PageIterator
51 60
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 Map* map = object->map(); 348 Map* map = object->map();
340 Heap* heap = object->GetHeap(); 349 Heap* heap = object->GetHeap();
341 return map == heap->raw_unchecked_free_space_map() 350 return map == heap->raw_unchecked_free_space_map()
342 || map == heap->raw_unchecked_one_pointer_filler_map() 351 || map == heap->raw_unchecked_one_pointer_filler_map()
343 || map == heap->raw_unchecked_two_pointer_filler_map(); 352 || map == heap->raw_unchecked_two_pointer_filler_map();
344 } 353 }
345 354
346 } } // namespace v8::internal 355 } } // namespace v8::internal
347 356
348 #endif // V8_SPACES_INL_H_ 357 #endif // V8_SPACES_INL_H_
OLDNEW
« no previous file with comments | « src/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698