Index: test/cctest/test-hashing.cc |
diff --git a/test/cctest/test-hashing.cc b/test/cctest/test-hashing.cc |
index 6cf63d9fbbb95eb7d0cd81be057e8df14e6ecdde..154761313935d7fce15d4decdcb64e3dbdef01a7 100644 |
--- a/test/cctest/test-hashing.cc |
+++ b/test/cctest/test-hashing.cc |
@@ -47,8 +47,6 @@ using namespace v8::internal; |
typedef uint32_t (*HASH_FUNCTION)(); |
-static v8::Persistent<v8::Context> env; |
- |
#define __ masm-> |
@@ -235,7 +233,10 @@ static uint32_t PseudoRandom(uint32_t i, uint32_t j) { |
TEST(StringHash) { |
- if (env.IsEmpty()) env = v8::Context::New(); |
+ v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
+ v8::HandleScope handle_scope(isolate); |
+ v8::Context::Scope context_scope(v8::Context::New(isolate)); |
+ |
for (uint8_t a = 0; a < String::kMaxOneByteCharCode; a++) { |
// Numbers are hashed differently. |
if (a >= '0' && a <= '9') continue; |
@@ -253,7 +254,9 @@ TEST(StringHash) { |
TEST(NumberHash) { |
- if (env.IsEmpty()) env = v8::Context::New(); |
+ v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
+ v8::HandleScope handle_scope(isolate); |
+ v8::Context::Scope context_scope(v8::Context::New(isolate)); |
// Some specific numbers |
for (uint32_t key = 0; key < 42; key += 7) { |