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

Unified Diff: test/cctest/test-weakmaps.cc

Issue 12300018: Made Isolate a mandatory parameter for everything Handle-related. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed CreateCode calls. Be nicer to MIPS. Created 7 years, 10 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 | « test/cctest/test-strings.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « test/cctest/test-strings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698