Isolate* HeapObject::GetIsolate() {
- Isolate* i = GetHeap()->isolate();
- ASSERT(i == Isolate::Current());
- return i;
+ return GetHeap()->isolate();
}
}
+Isolate* Map::isolate() {
+ return heap()->isolate();
+}
+
+
Heap* Map::heap() {
// NOTE: address() helper is not used to save one instruction.
Heap* heap = Page::FromAddress(reinterpret_cast<Address>(this))->heap_;
}
Map* new_map = Map::cast(obj);
new_map->set_has_fast_elements(true);
- COUNTERS->map_slow_to_fast_elements()->Increment();
+ isolate()->counters()->map_slow_to_fast_elements()->Increment();
return new_map;
}
}
Map* new_map = Map::cast(obj);
new_map->set_has_fast_elements(false);
- COUNTERS->map_fast_to_slow_elements()->Increment();
+ isolate()->counters()->map_fast_to_slow_elements()->Increment();
return new_map;
}
Map* new_map = Map::cast(obj);
new_map->set_has_fast_elements(false);
new_map->set_has_external_array_elements(true);
- COUNTERS->map_to_external_array_elements()->Increment();
+ isolate()->counters()->map_to_external_array_elements()->Increment();
return new_map;
}
Isolate* isolate = GetHeap()->isolate();
StringInputBuffer buffer(name);
if (!isolate->scanner_constants()->IsIdentifier(&buffer)
- && name != HEAP->hidden_symbol()) {
+ && name != isolate->heap()->hidden_symbol()) {
Object* obj;
{ MaybeObject* maybe_obj =
NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
bool String::SlowEquals(String* other) {
- Heap* heap = GetHeap();
-
// Fast check: negative check with lengths.
int len = length();
if (len != other->length()) return false;
Vector<const char>(str2, len));
}
- Isolate* isolate = heap->isolate();
+ Isolate* isolate = GetIsolate();
if (lhs->IsFlat()) {
if (lhs->IsAsciiRepresentation()) {
Vector<const char> vec1 = lhs->ToAsciiVector();
inline int visitor_id();
inline void set_visitor_id(int visitor_id);
- // Returns the heap this map belongs to.
+ // Returns the isolate/heap this map belongs to.
+ inline Isolate* isolate();
inline Heap* heap();
typedef void (*TraverseCallback)(Map* map, void* data);