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

Unified Diff: src/spaces.h

Issue 7104107: Incremental mode now works for x64. The only difference (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
Index: src/spaces.h
===================================================================
--- src/spaces.h (revision 8221)
+++ src/spaces.h (working copy)
@@ -170,6 +170,8 @@
static const uint32_t kBitsPerCell = 32;
Lasse Reichstein 2011/06/10 13:55:44 kBitsPerInt ?
Erik Corry 2011/06/10 21:57:29 Not really.
static const uint32_t kBitsPerCellLog2 = 5;
static const uint32_t kBitIndexMask = kBitsPerCell - 1;
+ static const uint32_t kBytesPerCell = kBitsPerCell / 8;
Lasse Reichstein 2011/06/10 13:55:44 8 -> kBitsPerByte
Erik Corry 2011/06/10 21:57:29 Done.
+ static const uint32_t kBytesPerCellLog2 = kBitsPerCellLog2 - 3;
Lasse Reichstein 2011/06/10 13:55:44 3 -> kBitesPerByteLog2
Erik Corry 2011/06/10 21:57:29 Done.
static const size_t kLength =
(1 << kPageSizeBits) >> (kPointerSizeLog2);
@@ -653,6 +655,14 @@
// (e.g. see LargeObjectSpace).
virtual intptr_t SizeOfObjects() { return Size(); }
+ virtual int RoundSizeDownToObjectAlignment(int size) {
+ if (id_ == CODE_SPACE) {
+ return RoundDown(size, kCodeAlignment);
+ } else {
+ return RoundDown(size, kPointerSize);
+ }
+ }
+
#ifdef ENABLE_HEAP_PROTECTION
// Protect/unprotect the space by marking it read-only/writable.
virtual void Protect() = 0;
@@ -2201,6 +2211,14 @@
return false; // TODO(gc): Bring back map compaction.
}
+ virtual int RoundSizeDownToObjectAlignment(int size) {
+ if (IsPowerOf2(Map::kSize)) {
+ return RoundDown(size, Map::kSize);
+ } else {
+ return (size / Map::kSize) * Map::kSize;
+ }
+ }
+
protected:
#ifdef DEBUG
virtual void VerifyObject(HeapObject* obj);
@@ -2231,6 +2249,14 @@
: FixedSpace(heap, max_capacity, id, JSGlobalPropertyCell::kSize, "cell")
{}
+ virtual int RoundSizeDownToObjectAlignment(int size) {
+ if (IsPowerOf2(JSGlobalPropertyCell::kSize)) {
+ return RoundDown(size, JSGlobalPropertyCell::kSize);
+ } else {
+ return (size / JSGlobalPropertyCell::kSize) * JSGlobalPropertyCell::kSize;
+ }
+ }
+
protected:
#ifdef DEBUG
virtual void VerifyObject(HeapObject* obj);

Powered by Google App Engine
This is Rietveld 408576698