Index: src/objects-inl.h |
=================================================================== |
--- src/objects-inl.h (revision 7428) |
+++ src/objects-inl.h (working copy) |
@@ -2862,6 +2862,34 @@ |
} |
+Heap* Code::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; |
+} |
+ |
+ |
+Isolate* Code::isolate() { |
+ return heap()->isolate(); |
+} |
+ |
+ |
+Heap* JSGlobalPropertyCell::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; |
+} |
+ |
+ |
+Isolate* JSGlobalPropertyCell::isolate() { |
+ return heap()->isolate(); |
+} |
+ |
+ |
Object* Code::GetObjectFromEntryAddress(Address location_of_address) { |
return HeapObject:: |
FromAddress(Memory::Address_at(location_of_address) - Code::kHeaderSize); |