Index: src/spaces.h |
diff --git a/src/spaces.h b/src/spaces.h |
index 96a1a90427f3a5cd8cce00f629d9bd596993890c..fcf7a442011db54071a52ce40d26eec0a857dd3b 100644 |
--- a/src/spaces.h |
+++ b/src/spaces.h |
@@ -283,6 +283,10 @@ class MemoryChunk { |
static MemoryChunk* FromAddress(Address a) { |
return reinterpret_cast<MemoryChunk*>(OffsetFrom(a) & ~kAlignmentMask); |
} |
+ static const MemoryChunk* FromAddress(const byte* a) { |
+ return reinterpret_cast<const MemoryChunk*>( |
+ OffsetFrom(a) & ~kAlignmentMask); |
+ } |
// Only works for addresses in pointer spaces, not data or code spaces. |
static inline MemoryChunk* FromAnyPointerAddress(Heap* heap, Address addr); |
@@ -627,7 +631,7 @@ class MemoryChunk { |
void InsertAfter(MemoryChunk* other); |
void Unlink(); |
- inline Heap* heap() { return heap_; } |
+ inline Heap* heap() const { return heap_; } |
static const int kFlagsOffset = kPointerSize; |