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

Unified Diff: src/objects-inl.h

Issue 6723001: Some Isolate usage cleanups in objects.{h,cc}. (Closed)
Patch Set: Created 9 years, 9 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
diff --git a/src/objects-inl.h b/src/objects-inl.h
index ca065902c3c84bcd7a666f68ca445646f5ac857d..922c0548f670b44633e958b4df8502a375c7ebcf 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1134,9 +1134,7 @@ Heap* HeapObject::GetHeap() {
Isolate* HeapObject::GetIsolate() {
- Isolate* i = GetHeap()->isolate();
- ASSERT(i == Isolate::Current());
- return i;
+ return GetHeap()->isolate();
}
@@ -2815,6 +2813,11 @@ Code* Code::GetCodeFromTargetAddress(Address address) {
}
+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_;
@@ -2850,7 +2853,7 @@ MaybeObject* Map::GetFastElementsMap() {
}
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();
Mads Ager (chromium) 2011/03/22 19:05:37 Hey, that's part of my next change! ;-)
return new_map;
}
@@ -2863,7 +2866,7 @@ MaybeObject* Map::GetSlowElementsMap() {
}
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;
}
@@ -2878,7 +2881,7 @@ MaybeObject* Map::NewExternalArrayElementsMap() {
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;
}
« 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