Index: test/cctest/test-weakmaps.cc |
diff --git a/test/cctest/test-weakmaps.cc b/test/cctest/test-weakmaps.cc |
index edbd94cc1e2570482b5a7cb439a5297411bccc83..be86b0dc87eb0c379aa3230ae26c238e6335d141 100644 |
--- a/test/cctest/test-weakmaps.cc |
+++ b/test/cctest/test-weakmaps.cc |
@@ -34,6 +34,11 @@ |
using namespace v8::internal; |
+static Isolate* GetIsolateFrom(LocalContext* context) { |
+ return reinterpret_cast<Isolate*>((*context)->GetIsolate()); |
+} |
+ |
+ |
static Handle<JSWeakMap> AllocateJSWeakMap() { |
Handle<Map> map = FACTORY->NewMap(JS_WEAK_MAP_TYPE, JSWeakMap::kSize); |
Handle<JSObject> weakmap_obj = FACTORY->NewJSObjectFromMap(map); |
@@ -71,7 +76,7 @@ TEST(Weakness) { |
LocalContext context; |
v8::HandleScope scope; |
Handle<JSWeakMap> weakmap = AllocateJSWeakMap(); |
- GlobalHandles* global_handles = Isolate::Current()->global_handles(); |
+ GlobalHandles* global_handles = GetIsolateFrom(&context)->global_handles(); |
// Keep global reference to the key. |
Handle<Object> key; |
@@ -88,7 +93,7 @@ TEST(Weakness) { |
v8::HandleScope scope; |
PutIntoWeakMap(weakmap, |
Handle<JSObject>(JSObject::cast(*key)), |
- Handle<Smi>(Smi::FromInt(23))); |
+ Handle<Smi>(Smi::FromInt(23), GetIsolateFrom(&context))); |
} |
CHECK_EQ(1, ObjectHashTable::cast(weakmap->table())->NumberOfElements()); |
@@ -139,7 +144,8 @@ TEST(Shrinking) { |
Handle<Map> map = FACTORY->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
for (int i = 0; i < 32; i++) { |
Handle<JSObject> object = FACTORY->NewJSObjectFromMap(map); |
- PutIntoWeakMap(weakmap, object, Handle<Smi>(Smi::FromInt(i))); |
+ PutIntoWeakMap(weakmap, object, |
+ Handle<Smi>(Smi::FromInt(i), GetIsolateFrom(&context))); |
} |
} |
@@ -218,7 +224,9 @@ TEST(Regress2060b) { |
} |
Handle<JSWeakMap> weakmap = AllocateJSWeakMap(); |
for (int i = 0; i < 32; i++) { |
- PutIntoWeakMap(weakmap, keys[i], Handle<Smi>(Smi::FromInt(i))); |
+ PutIntoWeakMap(weakmap, |
+ keys[i], |
+ Handle<Smi>(Smi::FromInt(i), GetIsolateFrom(&context))); |
} |
// Force compacting garbage collection. The subsequent collections are used |