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

Unified Diff: src/objects-inl.h

Issue 3139005: [Isolates] Use ::GetHeap() more often.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 10 years, 4 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
===================================================================
--- src/objects-inl.h (revision 5249)
+++ src/objects-inl.h (working copy)
@@ -107,9 +107,6 @@
}
-#define GET_HEAP (HeapObject::cast(this)->GetHeap())
-
-
bool Object::IsInstanceOf(FunctionTemplateInfo* expected) {
// There is a constraint on the object; check.
if (!this->IsJSObject()) return false;
@@ -451,22 +448,27 @@
bool Object::IsContext() {
- return Object::IsHeapObject()
- && (HeapObject::cast(this)->map() == GET_HEAP->context_map() ||
- HeapObject::cast(this)->map() == GET_HEAP->catch_context_map() ||
- HeapObject::cast(this)->map() == GET_HEAP->global_context_map());
+ if (Object::IsHeapObject()) {
+ Heap* heap = HeapObject::cast(this)->GetHeap();
+ return (HeapObject::cast(this)->map() == heap->context_map() ||
+ HeapObject::cast(this)->map() == heap->catch_context_map() ||
+ HeapObject::cast(this)->map() == heap->global_context_map());
+ }
+ return false;
}
bool Object::IsCatchContext() {
- return Object::IsHeapObject()
- && HeapObject::cast(this)->map() == GET_HEAP->catch_context_map();
+ return Object::IsHeapObject() &&
+ HeapObject::cast(this)->map() ==
+ HeapObject::cast(this)->GetHeap()->catch_context_map();
}
bool Object::IsGlobalContext() {
- return Object::IsHeapObject()
- && HeapObject::cast(this)->map() == GET_HEAP->global_context_map();
+ return Object::IsHeapObject() &&
+ HeapObject::cast(this)->map() ==
+ HeapObject::cast(this)->GetHeap()->global_context_map();
}
@@ -548,18 +550,21 @@
bool Object::IsHashTable() {
- return Object::IsHeapObject()
- && HeapObject::cast(this)->map() == GET_HEAP->hash_table_map();
+ return Object::IsHeapObject() &&
+ HeapObject::cast(this)->map() ==
+ HeapObject::cast(this)->GetHeap()->hash_table_map();
}
bool Object::IsDictionary() {
- return IsHashTable() && this != GET_HEAP->symbol_table();
+ return IsHashTable() && this !=
+ HeapObject::cast(this)->GetHeap()->symbol_table();
}
bool Object::IsSymbolTable() {
- return IsHashTable() && this == GET_HEAP->raw_unchecked_symbol_table();
+ return IsHashTable() && this ==
+ HeapObject::cast(this)->GetHeap()->raw_unchecked_symbol_table();
}
@@ -1472,7 +1477,7 @@
void FixedArray::set_null(int index) {
- set_null(GetHeap(),index);
+ set_null(GetHeap(), index);
}
@@ -2100,7 +2105,7 @@
Scavenger callback = reinterpret_cast<Scavenger>(
READ_INTPTR_FIELD(this, kScavengerCallbackOffset));
- ASSERT(instance_type() != MAP_TYPE); // MAP_TYPE has Heap pointer instead.
+ ASSERT(instance_type() != MAP_TYPE); // MAP_TYPE has Heap pointer instead.
ASSERT(callback == Heap::GetScavenger(instance_type(),
instance_size()));
@@ -2108,7 +2113,7 @@
}
inline void Map::set_scavenger(Scavenger callback) {
- ASSERT(instance_type() != MAP_TYPE); // MAP_TYPE has Heap pointer instead.
+ ASSERT(instance_type() != MAP_TYPE); // MAP_TYPE has Heap pointer instead.
WRITE_INTPTR_FIELD(this,
kScavengerCallbackOffset,
reinterpret_cast<intptr_t>(callback));
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698