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

Side by Side Diff: src/spaces.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 | « no previous file | src/spaces.cc » ('j') | 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 (1 << kPageSizeBits) >> (kPointerSizeLog2); 176 (1 << kPageSizeBits) >> (kPointerSizeLog2);
177 177
178 static const size_t kSize = 178 static const size_t kSize =
179 (1 << kPageSizeBits) >> (kPointerSizeLog2 + kBitsPerByteLog2); 179 (1 << kPageSizeBits) >> (kPointerSizeLog2 + kBitsPerByteLog2);
180 180
181 181
182 static int CellsForLength(int length) { 182 static int CellsForLength(int length) {
183 return (length + kBitsPerCell - 1) >> kBitsPerCellLog2; 183 return (length + kBitsPerCell - 1) >> kBitsPerCellLog2;
184 } 184 }
185 185
186 int CellsCount() { 186 INLINE(int CellsCount());
187 return CellsForLength(kLength);
188 }
189 187
190 static int SizeFor(int cells_count) { 188 static int SizeFor(int cells_count) {
191 return sizeof(MarkBit::CellType) * cells_count; 189 return sizeof(MarkBit::CellType) * cells_count;
192 } 190 }
193 191
194 INLINE(static uint32_t IndexToCell(uint32_t index)) { 192 INLINE(static uint32_t IndexToCell(uint32_t index)) {
195 return index >> kBitsPerCellLog2; 193 return index >> kBitsPerCellLog2;
196 } 194 }
197 195
198 INLINE(static uint32_t CellToIndex(uint32_t index)) { 196 INLINE(static uint32_t CellToIndex(uint32_t index)) {
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 static const int kBodyOffset = 492 static const int kBodyOffset =
495 CODE_POINTER_ALIGN(MAP_POINTER_ALIGN(kHeaderSize + Bitmap::kSize)); 493 CODE_POINTER_ALIGN(MAP_POINTER_ALIGN(kHeaderSize + Bitmap::kSize));
496 494
497 // The start offset of the object area in a page. Aligned to both maps and 495 // The start offset of the object area in a page. Aligned to both maps and
498 // code alignment to be suitable for both. Also aligned to 32 words because 496 // code alignment to be suitable for both. Also aligned to 32 words because
499 // the marking bitmap is arranged in 32 bit chunks. 497 // the marking bitmap is arranged in 32 bit chunks.
500 static const int kObjectStartAlignment = 32 * kPointerSize; 498 static const int kObjectStartAlignment = 32 * kPointerSize;
501 static const int kObjectStartOffset = kBodyOffset - 1 + 499 static const int kObjectStartOffset = kBodyOffset - 1 +
502 (kObjectStartAlignment - (kBodyOffset - 1) % kObjectStartAlignment); 500 (kObjectStartAlignment - (kBodyOffset - 1) % kObjectStartAlignment);
503 501
502 static const int kLargeObjectBodyOffset =
503 CODE_POINTER_ALIGN(MAP_POINTER_ALIGN(kHeaderSize + kPointerSize));
504 static const int kLargeObjectStartOffset =
505 kObjectStartAlignment + (kLargeObjectBodyOffset - 1) -
506 (kLargeObjectBodyOffset - 1) % kObjectStartAlignment;
507
504 size_t size() const { return size_; } 508 size_t size() const { return size_; }
505 509
506 void set_size(size_t size) { 510 void set_size(size_t size) {
507 size_ = size; 511 size_ = size;
508 } 512 }
509 513
510 void SetArea(Address area_start, Address area_end) { 514 void SetArea(Address area_start, Address area_end) {
511 area_start_ = area_start; 515 area_start_ = area_start;
512 area_end_ = area_end; 516 area_end_ = area_end;
513 } 517 }
(...skipping 2125 matching lines...) Expand 10 before | Expand all | Expand 10 after
2639 } 2643 }
2640 // Must be small, since an iteration is used for lookup. 2644 // Must be small, since an iteration is used for lookup.
2641 static const int kMaxComments = 64; 2645 static const int kMaxComments = 64;
2642 }; 2646 };
2643 #endif 2647 #endif
2644 2648
2645 2649
2646 } } // namespace v8::internal 2650 } } // namespace v8::internal
2647 2651
2648 #endif // V8_SPACES_H_ 2652 #endif // V8_SPACES_H_
OLDNEW
« no previous file with comments | « no previous file | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698