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

Unified Diff: src/objects-inl.h

Issue 6904166: Read isolate from page, not through map. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Remove Map::heap and use HeapObject::GetHeap instead. Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | src/objects-visiting.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index aebee82de8dbea73debb2febdb387018fe0fc1cf..312ff4b55df47809a8dd1d817aab722382d7b2d3 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1,4 +1,4 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -1051,18 +1051,14 @@ void HeapObject::VerifySmiField(int offset) {
Heap* HeapObject::GetHeap() {
- // During GC, the map pointer in HeapObject is used in various ways that
- // prevent us from retrieving Heap from the map.
- // Assert that we are not in GC, implement GC code in a way that it doesn't
- // pull heap from the map.
- return map()->heap();
+ return MemoryChunk::FromAddress(address())->heap();
}
Isolate* HeapObject::GetIsolate() {
- Isolate* i = GetHeap()->isolate();
- ASSERT(i == Isolate::Current());
- return i;
+ Isolate* isolate = MemoryChunk::FromAddress(address())->heap()->isolate();
+ ASSERT(isolate == Isolate::Current());
+ return isolate;
}
@@ -1074,7 +1070,7 @@ Map* HeapObject::map() {
void HeapObject::set_map(Map* value) {
set_map_word(MapWord::FromMap(value));
if (value != NULL) {
- value->heap()->incremental_marking()->RecordWrite(this, value);
+ value->GetHeap()->incremental_marking()->RecordWrite(this, value);
}
}
@@ -2711,15 +2707,6 @@ Code* Code::GetCodeFromTargetAddress(Address address) {
}
-Heap* Map::heap() {
- // NOTE: address() helper is not used to save one instruction.
- Heap* heap = Page::FromAddress(reinterpret_cast<Address>(this))->heap();
- ASSERT(heap != NULL);
- ASSERT(heap->isolate() == Isolate::Current());
- return heap;
-}
-
-
Object* Code::GetObjectFromEntryAddress(Address location_of_address) {
return HeapObject::
FromAddress(Memory::Address_at(location_of_address) - Code::kHeaderSize);
« no previous file with comments | « src/objects.cc ('k') | src/objects-visiting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698