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

Unified Diff: src/spaces.h

Issue 349623002: Make object accessors more const-correct. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
« src/objects.h ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« src/objects.h ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698