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

Unified Diff: src/objects-inl.h

Issue 6469079: [Isolates] Get the current heap from page header instead of Map field. (Closed)
Patch Set: Created 9 years, 10 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.h ('k') | src/serialize.cc » ('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 1ad9b0f6e46678783b46e0a981f1f15d58f188fc..aa541f72b0e576cf957f81ce15255804177b0c80 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2738,21 +2738,14 @@ Code* Code::GetCodeFromTargetAddress(Address address) {
Heap* Map::heap() {
- Heap* heap = reinterpret_cast<Heap*>(READ_INTPTR_FIELD(this, kHeapOffset));
+ // 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;
}
-void Map::set_heap(Heap* heap) {
- ASSERT(heap != NULL);
- ASSERT(heap->isolate() == Isolate::Current());
- // WRITE_FIELD does not invoke write barrier, but there is no need here.
- WRITE_INTPTR_FIELD(this, kHeapOffset, reinterpret_cast<intptr_t>(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.h ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698