Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index c75bd0002605d33e17e4e289652553f561a70a95..e06cb77c6233d8512ec6fb37626c0ae64b4b90cf 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -144,7 +144,7 @@ static v8::Handle<Value> SignatureCallback(const v8::Arguments& args) { |
THREADED_TEST(Handles) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<Context> local_env; |
{ |
LocalContext env; |
@@ -169,8 +169,8 @@ THREADED_TEST(Handles) { |
THREADED_TEST(IsolateOfContext) { |
- v8::HandleScope scope; |
v8::Persistent<Context> env = Context::New(); |
+ v8::HandleScope scope(env->GetIsolate()); |
CHECK(!env->InContext()); |
CHECK(env->GetIsolate() == v8::Isolate::GetCurrent()); |
@@ -186,8 +186,8 @@ THREADED_TEST(IsolateOfContext) { |
THREADED_TEST(ReceiverSignature) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Handle<v8::FunctionTemplate> fun = v8::FunctionTemplate::New(); |
v8::Handle<v8::Signature> sig = v8::Signature::New(fun); |
fun->PrototypeTemplate()->Set( |
@@ -230,8 +230,8 @@ THREADED_TEST(ReceiverSignature) { |
THREADED_TEST(ArgumentSignature) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Handle<v8::FunctionTemplate> cons = v8::FunctionTemplate::New(); |
cons->SetClassName(v8_str("Cons")); |
v8::Handle<v8::Signature> sig = |
@@ -292,8 +292,8 @@ THREADED_TEST(ArgumentSignature) { |
THREADED_TEST(HulIgennem) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Handle<v8::Primitive> undef = v8::Undefined(); |
Local<String> undef_str = undef->ToString(); |
char* value = i::NewArray<char>(undef_str->Length() + 1); |
@@ -304,8 +304,8 @@ THREADED_TEST(HulIgennem) { |
THREADED_TEST(Access) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<v8::Object> obj = v8::Object::New(); |
Local<Value> foo_before = obj->Get(v8_str("foo")); |
CHECK(foo_before->IsUndefined()); |
@@ -319,8 +319,8 @@ THREADED_TEST(Access) { |
THREADED_TEST(AccessElement) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<v8::Object> obj = v8::Object::New(); |
Local<Value> before = obj->Get(1); |
CHECK(before->IsUndefined()); |
@@ -338,8 +338,8 @@ THREADED_TEST(AccessElement) { |
THREADED_TEST(Script) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
const char* c_source = "1 + 2 + 3"; |
Local<String> source = String::New(c_source); |
Local<Script> script = Script::Compile(source); |
@@ -410,8 +410,8 @@ THREADED_TEST(ScriptUsingStringResource) { |
const char* c_source = "1 + 2 * 3"; |
uint16_t* two_byte_source = AsciiToTwoByteString(c_source); |
{ |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
TestResource* resource = new TestResource(two_byte_source, &dispose_count); |
Local<String> source = String::NewExternal(resource); |
Local<Script> script = Script::Compile(source); |
@@ -438,8 +438,8 @@ THREADED_TEST(ScriptUsingAsciiStringResource) { |
int dispose_count = 0; |
const char* c_source = "1 + 2 * 3"; |
{ |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
TestAsciiResource* resource = new TestAsciiResource(i::StrDup(c_source), |
&dispose_count); |
Local<String> source = String::NewExternal(resource); |
@@ -467,8 +467,8 @@ THREADED_TEST(ScriptMakingExternalString) { |
int dispose_count = 0; |
uint16_t* two_byte_source = AsciiToTwoByteString("1 + 2 * 3"); |
{ |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<String> source = String::New(two_byte_source); |
// Trigger GCs so that the newly allocated string moves to old gen. |
HEAP->CollectGarbage(i::NEW_SPACE); // in survivor space now |
@@ -498,8 +498,8 @@ THREADED_TEST(ScriptMakingExternalAsciiString) { |
int dispose_count = 0; |
const char* c_source = "1 + 2 * 3"; |
{ |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<String> source = v8_str(c_source); |
// Trigger GCs so that the newly allocated string moves to old gen. |
HEAP->CollectGarbage(i::NEW_SPACE); // in survivor space now |
@@ -521,8 +521,8 @@ THREADED_TEST(ScriptMakingExternalAsciiString) { |
TEST(MakingExternalStringConditions) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
// Free some space in the new space so that we can check freshness. |
HEAP->CollectGarbage(i::NEW_SPACE); |
@@ -567,8 +567,8 @@ TEST(MakingExternalStringConditions) { |
TEST(MakingExternalAsciiStringConditions) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
// Free some space in the new space so that we can check freshness. |
HEAP->CollectGarbage(i::NEW_SPACE); |
@@ -605,7 +605,7 @@ TEST(MakingExternalAsciiStringConditions) { |
THREADED_TEST(UsingExternalString) { |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
uint16_t* two_byte_string = AsciiToTwoByteString("test string"); |
Local<String> string = |
String::NewExternal(new TestResource(two_byte_string)); |
@@ -624,7 +624,7 @@ THREADED_TEST(UsingExternalString) { |
THREADED_TEST(UsingExternalAsciiString) { |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
const char* one_byte_string = "test string"; |
Local<String> string = String::NewExternal( |
new TestAsciiResource(i::StrDup(one_byte_string))); |
@@ -647,7 +647,7 @@ THREADED_TEST(ScavengeExternalString) { |
int dispose_count = 0; |
bool in_new_space = false; |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
uint16_t* two_byte_string = AsciiToTwoByteString("test string"); |
Local<String> string = |
String::NewExternal(new TestResource(two_byte_string, |
@@ -669,7 +669,7 @@ THREADED_TEST(ScavengeExternalAsciiString) { |
int dispose_count = 0; |
bool in_new_space = false; |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
const char* one_byte_string = "test string"; |
Local<String> string = String::NewExternal( |
new TestAsciiResource(i::StrDup(one_byte_string), &dispose_count)); |
@@ -715,8 +715,8 @@ TEST(ExternalStringWithDisposeHandling) { |
TestAsciiResourceWithDisposeControl::dispose_calls = 0; |
TestAsciiResourceWithDisposeControl res_stack(i::StrDup(c_source), false); |
{ |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<String> source = String::NewExternal(&res_stack); |
Local<Script> script = Script::Compile(source); |
Local<Value> value = script->Run(); |
@@ -736,8 +736,8 @@ TEST(ExternalStringWithDisposeHandling) { |
TestAsciiResource* res_heap = |
new TestAsciiResourceWithDisposeControl(i::StrDup(c_source), true); |
{ |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<String> source = String::NewExternal(res_heap); |
Local<Script> script = Script::Compile(source); |
Local<Value> value = script->Run(); |
@@ -755,8 +755,8 @@ TEST(ExternalStringWithDisposeHandling) { |
THREADED_TEST(StringConcat) { |
{ |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
const char* one_byte_string_1 = "function a_times_t"; |
const char* two_byte_string_1 = "wo_plus_b(a, b) {return "; |
const char* one_byte_extern_1 = "a * 2 + b;} a_times_two_plus_b(4, 8) + "; |
@@ -800,8 +800,8 @@ THREADED_TEST(StringConcat) { |
THREADED_TEST(GlobalProperties) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Handle<v8::Object> global = env->Global(); |
global->Set(v8_str("pi"), v8_num(3.1415926)); |
Local<Value> pi = global->Get(v8_str("pi")); |
@@ -829,8 +829,8 @@ static v8::Handle<Value> Return239(Local<String> name, const AccessorInfo&) { |
THREADED_TEST(FunctionTemplate) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
{ |
Local<v8::FunctionTemplate> fun_templ = |
v8::FunctionTemplate::New(handle_call); |
@@ -870,8 +870,8 @@ THREADED_TEST(FunctionTemplate) { |
THREADED_TEST(FunctionTemplateSetLength) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
{ |
Local<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New( |
handle_call, Handle<v8::Value>(), Handle<v8::Signature>(), 23); |
@@ -910,8 +910,8 @@ static v8::Handle<v8::Value> callback(const v8::Arguments& args) { |
static void TestExternalPointerWrapping() { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Handle<v8::Value> data = v8::External::New(expected_ptr); |
@@ -975,8 +975,8 @@ THREADED_TEST(ExternalWrap) { |
THREADED_TEST(FindInstanceInPrototypeChain) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<v8::FunctionTemplate> base = v8::FunctionTemplate::New(); |
Local<v8::FunctionTemplate> derived = v8::FunctionTemplate::New(); |
@@ -1022,8 +1022,8 @@ THREADED_TEST(FindInstanceInPrototypeChain) { |
THREADED_TEST(TinyInteger) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
int32_t value = 239; |
@@ -1036,8 +1036,8 @@ THREADED_TEST(TinyInteger) { |
THREADED_TEST(BigSmiInteger) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
int32_t value = i::Smi::kMaxValue; |
@@ -1056,8 +1056,8 @@ THREADED_TEST(BigSmiInteger) { |
THREADED_TEST(BigInteger) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
// We cannot add one to a Smi::kMaxValue without wrapping. |
@@ -1079,8 +1079,8 @@ THREADED_TEST(BigInteger) { |
THREADED_TEST(TinyUnsignedInteger) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
uint32_t value = 239; |
@@ -1094,8 +1094,8 @@ THREADED_TEST(TinyUnsignedInteger) { |
THREADED_TEST(BigUnsignedSmiInteger) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
uint32_t value = static_cast<uint32_t>(i::Smi::kMaxValue); |
@@ -1111,8 +1111,8 @@ THREADED_TEST(BigUnsignedSmiInteger) { |
THREADED_TEST(BigUnsignedInteger) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
uint32_t value = static_cast<uint32_t>(i::Smi::kMaxValue) + 1; |
@@ -1128,8 +1128,8 @@ THREADED_TEST(BigUnsignedInteger) { |
THREADED_TEST(OutOfSignedRangeUnsignedInteger) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
uint32_t INT32_MAX_AS_UINT = (1U << 31) - 1; |
@@ -1145,8 +1145,8 @@ THREADED_TEST(OutOfSignedRangeUnsignedInteger) { |
THREADED_TEST(IsNativeError) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Handle<Value> syntax_error = CompileRun( |
"var out = 0; try { eval(\"#\"); } catch(x) { out = x; } out; "); |
CHECK(syntax_error->IsNativeError()); |
@@ -1158,8 +1158,8 @@ THREADED_TEST(IsNativeError) { |
THREADED_TEST(StringObject) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Handle<Value> boxed_string = CompileRun("new String(\"test\")"); |
CHECK(boxed_string->IsStringObject()); |
v8::Handle<Value> unboxed_string = CompileRun("\"test\""); |
@@ -1183,8 +1183,8 @@ THREADED_TEST(StringObject) { |
THREADED_TEST(NumberObject) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Handle<Value> boxed_number = CompileRun("new Number(42)"); |
CHECK(boxed_number->IsNumberObject()); |
v8::Handle<Value> unboxed_number = CompileRun("42"); |
@@ -1204,8 +1204,8 @@ THREADED_TEST(NumberObject) { |
THREADED_TEST(BooleanObject) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Handle<Value> boxed_boolean = CompileRun("new Boolean(true)"); |
CHECK(boxed_boolean->IsBooleanObject()); |
v8::Handle<Value> unboxed_boolean = CompileRun("true"); |
@@ -1229,8 +1229,8 @@ THREADED_TEST(BooleanObject) { |
THREADED_TEST(Number) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
double PI = 3.1415926; |
Local<v8::Number> pi_obj = v8::Number::New(PI); |
CHECK_EQ(PI, pi_obj->NumberValue()); |
@@ -1238,8 +1238,8 @@ THREADED_TEST(Number) { |
THREADED_TEST(ToNumber) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<String> str = v8_str("3.1415926"); |
CHECK_EQ(3.1415926, str->NumberValue()); |
v8::Handle<v8::Boolean> t = v8::True(); |
@@ -1250,8 +1250,8 @@ THREADED_TEST(ToNumber) { |
THREADED_TEST(Date) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
double PI = 3.1415926; |
Local<Value> date = v8::Date::New(PI); |
CHECK_EQ(3.0, date->NumberValue()); |
@@ -1261,8 +1261,8 @@ THREADED_TEST(Date) { |
THREADED_TEST(Boolean) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Handle<v8::Boolean> t = v8::True(); |
CHECK(t->Value()); |
v8::Handle<v8::Boolean> f = v8::False(); |
@@ -1296,7 +1296,7 @@ static v8::Handle<Value> GetM(Local<String> name, const AccessorInfo&) { |
THREADED_TEST(GlobalPrototype) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> func_templ = v8::FunctionTemplate::New(); |
func_templ->PrototypeTemplate()->Set( |
"dummy", |
@@ -1314,7 +1314,7 @@ THREADED_TEST(GlobalPrototype) { |
THREADED_TEST(ObjectTemplate) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ1 = ObjectTemplate::New(); |
templ1->Set("x", v8_num(10)); |
templ1->Set("y", v8_num(13)); |
@@ -1350,7 +1350,7 @@ static v8::Handle<Value> GetKnurd(Local<String> property, const AccessorInfo&) { |
THREADED_TEST(DescriptorInheritance) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> super = v8::FunctionTemplate::New(); |
super->PrototypeTemplate()->Set("flabby", |
v8::FunctionTemplate::New(GetFlabby)); |
@@ -1481,7 +1481,7 @@ void AddInterceptor(Handle<FunctionTemplate> templ, |
} |
THREADED_TEST(EmptyInterceptorDoesNotShadowAccessors) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Handle<FunctionTemplate> parent = FunctionTemplate::New(); |
Handle<FunctionTemplate> child = FunctionTemplate::New(); |
child->Inherit(parent); |
@@ -1498,7 +1498,7 @@ THREADED_TEST(EmptyInterceptorDoesNotShadowAccessors) { |
} |
THREADED_TEST(EmptyInterceptorDoesNotShadowJSAccessors) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Handle<FunctionTemplate> parent = FunctionTemplate::New(); |
Handle<FunctionTemplate> child = FunctionTemplate::New(); |
child->Inherit(parent); |
@@ -1518,7 +1518,7 @@ THREADED_TEST(EmptyInterceptorDoesNotShadowJSAccessors) { |
} |
THREADED_TEST(EmptyInterceptorDoesNotAffectJSProperties) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Handle<FunctionTemplate> parent = FunctionTemplate::New(); |
Handle<FunctionTemplate> child = FunctionTemplate::New(); |
child->Inherit(parent); |
@@ -1537,7 +1537,7 @@ THREADED_TEST(EmptyInterceptorDoesNotAffectJSProperties) { |
} |
THREADED_TEST(SwitchFromInterceptorToAccessor) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Handle<FunctionTemplate> templ = FunctionTemplate::New(); |
AddAccessor(templ, v8_str("age"), |
SimpleAccessorGetter, SimpleAccessorSetter); |
@@ -1554,7 +1554,7 @@ THREADED_TEST(SwitchFromInterceptorToAccessor) { |
} |
THREADED_TEST(SwitchFromAccessorToInterceptor) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Handle<FunctionTemplate> templ = FunctionTemplate::New(); |
AddAccessor(templ, v8_str("age"), |
SimpleAccessorGetter, SimpleAccessorSetter); |
@@ -1571,7 +1571,7 @@ THREADED_TEST(SwitchFromAccessorToInterceptor) { |
} |
THREADED_TEST(SwitchFromInterceptorToAccessorWithInheritance) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Handle<FunctionTemplate> parent = FunctionTemplate::New(); |
Handle<FunctionTemplate> child = FunctionTemplate::New(); |
child->Inherit(parent); |
@@ -1590,7 +1590,7 @@ THREADED_TEST(SwitchFromInterceptorToAccessorWithInheritance) { |
} |
THREADED_TEST(SwitchFromAccessorToInterceptorWithInheritance) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Handle<FunctionTemplate> parent = FunctionTemplate::New(); |
Handle<FunctionTemplate> child = FunctionTemplate::New(); |
child->Inherit(parent); |
@@ -1609,7 +1609,7 @@ THREADED_TEST(SwitchFromAccessorToInterceptorWithInheritance) { |
} |
THREADED_TEST(SwitchFromInterceptorToJSAccessor) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Handle<FunctionTemplate> templ = FunctionTemplate::New(); |
AddInterceptor(templ, InterceptorGetter, InterceptorSetter); |
LocalContext env; |
@@ -1633,7 +1633,7 @@ THREADED_TEST(SwitchFromInterceptorToJSAccessor) { |
} |
THREADED_TEST(SwitchFromJSAccessorToInterceptor) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Handle<FunctionTemplate> templ = FunctionTemplate::New(); |
AddInterceptor(templ, InterceptorGetter, InterceptorSetter); |
LocalContext env; |
@@ -1657,7 +1657,7 @@ THREADED_TEST(SwitchFromJSAccessorToInterceptor) { |
} |
THREADED_TEST(SwitchFromInterceptorToProperty) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Handle<FunctionTemplate> parent = FunctionTemplate::New(); |
Handle<FunctionTemplate> child = FunctionTemplate::New(); |
child->Inherit(parent); |
@@ -1674,7 +1674,7 @@ THREADED_TEST(SwitchFromInterceptorToProperty) { |
} |
THREADED_TEST(SwitchFromPropertyToInterceptor) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Handle<FunctionTemplate> parent = FunctionTemplate::New(); |
Handle<FunctionTemplate> child = FunctionTemplate::New(); |
child->Inherit(parent); |
@@ -1692,7 +1692,7 @@ THREADED_TEST(SwitchFromPropertyToInterceptor) { |
THREADED_TEST(NamedPropertyHandlerGetter) { |
echo_named_call_count = 0; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(); |
templ->InstanceTemplate()->SetNamedPropertyHandler(EchoNamedProperty, |
0, 0, 0, 0, |
@@ -1727,7 +1727,7 @@ static v8::Handle<Value> EchoIndexedProperty(uint32_t index, |
THREADED_TEST(IndexedPropertyHandlerGetter) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(); |
templ->InstanceTemplate()->SetIndexedPropertyHandler(EchoIndexedProperty, |
0, 0, 0, 0, |
@@ -1828,8 +1828,8 @@ v8::Handle<v8::Array> CheckThisNamedPropertyEnumerator( |
THREADED_TEST(PropertyHandlerInPrototype) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
// Set up a prototype chain with three interceptors. |
v8::Handle<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(); |
@@ -1897,7 +1897,7 @@ static v8::Handle<v8::Integer> PrePropertyHandlerQuery(Local<String> key, |
THREADED_TEST(PrePropertyHandler) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> desc = v8::FunctionTemplate::New(); |
desc->InstanceTemplate()->SetNamedPropertyHandler(PrePropertyHandlerGet, |
0, |
@@ -1915,8 +1915,8 @@ THREADED_TEST(PrePropertyHandler) { |
THREADED_TEST(UndefinedIsNotEnumerable) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Handle<Value> result = Script::Compile(v8_str( |
"this.propertyIsEnumerable(undefined)"))->Run(); |
CHECK(result->IsFalse()); |
@@ -1952,7 +1952,7 @@ static v8::Handle<Value> CallFunctionRecursivelyCall( |
THREADED_TEST(DeepCrossLanguageRecursion) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> global = ObjectTemplate::New(); |
global->Set(v8_str("callScriptRecursively"), |
v8::FunctionTemplate::New(CallScriptRecursivelyCall)); |
@@ -1986,7 +1986,7 @@ static v8::Handle<Value> ThrowingPropertyHandlerSet(Local<String> key, |
THREADED_TEST(CallbackExceptionRegression) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); |
obj->SetNamedPropertyHandler(ThrowingPropertyHandlerGet, |
ThrowingPropertyHandlerSet); |
@@ -2002,7 +2002,7 @@ THREADED_TEST(CallbackExceptionRegression) { |
THREADED_TEST(FunctionPrototype) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<v8::FunctionTemplate> Foo = v8::FunctionTemplate::New(); |
Foo->PrototypeTemplate()->Set(v8_str("plak"), v8_num(321)); |
LocalContext env; |
@@ -2013,8 +2013,8 @@ THREADED_TEST(FunctionPrototype) { |
THREADED_TEST(InternalFields) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(); |
Local<v8::ObjectTemplate> instance_templ = templ->InstanceTemplate(); |
@@ -2028,7 +2028,7 @@ THREADED_TEST(InternalFields) { |
THREADED_TEST(GlobalObjectInternalFields) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(); |
global_template->SetInternalFieldCount(1); |
LocalContext env(NULL, global_template); |
@@ -2051,8 +2051,8 @@ static void CheckAlignedPointerInInternalField(Handle<v8::Object> obj, |
THREADED_TEST(InternalFieldsAlignedPointers) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(); |
Local<v8::ObjectTemplate> instance_templ = templ->InstanceTemplate(); |
@@ -2090,8 +2090,8 @@ static void* AlignedTestPointer(int i) { |
THREADED_TEST(EmbedderDataAlignedPointers) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
CheckAlignedPointerInEmbedderData(&env, 0, NULL); |
@@ -2124,8 +2124,8 @@ static void CheckEmbedderData(LocalContext* env, |
} |
THREADED_TEST(EmbedderData) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
CheckEmbedderData(&env, 3, v8::String::New("The quick brown fox jumps")); |
CheckEmbedderData(&env, 2, v8::String::New("over the lazy dog.")); |
@@ -2135,8 +2135,8 @@ THREADED_TEST(EmbedderData) { |
THREADED_TEST(IdentityHash) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
// Ensure that the test starts with an fresh heap to test whether the hash |
// code is based on the address. |
@@ -2179,8 +2179,8 @@ THREADED_TEST(IdentityHash) { |
THREADED_TEST(HiddenProperties) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Local<v8::Object> obj = v8::Object::New(); |
v8::Local<v8::String> key = v8_str("api-test::hidden-key"); |
@@ -2234,8 +2234,8 @@ THREADED_TEST(Regress97784) { |
// Regression test for crbug.com/97784 |
// Messing with the Object.prototype should not have effect on |
// hidden properties. |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Local<v8::Object> obj = v8::Object::New(); |
v8::Local<v8::String> key = v8_str("hidden"); |
@@ -2267,8 +2267,8 @@ static v8::Handle<Value> InterceptorForHiddenProperties( |
THREADED_TEST(HiddenPropertiesWithInterceptors) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
interceptor_for_hidden_properties_called = false; |
@@ -2287,7 +2287,7 @@ THREADED_TEST(HiddenPropertiesWithInterceptors) { |
THREADED_TEST(External) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
int x = 3; |
Local<v8::External> ext = v8::External::New(&x); |
LocalContext env; |
@@ -2322,7 +2322,7 @@ THREADED_TEST(GlobalHandle) { |
v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
v8::Persistent<String> global; |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(isolate); |
Local<String> str = v8_str("str"); |
global = v8::Persistent<String>::New(isolate, str); |
} |
@@ -2330,7 +2330,7 @@ THREADED_TEST(GlobalHandle) { |
global.Dispose(isolate); |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(isolate); |
Local<String> str = v8_str("str"); |
global = v8::Persistent<String>::New(isolate, str); |
} |
@@ -2340,7 +2340,7 @@ THREADED_TEST(GlobalHandle) { |
THREADED_TEST(LocalHandle) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Local<String> local = v8::Local<String>::New(v8_str("str")); |
CHECK_EQ(local->Length(), 3); |
@@ -2372,9 +2372,9 @@ static void WeakPointerCallback(v8::Isolate* isolate, |
THREADED_TEST(ApiObjectGroups) { |
- HandleScope scope; |
LocalContext env; |
v8::Isolate* iso = env->GetIsolate(); |
+ HandleScope scope(iso); |
Persistent<Object> g1s1; |
Persistent<Object> g1s2; |
@@ -2386,7 +2386,7 @@ THREADED_TEST(ApiObjectGroups) { |
WeakCallCounter counter(1234); |
{ |
- HandleScope scope; |
+ HandleScope scope(iso); |
g1s1 = Persistent<Object>::New(iso, Object::New()); |
g1s2 = Persistent<Object>::New(iso, Object::New()); |
g1c1 = Persistent<Object>::New(iso, Object::New()); |
@@ -2458,9 +2458,9 @@ THREADED_TEST(ApiObjectGroups) { |
THREADED_TEST(ApiObjectGroupsCycle) { |
- HandleScope scope; |
LocalContext env; |
v8::Isolate* iso = env->GetIsolate(); |
+ HandleScope scope(iso); |
WeakCallCounter counter(1234); |
@@ -2474,7 +2474,7 @@ THREADED_TEST(ApiObjectGroupsCycle) { |
Persistent<Object> g4s2; |
{ |
- HandleScope scope; |
+ HandleScope scope(iso); |
g1s1 = Persistent<Object>::New(iso, Object::New()); |
g1s2 = Persistent<Object>::New(iso, Object::New()); |
g1s1.MakeWeak(iso, reinterpret_cast<void*>(&counter), &WeakPointerCallback); |
@@ -2568,9 +2568,9 @@ THREADED_TEST(ApiObjectGroupsCycle) { |
TEST(ApiObjectGroupsCycleForScavenger) { |
i::FLAG_stress_compaction = false; |
i::FLAG_gc_global = false; |
- HandleScope scope; |
LocalContext env; |
v8::Isolate* iso = env->GetIsolate(); |
+ HandleScope scope(iso); |
WeakCallCounter counter(1234); |
@@ -2582,7 +2582,7 @@ TEST(ApiObjectGroupsCycleForScavenger) { |
Persistent<Object> g3s2; |
{ |
- HandleScope scope; |
+ HandleScope scope(iso); |
g1s1 = Persistent<Object>::New(iso, Object::New()); |
g1s2 = Persistent<Object>::New(iso, Object::New()); |
g1s1.MakeWeak(iso, reinterpret_cast<void*>(&counter), &WeakPointerCallback); |
@@ -2661,8 +2661,8 @@ TEST(ApiObjectGroupsCycleForScavenger) { |
THREADED_TEST(ScriptException) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<Script> script = Script::Compile(v8_str("throw 'panama!';")); |
v8::TryCatch try_catch; |
Local<Value> result = script->Run(); |
@@ -2674,8 +2674,8 @@ THREADED_TEST(ScriptException) { |
TEST(TryCatchCustomException) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::TryCatch try_catch; |
CompileRun("function CustomError() { this.a = 'b'; }" |
"(function f() { throw new CustomError(); })();"); |
@@ -2699,7 +2699,7 @@ static void check_message_0(v8::Handle<v8::Message> message, |
THREADED_TEST(MessageHandler0) { |
message_received = false; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
CHECK(!message_received); |
v8::V8::AddMessageListener(check_message_0, v8_num(5.76)); |
LocalContext context; |
@@ -2725,7 +2725,7 @@ static void check_message_1(v8::Handle<v8::Message> message, |
TEST(MessageHandler1) { |
message_received = false; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
CHECK(!message_received); |
v8::V8::AddMessageListener(check_message_1); |
LocalContext context; |
@@ -2749,7 +2749,7 @@ static void check_message_2(v8::Handle<v8::Message> message, |
TEST(MessageHandler2) { |
message_received = false; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
CHECK(!message_received); |
v8::V8::AddMessageListener(check_message_2); |
LocalContext context; |
@@ -2765,8 +2765,8 @@ TEST(MessageHandler2) { |
THREADED_TEST(GetSetProperty) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
context->Global()->Set(v8_str("foo"), v8_num(14)); |
context->Global()->Set(v8_str("12"), v8_num(92)); |
context->Global()->Set(v8::Integer::New(16), v8_num(32)); |
@@ -2792,8 +2792,8 @@ THREADED_TEST(GetSetProperty) { |
THREADED_TEST(PropertyAttributes) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
// none |
Local<String> prop = v8_str("none"); |
context->Global()->Set(prop, v8_num(7)); |
@@ -2836,8 +2836,8 @@ THREADED_TEST(PropertyAttributes) { |
THREADED_TEST(Array) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<v8::Array> array = v8::Array::New(); |
CHECK_EQ(0, array->Length()); |
CHECK(array->Get(0)->IsUndefined()); |
@@ -2864,7 +2864,7 @@ THREADED_TEST(Array) { |
v8::Handle<Value> HandleF(const v8::Arguments& args) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(args.GetIsolate()); |
ApiTestFuzzer::Fuzz(); |
Local<v8::Array> result = v8::Array::New(args.Length()); |
for (int i = 0; i < args.Length(); i++) |
@@ -2874,7 +2874,7 @@ v8::Handle<Value> HandleF(const v8::Arguments& args) { |
THREADED_TEST(Vector) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> global = ObjectTemplate::New(); |
global->Set(v8_str("f"), v8::FunctionTemplate::New(HandleF)); |
LocalContext context(0, global); |
@@ -2912,8 +2912,8 @@ THREADED_TEST(Vector) { |
THREADED_TEST(FunctionCall) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
CompileRun( |
"function Foo() {" |
" var result = [];" |
@@ -2980,8 +2980,8 @@ TEST(OutOfMemory) { |
v8::SetResourceConstraints(&constraints); |
// Execute a script that causes out of memory. |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::V8::IgnoreOutOfMemoryException(); |
Local<Script> script = |
Script::Compile(String::New(js_code_causing_out_of_memory)); |
@@ -2996,8 +2996,8 @@ TEST(OutOfMemory) { |
v8::Handle<Value> ProvokeOutOfMemory(const v8::Arguments& args) { |
ApiTestFuzzer::Fuzz(); |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<Script> script = |
Script::Compile(String::New(js_code_causing_out_of_memory)); |
Local<Value> result = script->Run(); |
@@ -3020,7 +3020,7 @@ TEST(OutOfMemoryNested) { |
constraints.set_max_old_space_size(4 * K * K); |
v8::SetResourceConstraints(&constraints); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("ProvokeOutOfMemory"), |
v8::FunctionTemplate::New(ProvokeOutOfMemory)); |
@@ -3052,8 +3052,8 @@ TEST(HugeConsStringOutOfMemory) { |
// Execute a script that causes out of memory. |
v8::V8::IgnoreOutOfMemoryException(); |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
// Build huge string. This should fail with out of memory exception. |
Local<Value> result = CompileRun( |
@@ -3067,8 +3067,8 @@ TEST(HugeConsStringOutOfMemory) { |
THREADED_TEST(ConstructCall) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
CompileRun( |
"function Foo() {" |
" var result = [];" |
@@ -3127,8 +3127,8 @@ static void CheckUncle(v8::TryCatch* try_catch) { |
THREADED_TEST(ConversionNumber) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
// Very large number. |
CompileRun("var obj = Math.pow(2,32) * 1237;"); |
Local<Value> obj = env->Global()->Get(v8_str("obj")); |
@@ -3175,8 +3175,8 @@ THREADED_TEST(ConversionNumber) { |
THREADED_TEST(isNumberType) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
// Very large number. |
CompileRun("var obj = Math.pow(2,32) * 1237;"); |
Local<Value> obj = env->Global()->Get(v8_str("obj")); |
@@ -3226,8 +3226,8 @@ THREADED_TEST(isNumberType) { |
THREADED_TEST(ConversionException) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
CompileRun( |
"function TestClass() { };" |
"TestClass.prototype.toString = function () { throw 'uncle?'; };" |
@@ -3287,7 +3287,7 @@ v8::Handle<Value> ThrowFromC(const v8::Arguments& args) { |
v8::Handle<Value> CCatcher(const v8::Arguments& args) { |
if (args.Length() < 1) return v8::False(); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(args.GetIsolate()); |
v8::TryCatch try_catch; |
Local<Value> result = v8::Script::Compile(args[0]->ToString())->Run(); |
CHECK(!try_catch.HasCaught() || result.IsEmpty()); |
@@ -3296,7 +3296,7 @@ v8::Handle<Value> CCatcher(const v8::Arguments& args) { |
THREADED_TEST(APICatch) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("ThrowFromC"), |
v8::FunctionTemplate::New(ThrowFromC)); |
@@ -3314,7 +3314,7 @@ THREADED_TEST(APICatch) { |
THREADED_TEST(APIThrowTryCatch) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("ThrowFromC"), |
v8::FunctionTemplate::New(ThrowFromC)); |
@@ -3333,7 +3333,7 @@ THREADED_TEST(APIThrowTryCatch) { |
// JS stack. This test therefore fails on the simulator. The test is |
// not threaded to allow the threading tests to run on the simulator. |
TEST(TryCatchInTryFinally) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("CCatcher"), |
v8::FunctionTemplate::New(CCatcher)); |
@@ -3368,7 +3368,7 @@ static v8::Handle<Value> Fail(const v8::Arguments& args) { |
// formatting. However, they are invoked when performing normal error |
// string conversions. |
TEST(APIThrowMessageOverwrittenToString) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::V8::AddMessageListener(check_reference_error_message); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("fail"), v8::FunctionTemplate::New(Fail)); |
@@ -3414,9 +3414,9 @@ static void check_custom_error_message( |
TEST(CustomErrorToString) { |
- v8::HandleScope scope; |
- v8::V8::AddMessageListener(check_custom_error_message); |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
+ v8::V8::AddMessageListener(check_custom_error_message); |
CompileRun( |
"function MyError(name, message) { " |
" this.name = name; " |
@@ -3440,7 +3440,7 @@ static void receive_message(v8::Handle<v8::Message> message, |
TEST(APIThrowMessage) { |
message_received = false; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::V8::AddMessageListener(receive_message); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("ThrowFromC"), |
@@ -3454,7 +3454,7 @@ TEST(APIThrowMessage) { |
TEST(APIThrowMessageAndVerboseTryCatch) { |
message_received = false; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::V8::AddMessageListener(receive_message); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("ThrowFromC"), |
@@ -3472,9 +3472,9 @@ TEST(APIThrowMessageAndVerboseTryCatch) { |
TEST(APIStackOverflowAndVerboseTryCatch) { |
message_received = false; |
- v8::HandleScope scope; |
- v8::V8::AddMessageListener(receive_message); |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
+ v8::V8::AddMessageListener(receive_message); |
v8::TryCatch try_catch; |
try_catch.SetVerbose(true); |
Local<Value> result = CompileRun("function foo() { foo(); } foo();"); |
@@ -3486,7 +3486,7 @@ TEST(APIStackOverflowAndVerboseTryCatch) { |
THREADED_TEST(ExternalScriptException) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("ThrowFromC"), |
v8::FunctionTemplate::New(ThrowFromC)); |
@@ -3553,8 +3553,8 @@ v8::Handle<Value> JSCheck(const v8::Arguments& args) { |
THREADED_TEST(EvalInTryFinally) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::TryCatch try_catch; |
CompileRun("(function() {" |
" try {" |
@@ -3588,7 +3588,7 @@ THREADED_TEST(EvalInTryFinally) { |
// JS stack. This test therefore fails on the simulator. The test is |
// not threaded to allow the threading tests to run on the simulator. |
TEST(ExceptionOrder) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("check"), v8::FunctionTemplate::New(JSCheck)); |
templ->Set(v8_str("CThrowCountDown"), |
@@ -3652,7 +3652,7 @@ v8::Handle<Value> ThrowValue(const v8::Arguments& args) { |
THREADED_TEST(ThrowValues) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("Throw"), v8::FunctionTemplate::New(ThrowValue)); |
LocalContext context(0, templ); |
@@ -3678,8 +3678,8 @@ THREADED_TEST(ThrowValues) { |
THREADED_TEST(CatchZero) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::TryCatch try_catch; |
CHECK(!try_catch.HasCaught()); |
Script::Compile(v8_str("throw 10"))->Run(); |
@@ -3694,8 +3694,8 @@ THREADED_TEST(CatchZero) { |
THREADED_TEST(CatchExceptionFromWith) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::TryCatch try_catch; |
CHECK(!try_catch.HasCaught()); |
Script::Compile(v8_str("var o = {}; with (o) { throw 42; }"))->Run(); |
@@ -3704,8 +3704,8 @@ THREADED_TEST(CatchExceptionFromWith) { |
THREADED_TEST(TryCatchAndFinallyHidingException) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::TryCatch try_catch; |
CHECK(!try_catch.HasCaught()); |
CompileRun("function f(k) { try { this[k]; } finally { return 0; } };"); |
@@ -3721,8 +3721,8 @@ v8::Handle<v8::Value> WithTryCatch(const v8::Arguments& args) { |
THREADED_TEST(TryCatchAndFinally) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
context->Global()->Set( |
v8_str("native_with_try_catch"), |
v8::FunctionTemplate::New(WithTryCatch)->GetFunction()); |
@@ -3753,8 +3753,8 @@ static void TryCatchNestedHelper(int depth) { |
TEST(TryCatchNested) { |
v8::V8::Initialize(); |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::TryCatch try_catch; |
TryCatchNestedHelper(5); |
CHECK(try_catch.HasCaught()); |
@@ -3763,9 +3763,9 @@ TEST(TryCatchNested) { |
THREADED_TEST(Equality) { |
- v8::HandleScope scope; |
LocalContext context; |
v8::Isolate* isolate = context->GetIsolate(); |
+ v8::HandleScope scope(context->GetIsolate()); |
// Check that equality works at all before relying on CHECK_EQ |
CHECK(v8_str("a")->Equals(v8_str("a"))); |
CHECK(!v8_str("a")->Equals(v8_str("b"))); |
@@ -3797,8 +3797,8 @@ THREADED_TEST(Equality) { |
THREADED_TEST(MultiRun) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<Script> script = Script::Compile(v8_str("x")); |
for (int i = 0; i < 10; i++) |
script->Run(); |
@@ -3815,10 +3815,10 @@ static v8::Handle<Value> GetXValue(Local<String> name, |
THREADED_TEST(SimplePropertyRead) { |
- v8::HandleScope scope; |
+ LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetAccessor(v8_str("x"), GetXValue, NULL, v8_str("donut")); |
- LocalContext context; |
context->Global()->Set(v8_str("obj"), templ->NewInstance()); |
Local<Script> script = Script::Compile(v8_str("obj.x")); |
for (int i = 0; i < 10; i++) { |
@@ -3828,10 +3828,10 @@ THREADED_TEST(SimplePropertyRead) { |
} |
THREADED_TEST(DefinePropertyOnAPIAccessor) { |
- v8::HandleScope scope; |
+ LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetAccessor(v8_str("x"), GetXValue, NULL, v8_str("donut")); |
- LocalContext context; |
context->Global()->Set(v8_str("obj"), templ->NewInstance()); |
// Uses getOwnPropertyDescriptor to check the configurable status |
@@ -3875,7 +3875,7 @@ THREADED_TEST(DefinePropertyOnAPIAccessor) { |
} |
THREADED_TEST(DefinePropertyOnDefineGetterSetter) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetAccessor(v8_str("x"), GetXValue, NULL, v8_str("donut")); |
LocalContext context; |
@@ -3927,7 +3927,7 @@ static v8::Handle<v8::Object> GetGlobalProperty(LocalContext* context, |
THREADED_TEST(DefineAPIAccessorOnObject) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
LocalContext context; |
@@ -4001,7 +4001,7 @@ THREADED_TEST(DefineAPIAccessorOnObject) { |
THREADED_TEST(DontDeleteAPIAccessorsCannotBeOverriden) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
LocalContext context; |
@@ -4057,7 +4057,7 @@ static v8::Handle<Value> Get239Value(Local<String> name, |
THREADED_TEST(ElementAPIAccessor) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
LocalContext context; |
@@ -4095,7 +4095,7 @@ static void SetXValue(Local<String> name, |
THREADED_TEST(SimplePropertyWrite) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetAccessor(v8_str("x"), GetXValue, SetXValue, v8_str("donut")); |
LocalContext context; |
@@ -4112,7 +4112,7 @@ THREADED_TEST(SimplePropertyWrite) { |
THREADED_TEST(SetterOnly) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetAccessor(v8_str("x"), NULL, SetXValue, v8_str("donut")); |
LocalContext context; |
@@ -4129,7 +4129,7 @@ THREADED_TEST(SetterOnly) { |
THREADED_TEST(NoAccessors) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetAccessor(v8_str("x"), NULL, NULL, v8_str("donut")); |
LocalContext context; |
@@ -4150,7 +4150,7 @@ static v8::Handle<Value> XPropertyGetter(Local<String> property, |
THREADED_TEST(NamedInterceptorPropertyRead) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(XPropertyGetter); |
LocalContext context; |
@@ -4164,7 +4164,7 @@ THREADED_TEST(NamedInterceptorPropertyRead) { |
THREADED_TEST(NamedInterceptorDictionaryIC) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(XPropertyGetter); |
LocalContext context; |
@@ -4194,7 +4194,7 @@ THREADED_TEST(NamedInterceptorDictionaryIC) { |
THREADED_TEST(NamedInterceptorDictionaryICMultipleContext) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Persistent<Context> context1 = Context::New(); |
@@ -4248,7 +4248,7 @@ static v8::Handle<Value> SetXOnPrototypeGetter(Local<String> property, |
// This is a regression test for http://crbug.com/20104. Map |
// transitions should not interfere with post interceptor lookup. |
THREADED_TEST(NamedInterceptorMapTransitionRead) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<v8::FunctionTemplate> function_template = v8::FunctionTemplate::New(); |
Local<v8::ObjectTemplate> instance_template |
= function_template->InstanceTemplate(); |
@@ -4285,7 +4285,7 @@ static v8::Handle<Value> IndexedPropertySetter(uint32_t index, |
THREADED_TEST(IndexedInterceptorWithIndexedAccessor) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(IndexedPropertyGetter, |
IndexedPropertySetter); |
@@ -4352,7 +4352,7 @@ Handle<v8::Array> UnboxedDoubleIndexedPropertyEnumerator( |
// Make sure that the the interceptor code in the runtime properly handles |
// merging property name lists for double-array-backed arrays. |
THREADED_TEST(IndexedInterceptorUnboxedDoubleWithIndexedAccessor) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(UnboxedDoubleIndexedPropertyGetter, |
UnboxedDoubleIndexedPropertySetter, |
@@ -4404,7 +4404,7 @@ static v8::Handle<Value> NonStrictIndexedPropertyGetter( |
// Make sure that the the interceptor code in the runtime properly handles |
// merging property name lists for non-string arguments arrays. |
THREADED_TEST(IndexedInterceptorNonStrictArgsWithIndexedAccessor) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(NonStrictIndexedPropertyGetter, |
0, |
@@ -4430,7 +4430,7 @@ static v8::Handle<Value> IdentityIndexedPropertyGetter( |
THREADED_TEST(IndexedInterceptorWithGetOwnPropertyDescriptor) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(IdentityIndexedPropertyGetter); |
@@ -4451,7 +4451,7 @@ THREADED_TEST(IndexedInterceptorWithGetOwnPropertyDescriptor) { |
THREADED_TEST(IndexedInterceptorWithNoSetter) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(IdentityIndexedPropertyGetter); |
@@ -4474,7 +4474,7 @@ THREADED_TEST(IndexedInterceptorWithNoSetter) { |
THREADED_TEST(IndexedInterceptorWithAccessorCheck) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(IdentityIndexedPropertyGetter); |
@@ -4499,7 +4499,7 @@ THREADED_TEST(IndexedInterceptorWithAccessorCheck) { |
THREADED_TEST(IndexedInterceptorWithAccessorCheckSwitchedOn) { |
i::FLAG_allow_natives_syntax = true; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(IdentityIndexedPropertyGetter); |
@@ -4528,7 +4528,7 @@ THREADED_TEST(IndexedInterceptorWithAccessorCheckSwitchedOn) { |
THREADED_TEST(IndexedInterceptorWithDifferentIndices) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(IdentityIndexedPropertyGetter); |
@@ -4551,7 +4551,7 @@ THREADED_TEST(IndexedInterceptorWithDifferentIndices) { |
THREADED_TEST(IndexedInterceptorWithNegativeIndices) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(IdentityIndexedPropertyGetter); |
@@ -4590,7 +4590,7 @@ THREADED_TEST(IndexedInterceptorWithNegativeIndices) { |
THREADED_TEST(IndexedInterceptorWithNotSmiLookup) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(IdentityIndexedPropertyGetter); |
@@ -4619,7 +4619,7 @@ THREADED_TEST(IndexedInterceptorWithNotSmiLookup) { |
THREADED_TEST(IndexedInterceptorGoingMegamorphic) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(IdentityIndexedPropertyGetter); |
@@ -4649,7 +4649,7 @@ THREADED_TEST(IndexedInterceptorGoingMegamorphic) { |
THREADED_TEST(IndexedInterceptorReceiverTurningSmi) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(IdentityIndexedPropertyGetter); |
@@ -4679,7 +4679,7 @@ THREADED_TEST(IndexedInterceptorReceiverTurningSmi) { |
THREADED_TEST(IndexedInterceptorOnProto) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(IdentityIndexedPropertyGetter); |
@@ -4703,7 +4703,7 @@ THREADED_TEST(IndexedInterceptorOnProto) { |
THREADED_TEST(MultiContexts) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("dummy"), v8::FunctionTemplate::New(DummyCallHandler)); |
@@ -4739,7 +4739,7 @@ THREADED_TEST(FunctionPrototypeAcrossContexts) { |
// Make sure that functions created by cloning boilerplates cannot |
// communicate through their __proto__ field. |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
LocalContext env0; |
v8::Handle<v8::Object> global0 = |
@@ -4772,7 +4772,7 @@ THREADED_TEST(Regress892105) { |
// to Object.prototype and Array.prototype and create a new |
// environment. This should succeed. |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<String> source = v8_str("Object.prototype.obj = 1234;" |
"Array.prototype.arr = 4567;" |
@@ -4789,8 +4789,8 @@ THREADED_TEST(Regress892105) { |
THREADED_TEST(UndetectableObject) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<v8::FunctionTemplate> desc = |
v8::FunctionTemplate::New(0, v8::Handle<Value>()); |
@@ -4833,8 +4833,8 @@ THREADED_TEST(UndetectableObject) { |
THREADED_TEST(VoidLiteral) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<v8::FunctionTemplate> desc = |
v8::FunctionTemplate::New(0, v8::Handle<Value>()); |
@@ -4877,8 +4877,8 @@ THREADED_TEST(VoidLiteral) { |
THREADED_TEST(ExtensibleOnUndetectable) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<v8::FunctionTemplate> desc = |
v8::FunctionTemplate::New(0, v8::Handle<Value>()); |
@@ -4910,8 +4910,8 @@ THREADED_TEST(ExtensibleOnUndetectable) { |
THREADED_TEST(UndetectableString) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<String> obj = String::NewUndetectable("foo"); |
env->Global()->Set(v8_str("undetectable"), obj); |
@@ -4951,8 +4951,8 @@ THREADED_TEST(UndetectableString) { |
TEST(UndetectableOptimized) { |
i::FLAG_allow_natives_syntax = true; |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<String> obj = String::NewUndetectable("foo"); |
env->Global()->Set(v8_str("undetectable"), obj); |
@@ -5007,7 +5007,7 @@ static v8::Handle<Value> HandleLogDelegator(const v8::Arguments& args) { |
THREADED_TEST(GlobalObjectTemplate) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> global_template = ObjectTemplate::New(); |
global_template->Set(v8_str("JSNI_Log"), |
v8::FunctionTemplate::New(HandleLogDelegator)); |
@@ -5025,7 +5025,7 @@ static const char* kSimpleExtensionSource = |
THREADED_TEST(SimpleExtensions) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::RegisterExtension(new Extension("simpletest", kSimpleExtensionSource)); |
const char* extension_names[] = { "simpletest" }; |
v8::ExtensionConfiguration extensions(1, extension_names); |
@@ -5037,7 +5037,7 @@ THREADED_TEST(SimpleExtensions) { |
THREADED_TEST(NullExtensions) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::RegisterExtension(new Extension("nulltest", NULL)); |
const char* extension_names[] = { "nulltest" }; |
v8::ExtensionConfiguration extensions(1, extension_names); |
@@ -5055,7 +5055,7 @@ static const int kEmbeddedExtensionSourceValidLen = 34; |
THREADED_TEST(ExtensionMissingSourceLength) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::RegisterExtension(new Extension("srclentest_fail", |
kEmbeddedExtensionSource)); |
const char* extension_names[] = { "srclentest_fail" }; |
@@ -5068,7 +5068,7 @@ THREADED_TEST(ExtensionMissingSourceLength) { |
THREADED_TEST(ExtensionWithSourceLength) { |
for (int source_len = kEmbeddedExtensionSourceValidLen - 1; |
source_len <= kEmbeddedExtensionSourceValidLen + 1; ++source_len) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
i::ScopedVector<char> extension_name(32); |
i::OS::SNPrintF(extension_name, "ext #%d", source_len); |
v8::RegisterExtension(new Extension(extension_name.start(), |
@@ -5107,7 +5107,7 @@ static const char* kEvalExtensionSource2 = |
THREADED_TEST(UseEvalFromExtension) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::RegisterExtension(new Extension("evaltest1", kEvalExtensionSource1)); |
v8::RegisterExtension(new Extension("evaltest2", kEvalExtensionSource2)); |
const char* extension_names[] = { "evaltest1", "evaltest2" }; |
@@ -5140,7 +5140,7 @@ static const char* kWithExtensionSource2 = |
THREADED_TEST(UseWithFromExtension) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::RegisterExtension(new Extension("withtest1", kWithExtensionSource1)); |
v8::RegisterExtension(new Extension("withtest2", kWithExtensionSource2)); |
const char* extension_names[] = { "withtest1", "withtest2" }; |
@@ -5155,7 +5155,7 @@ THREADED_TEST(UseWithFromExtension) { |
THREADED_TEST(AutoExtensions) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
Extension* extension = new Extension("autotest", kSimpleExtensionSource); |
extension->set_auto_enable(true); |
v8::RegisterExtension(extension); |
@@ -5173,7 +5173,7 @@ static const char* kSyntaxErrorInExtensionSource = |
// Test that a syntax error in an extension does not cause a fatal |
// error but results in an empty context. |
THREADED_TEST(SyntaxErrorExtensions) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::RegisterExtension(new Extension("syntaxerror", |
kSyntaxErrorInExtensionSource)); |
const char* extension_names[] = { "syntaxerror" }; |
@@ -5190,7 +5190,7 @@ static const char* kExceptionInExtensionSource = |
// Test that an exception when installing an extension does not cause |
// a fatal error but results in an empty context. |
THREADED_TEST(ExceptionExtensions) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::RegisterExtension(new Extension("exception", |
kExceptionInExtensionSource)); |
const char* extension_names[] = { "exception" }; |
@@ -5211,7 +5211,7 @@ static const char* kNativeCallTest = |
// Test that a native runtime calls are supported in extensions. |
THREADED_TEST(NativeCallInExtensions) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::RegisterExtension(new Extension("nativecall", |
kNativeCallInExtensionSource)); |
const char* extension_names[] = { "nativecall" }; |
@@ -5246,7 +5246,7 @@ class NativeFunctionExtension : public Extension { |
THREADED_TEST(NativeFunctionDeclaration) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
const char* name = "nativedecl"; |
v8::RegisterExtension(new NativeFunctionExtension(name, |
"native function foo();")); |
@@ -5260,7 +5260,7 @@ THREADED_TEST(NativeFunctionDeclaration) { |
THREADED_TEST(NativeFunctionDeclarationError) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
const char* name = "nativedeclerr"; |
// Syntax error in extension code. |
v8::RegisterExtension(new NativeFunctionExtension(name, |
@@ -5273,7 +5273,7 @@ THREADED_TEST(NativeFunctionDeclarationError) { |
THREADED_TEST(NativeFunctionDeclarationErrorEscape) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
const char* name = "nativedeclerresc"; |
// Syntax error in extension code - escape code in "native" means that |
// it's not treated as a keyword. |
@@ -5288,7 +5288,7 @@ THREADED_TEST(NativeFunctionDeclarationErrorEscape) { |
static void CheckDependencies(const char* name, const char* expected) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::ExtensionConfiguration config(1, &name); |
LocalContext context(&config); |
CHECK_EQ(String::New(expected), context->Global()->Get(v8_str("loaded"))); |
@@ -5316,7 +5316,7 @@ THREADED_TEST(ExtensionDependency) { |
CheckDependencies("C", "undefinedAC"); |
CheckDependencies("D", "undefinedABCD"); |
CheckDependencies("E", "undefinedABCDE"); |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
static const char* exts[2] = { "C", "E" }; |
v8::ExtensionConfiguration config(2, exts); |
LocalContext context(&config); |
@@ -5371,7 +5371,7 @@ v8::Handle<v8::FunctionTemplate> FunctionExtension::GetNativeFunction( |
THREADED_TEST(FunctionLookup) { |
v8::RegisterExtension(new FunctionExtension()); |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
static const char* exts[1] = { "functiontest" }; |
v8::ExtensionConfiguration config(1, exts); |
LocalContext context(&config); |
@@ -5384,7 +5384,7 @@ THREADED_TEST(FunctionLookup) { |
THREADED_TEST(NativeFunctionConstructCall) { |
v8::RegisterExtension(new FunctionExtension()); |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
static const char* exts[1] = { "functiontest" }; |
v8::ExtensionConfiguration config(1, exts); |
LocalContext context(&config); |
@@ -5443,7 +5443,7 @@ void OOMCallback(const char* location, const char* message) { |
TEST(RegexpOutOfMemory) { |
// Execute a script that causes out of memory when flattening a string. |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::V8::SetFatalErrorHandler(OOMCallback); |
LocalContext context; |
Local<Script> script = |
@@ -5465,8 +5465,8 @@ static void MissingScriptInfoMessageListener(v8::Handle<v8::Message> message, |
THREADED_TEST(ErrorWithMissingScriptInfo) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::V8::AddMessageListener(MissingScriptInfoMessageListener); |
Script::Compile(v8_str("throw Error()"))->Run(); |
v8::V8::RemoveMessageListeners(MissingScriptInfoMessageListener); |
@@ -5530,7 +5530,7 @@ v8::Handle<Value> WhammyPropertyGetter(Local<String> name, |
} |
THREADED_TEST(WeakReference) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ= v8::ObjectTemplate::New(); |
Whammy* whammy = new Whammy(v8::Isolate::GetCurrent()); |
templ->SetNamedPropertyHandler(WhammyPropertyGetter, |
@@ -5576,7 +5576,7 @@ THREADED_TEST(IndependentWeakHandle) { |
v8::Persistent<v8::Object> object_a, object_b; |
{ |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(iso); |
object_a = v8::Persistent<v8::Object>::New(iso, v8::Object::New()); |
object_b = v8::Persistent<v8::Object>::New(iso, v8::Object::New()); |
} |
@@ -5641,7 +5641,7 @@ THREADED_TEST(GCFromWeakCallbacks) { |
for (int inner_gc = 0; inner_gc < kNumberOfGCTypes; inner_gc++) { |
v8::Persistent<v8::Object> object; |
{ |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(isolate); |
object = v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
} |
bool disposed = false; |
@@ -5669,7 +5669,7 @@ THREADED_TEST(IndependentHandleRevival) { |
v8::Persistent<v8::Object> object; |
{ |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(isolate); |
object = v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
object->Set(v8_str("x"), v8::Integer::New(1)); |
v8::Local<String> y_str = v8_str("y"); |
@@ -5682,7 +5682,7 @@ THREADED_TEST(IndependentHandleRevival) { |
CHECK(revived); |
HEAP->CollectAllGarbage(i::Heap::kAbortIncrementalMarkingMask); |
{ |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(isolate); |
v8::Local<String> y_str = v8_str("y"); |
CHECK_EQ(v8::Integer::New(1), object->Get(v8_str("x"))); |
CHECK(object->Get(y_str)->Equals(y_str)); |
@@ -5701,14 +5701,14 @@ static v8::Handle<Value> ArgumentsTestCallback(const v8::Arguments& args) { |
CHECK_EQ(v8::Integer::New(2), args[1]); |
CHECK_EQ(v8::Integer::New(3), args[2]); |
CHECK_EQ(v8::Undefined(), args[3]); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(args.GetIsolate()); |
HEAP->CollectAllGarbage(i::Heap::kNoGCFlags); |
return v8::Undefined(); |
} |
THREADED_TEST(Arguments) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> global = ObjectTemplate::New(); |
global->Set(v8_str("f"), v8::FunctionTemplate::New(ArgumentsTestCallback)); |
LocalContext context(NULL, global); |
@@ -5749,7 +5749,7 @@ static v8::Handle<v8::Boolean> IDeleter(uint32_t index, const AccessorInfo&) { |
THREADED_TEST(Deleter) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); |
obj->SetNamedPropertyHandler(NoBlockGetterX, NULL, NULL, PDeleter, NULL); |
obj->SetIndexedPropertyHandler(NoBlockGetterI, NULL, NULL, IDeleter, NULL); |
@@ -5812,7 +5812,7 @@ static v8::Handle<v8::Array> IndexedEnum(const AccessorInfo&) { |
THREADED_TEST(Enumerators) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); |
obj->SetNamedPropertyHandler(GetK, NULL, NULL, NULL, NamedEnum); |
obj->SetIndexedPropertyHandler(IndexedGetK, NULL, NULL, NULL, IndexedEnum); |
@@ -5926,7 +5926,7 @@ static v8::Handle<Value> PGetter2(Local<String> name, |
THREADED_TEST(GetterHolders) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); |
obj->SetAccessor(v8_str("p1"), PGetter); |
obj->SetAccessor(v8_str("p2"), PGetter); |
@@ -5939,7 +5939,7 @@ THREADED_TEST(GetterHolders) { |
THREADED_TEST(PreInterceptorHolders) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); |
obj->SetNamedPropertyHandler(PGetter2); |
p_getter_count2 = 0; |
@@ -5949,13 +5949,13 @@ THREADED_TEST(PreInterceptorHolders) { |
THREADED_TEST(ObjectInstantiation) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetAccessor(v8_str("t"), PGetter2); |
LocalContext context; |
context->Global()->Set(v8_str("o"), templ->NewInstance()); |
for (int i = 0; i < 100; i++) { |
- v8::HandleScope inner_scope; |
+ v8::HandleScope inner_scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::Object> obj = templ->NewInstance(); |
CHECK_NE(obj, context->Global()->Get(v8_str("o"))); |
context->Global()->Set(v8_str("o2"), obj); |
@@ -6001,7 +6001,7 @@ int GetUtf8Length(Handle<String> str) { |
THREADED_TEST(StringWrite) { |
LocalContext context; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<String> str = v8_str("abcde"); |
// abc<Icelandic eth><Unicode snowman>. |
v8::Handle<String> str2 = v8_str("abc\303\260\342\230\203"); |
@@ -6345,7 +6345,7 @@ static void WriteUtf8Helper( |
THREADED_TEST(Utf16) { |
LocalContext context; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(context->GetIsolate()); |
CompileRun( |
"var pad = '01234567890123456789';" |
"var p = [];" |
@@ -6411,7 +6411,7 @@ static void SameSymbolHelper(const char* a, const char* b) { |
THREADED_TEST(Utf16Symbol) { |
LocalContext context; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(context->GetIsolate()); |
Handle<String> symbol1 = v8::String::NewSymbol("abc"); |
Handle<String> symbol2 = v8::String::NewSymbol("abc"); |
@@ -6463,8 +6463,8 @@ THREADED_TEST(Utf16Symbol) { |
THREADED_TEST(ToArrayIndex) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<String> str = v8_str("42"); |
v8::Handle<v8::Uint32> index = str->ToArrayIndex(); |
@@ -6494,8 +6494,8 @@ THREADED_TEST(ToArrayIndex) { |
THREADED_TEST(ErrorConstruction) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<String> foo = v8_str("foo"); |
v8::Handle<String> message = v8_str("message"); |
@@ -6534,7 +6534,7 @@ static void YSetter(Local<String> name, |
THREADED_TEST(DeleteAccessor) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); |
obj->SetAccessor(v8_str("y"), YGetter, YSetter); |
LocalContext context; |
@@ -6547,7 +6547,7 @@ THREADED_TEST(DeleteAccessor) { |
THREADED_TEST(TypeSwitch) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> templ1 = v8::FunctionTemplate::New(); |
v8::Handle<v8::FunctionTemplate> templ2 = v8::FunctionTemplate::New(); |
v8::Handle<v8::FunctionTemplate> templ3 = v8::FunctionTemplate::New(); |
@@ -6625,8 +6625,8 @@ static void ApiUncaughtExceptionTestListener(v8::Handle<v8::Message>, |
// also have uncaught exceptions. |
TEST(ApiUncaughtException) { |
report_count = 0; |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::V8::AddMessageListener(ApiUncaughtExceptionTestListener); |
Local<v8::FunctionTemplate> fun = v8::FunctionTemplate::New(TroubleCallback); |
@@ -6664,8 +6664,8 @@ static void ExceptionInNativeScriptTestListener(v8::Handle<v8::Message> message, |
} |
TEST(ExceptionInNativeScript) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::V8::AddMessageListener(ExceptionInNativeScriptTestListener); |
Local<v8::FunctionTemplate> fun = v8::FunctionTemplate::New(TroubleCallback); |
@@ -6684,8 +6684,8 @@ TEST(ExceptionInNativeScript) { |
TEST(CompilationErrorUsingTryCatchHandler) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::TryCatch try_catch; |
Script::Compile(v8_str("This doesn't &*&@#$&*^ compile.")); |
CHECK_NE(NULL, *try_catch.Exception()); |
@@ -6694,8 +6694,8 @@ TEST(CompilationErrorUsingTryCatchHandler) { |
TEST(TryCatchFinallyUsingTryCatchHandler) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::TryCatch try_catch; |
Script::Compile(v8_str("try { throw ''; } catch (e) {}"))->Run(); |
CHECK(!try_catch.HasCaught()); |
@@ -6715,7 +6715,7 @@ TEST(TryCatchFinallyUsingTryCatchHandler) { |
// SecurityHandler can't be run twice |
TEST(SecurityHandler) { |
- v8::HandleScope scope0; |
+ v8::HandleScope scope0(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(); |
global_template->SetAccessCheckCallbacks(NamedSecurityTestCallback, |
IndexedSecurityTestCallback); |
@@ -6734,7 +6734,7 @@ TEST(SecurityHandler) { |
CHECK_EQ(999, z0->Int32Value()); |
// Create another environment, should fail security checks. |
- v8::HandleScope scope1; |
+ v8::HandleScope scope1(v8::Isolate::GetCurrent()); |
v8::Persistent<Context> context1 = |
Context::New(NULL, global_template); |
@@ -6755,7 +6755,7 @@ TEST(SecurityHandler) { |
// Create another environment, should pass security checks. |
{ g_security_callback_result = true; // allow security handler to pass. |
- v8::HandleScope scope2; |
+ v8::HandleScope scope2(v8::Isolate::GetCurrent()); |
LocalContext context2; |
v8::Handle<v8::Object> global2 = context2->Global(); |
global2->Set(v8_str("othercontext"), global0); |
@@ -6777,8 +6777,8 @@ TEST(SecurityHandler) { |
THREADED_TEST(SecurityChecks) { |
- v8::HandleScope handle_scope; |
LocalContext env1; |
+ v8::HandleScope handle_scope(env1->GetIsolate()); |
v8::Persistent<Context> env2 = Context::New(); |
Local<Value> foo = v8_str("foo"); |
@@ -6822,8 +6822,8 @@ THREADED_TEST(SecurityChecks) { |
// Regression test case for issue 1183439. |
THREADED_TEST(SecurityChecksForPrototypeChain) { |
- v8::HandleScope scope; |
LocalContext current; |
+ v8::HandleScope scope(current->GetIsolate()); |
v8::Persistent<Context> other = Context::New(); |
// Change context to be able to get to the Object function in the |
@@ -6890,8 +6890,8 @@ THREADED_TEST(SecurityChecksForPrototypeChain) { |
THREADED_TEST(CrossDomainDelete) { |
- v8::HandleScope handle_scope; |
LocalContext env1; |
+ v8::HandleScope handle_scope(env1->GetIsolate()); |
v8::Persistent<Context> env2 = Context::New(); |
Local<Value> foo = v8_str("foo"); |
@@ -6923,8 +6923,8 @@ THREADED_TEST(CrossDomainDelete) { |
THREADED_TEST(CrossDomainIsPropertyEnumerable) { |
- v8::HandleScope handle_scope; |
LocalContext env1; |
+ v8::HandleScope handle_scope(env1->GetIsolate()); |
v8::Persistent<Context> env2 = Context::New(); |
Local<Value> foo = v8_str("foo"); |
@@ -6958,8 +6958,8 @@ THREADED_TEST(CrossDomainIsPropertyEnumerable) { |
THREADED_TEST(CrossDomainForIn) { |
- v8::HandleScope handle_scope; |
LocalContext env1; |
+ v8::HandleScope handle_scope(env1->GetIsolate()); |
v8::Persistent<Context> env2 = Context::New(); |
Local<Value> foo = v8_str("foo"); |
@@ -6991,8 +6991,8 @@ THREADED_TEST(CrossDomainForIn) { |
TEST(ContextDetachGlobal) { |
- v8::HandleScope handle_scope; |
LocalContext env1; |
+ v8::HandleScope handle_scope(env1->GetIsolate()); |
v8::Persistent<Context> env2 = Context::New(); |
Local<v8::Object> global1 = env1->Global(); |
@@ -7055,8 +7055,8 @@ TEST(ContextDetachGlobal) { |
TEST(DetachAndReattachGlobal) { |
- v8::HandleScope scope; |
LocalContext env1; |
+ v8::HandleScope scope(env1->GetIsolate()); |
// Create second environment. |
v8::Persistent<Context> env2 = Context::New(); |
@@ -7181,7 +7181,7 @@ static void UnreachableSetter(Local<String>, Local<Value>, |
TEST(AccessControl) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(); |
global_template->SetAccessCheckCallbacks(NamedAccessBlocker, |
@@ -7227,7 +7227,7 @@ TEST(AccessControl) { |
Local<Value> el_getter = global0->Get(v8_str("el_getter")); |
Local<Value> el_setter = global0->Get(v8_str("el_setter")); |
- v8::HandleScope scope1; |
+ v8::HandleScope scope1(v8::Isolate::GetCurrent()); |
v8::Persistent<Context> context1 = Context::New(); |
context1->Enter(); |
@@ -7425,7 +7425,7 @@ TEST(AccessControl) { |
TEST(AccessControlES5) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(); |
global_template->SetAccessCheckCallbacks(NamedAccessBlocker, |
@@ -7511,7 +7511,7 @@ static bool GetOwnPropertyNamesIndexedBlocker(Local<v8::Object> global, |
THREADED_TEST(AccessControlGetOwnPropertyNames) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> obj_template = v8::ObjectTemplate::New(); |
obj_template->Set(v8_str("x"), v8::Integer::New(42)); |
@@ -7524,7 +7524,7 @@ THREADED_TEST(AccessControlGetOwnPropertyNames) { |
v8::Handle<v8::Object> global0 = context0->Global(); |
- v8::HandleScope scope1; |
+ v8::HandleScope scope1(v8::Isolate::GetCurrent()); |
v8::Persistent<Context> context1 = Context::New(); |
context1->Enter(); |
@@ -7570,7 +7570,7 @@ static v8::Handle<v8::Array> NamedPropertyEnumerator(const AccessorInfo& info) { |
THREADED_TEST(GetOwnPropertyNamesWithInterceptor) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> obj_template = v8::ObjectTemplate::New(); |
obj_template->Set(v8_str("7"), v8::Integer::New(7)); |
@@ -7605,7 +7605,7 @@ static v8::Handle<Value> ConstTenGetter(Local<String> name, |
THREADED_TEST(CrossDomainAccessors) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> func_template = v8::FunctionTemplate::New(); |
@@ -7635,7 +7635,7 @@ THREADED_TEST(CrossDomainAccessors) { |
global->Set(v8_str("accessible"), v8_num(11)); |
// Enter a new context. |
- v8::HandleScope scope1; |
+ v8::HandleScope scope1(v8::Isolate::GetCurrent()); |
v8::Persistent<Context> context1 = Context::New(); |
context1->Enter(); |
@@ -7683,7 +7683,7 @@ TEST(AccessControlIC) { |
named_access_count = 0; |
indexed_access_count = 0; |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
// Create an environment. |
v8::Persistent<Context> context0 = Context::New(); |
@@ -7696,7 +7696,7 @@ TEST(AccessControlIC) { |
IndexedAccessCounter); |
Local<v8::Object> object = object_template->NewInstance(); |
- v8::HandleScope scope1; |
+ v8::HandleScope scope1(v8::Isolate::GetCurrent()); |
// Create another environment. |
v8::Persistent<Context> context1 = Context::New(); |
@@ -7832,7 +7832,7 @@ THREADED_TEST(AccessControlFlatten) { |
named_access_count = 0; |
indexed_access_count = 0; |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
// Create an environment. |
v8::Persistent<Context> context0 = Context::New(); |
@@ -7845,7 +7845,7 @@ THREADED_TEST(AccessControlFlatten) { |
IndexedAccessFlatten); |
Local<v8::Object> object = object_template->NewInstance(); |
- v8::HandleScope scope1; |
+ v8::HandleScope scope1(v8::Isolate::GetCurrent()); |
// Create another environment. |
v8::Persistent<Context> context1 = Context::New(); |
@@ -7896,7 +7896,7 @@ THREADED_TEST(AccessControlInterceptorIC) { |
named_access_count = 0; |
indexed_access_count = 0; |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
// Create an environment. |
v8::Persistent<Context> context0 = Context::New(); |
@@ -7914,7 +7914,7 @@ THREADED_TEST(AccessControlInterceptorIC) { |
AccessControlIndexedSetter); |
Local<v8::Object> object = object_template->NewInstance(); |
- v8::HandleScope scope1; |
+ v8::HandleScope scope1(v8::Isolate::GetCurrent()); |
// Create another environment. |
v8::Persistent<Context> context1 = Context::New(); |
@@ -7971,8 +7971,8 @@ static v8::Handle<Value> InstanceFunctionCallback(const v8::Arguments& args) { |
THREADED_TEST(InstanceProperties) { |
- v8::HandleScope handle_scope; |
LocalContext context; |
+ v8::HandleScope handle_scope(context->GetIsolate()); |
Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(); |
Local<ObjectTemplate> instance = t->InstanceTemplate(); |
@@ -8000,7 +8000,7 @@ GlobalObjectInstancePropertiesGet(Local<String> key, const AccessorInfo&) { |
THREADED_TEST(GlobalObjectInstanceProperties) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
Local<Value> global_object; |
@@ -8056,7 +8056,7 @@ THREADED_TEST(GlobalObjectInstanceProperties) { |
THREADED_TEST(CallKnownGlobalReceiver) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
Local<Value> global_object; |
@@ -8134,7 +8134,7 @@ static v8::Handle<Value> ShadowNamedGet(Local<String> key, |
THREADED_TEST(ShadowObject) { |
shadow_y = shadow_y_setter_call_count = shadow_y_getter_call_count = 0; |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> global_template = v8::ObjectTemplate::New(); |
LocalContext context(NULL, global_template); |
@@ -8174,8 +8174,8 @@ THREADED_TEST(ShadowObject) { |
THREADED_TEST(HiddenPrototype) { |
- v8::HandleScope handle_scope; |
LocalContext context; |
+ v8::HandleScope handle_scope(context->GetIsolate()); |
Local<v8::FunctionTemplate> t0 = v8::FunctionTemplate::New(); |
t0->InstanceTemplate()->Set(v8_str("x"), v8_num(0)); |
@@ -8218,8 +8218,8 @@ THREADED_TEST(HiddenPrototype) { |
THREADED_TEST(HiddenPrototypeSet) { |
- v8::HandleScope handle_scope; |
LocalContext context; |
+ v8::HandleScope handle_scope(context->GetIsolate()); |
Local<v8::FunctionTemplate> ot = v8::FunctionTemplate::New(); |
Local<v8::FunctionTemplate> ht = v8::FunctionTemplate::New(); |
@@ -8260,8 +8260,8 @@ THREADED_TEST(HiddenPrototypeSet) { |
// Regression test for issue 2457. |
THREADED_TEST(HiddenPrototypeIdentityHash) { |
- v8::HandleScope handle_scope; |
LocalContext context; |
+ v8::HandleScope handle_scope(context->GetIsolate()); |
Handle<FunctionTemplate> t = FunctionTemplate::New(); |
t->SetHiddenPrototype(true); |
@@ -8278,8 +8278,8 @@ THREADED_TEST(HiddenPrototypeIdentityHash) { |
THREADED_TEST(SetPrototype) { |
- v8::HandleScope handle_scope; |
LocalContext context; |
+ v8::HandleScope handle_scope(context->GetIsolate()); |
Local<v8::FunctionTemplate> t0 = v8::FunctionTemplate::New(); |
t0->InstanceTemplate()->Set(v8_str("x"), v8_num(0)); |
@@ -8339,8 +8339,8 @@ THREADED_TEST(SetPrototype) { |
// crash the runtime. |
THREADED_TEST(Regress91517) { |
i::FLAG_allow_natives_syntax = true; |
- v8::HandleScope handle_scope; |
LocalContext context; |
+ v8::HandleScope handle_scope(context->GetIsolate()); |
Local<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New(); |
t1->SetHiddenPrototype(true); |
@@ -8389,8 +8389,8 @@ THREADED_TEST(Regress91517) { |
THREADED_TEST(FunctionReadOnlyPrototype) { |
- v8::HandleScope handle_scope; |
LocalContext context; |
+ v8::HandleScope handle_scope(context->GetIsolate()); |
Local<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New(); |
t1->PrototypeTemplate()->Set(v8_str("x"), v8::Integer::New(42)); |
@@ -8420,8 +8420,8 @@ THREADED_TEST(FunctionReadOnlyPrototype) { |
THREADED_TEST(SetPrototypeThrows) { |
- v8::HandleScope handle_scope; |
LocalContext context; |
+ v8::HandleScope handle_scope(context->GetIsolate()); |
Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(); |
@@ -8441,8 +8441,8 @@ THREADED_TEST(SetPrototypeThrows) { |
THREADED_TEST(GetterSetterExceptions) { |
- v8::HandleScope handle_scope; |
LocalContext context; |
+ v8::HandleScope handle_scope(context->GetIsolate()); |
CompileRun( |
"function Foo() { };" |
"function Throw() { throw 5; };" |
@@ -8464,8 +8464,8 @@ THREADED_TEST(GetterSetterExceptions) { |
THREADED_TEST(Constructor) { |
- v8::HandleScope handle_scope; |
LocalContext context; |
+ v8::HandleScope handle_scope(context->GetIsolate()); |
Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(); |
templ->SetClassName(v8_str("Fun")); |
Local<Function> cons = templ->GetFunction(); |
@@ -8505,8 +8505,8 @@ static Handle<Value> FakeConstructorCallback(const Arguments& args) { |
THREADED_TEST(ConstructorForObject) { |
- v8::HandleScope handle_scope; |
LocalContext context; |
+ v8::HandleScope handle_scope(context->GetIsolate()); |
{ Local<ObjectTemplate> instance_template = ObjectTemplate::New(); |
instance_template->SetCallAsFunctionHandler(ConstructorCallback); |
@@ -8672,8 +8672,8 @@ THREADED_TEST(ConstructorForObject) { |
THREADED_TEST(FunctionDescriptorException) { |
- v8::HandleScope handle_scope; |
LocalContext context; |
+ v8::HandleScope handle_scope(context->GetIsolate()); |
Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(); |
templ->SetClassName(v8_str("Fun")); |
Local<Function> cons = templ->GetFunction(); |
@@ -8697,8 +8697,8 @@ THREADED_TEST(FunctionDescriptorException) { |
THREADED_TEST(EvalAliasedDynamic) { |
- v8::HandleScope scope; |
LocalContext current; |
+ v8::HandleScope scope(current->GetIsolate()); |
// Tests where aliased eval can only be resolved dynamically. |
Local<Script> script = |
@@ -8733,7 +8733,7 @@ THREADED_TEST(EvalAliasedDynamic) { |
THREADED_TEST(CrossEval) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
LocalContext other; |
LocalContext current; |
@@ -8816,7 +8816,7 @@ THREADED_TEST(CrossEval) { |
// its global throws an exception. This behavior is consistent with |
// other JavaScript implementations. |
THREADED_TEST(EvalInDetachedGlobal) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Persistent<Context> context0 = Context::New(); |
v8::Persistent<Context> context1 = Context::New(); |
@@ -8851,7 +8851,7 @@ THREADED_TEST(EvalInDetachedGlobal) { |
THREADED_TEST(CrossLazyLoad) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
LocalContext other; |
LocalContext current; |
@@ -8886,8 +8886,8 @@ static v8::Handle<Value> call_as_function(const v8::Arguments& args) { |
// non-function objects created through the API to be called as |
// functions. |
THREADED_TEST(CallAsFunction) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
{ Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(); |
Local<ObjectTemplate> instance_template = t->InstanceTemplate(); |
@@ -8999,8 +8999,8 @@ THREADED_TEST(CallAsFunction) { |
// Check whether a non-function object is callable. |
THREADED_TEST(CallableObject) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
{ Local<ObjectTemplate> instance_template = ObjectTemplate::New(); |
instance_template->SetCallAsFunctionHandler(call_as_function); |
@@ -9046,7 +9046,7 @@ static int CountHandles() { |
static int Recurse(int depth, int iterations) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
if (depth == 0) return CountHandles(); |
for (int i = 0; i < iterations; i++) { |
Local<v8::Number> n(v8::Integer::New(42)); |
@@ -9060,7 +9060,7 @@ THREADED_TEST(HandleIteration) { |
static const int kNesting = 200; |
CHECK_EQ(0, CountHandles()); |
{ |
- v8::HandleScope scope1; |
+ v8::HandleScope scope1(v8::Isolate::GetCurrent()); |
CHECK_EQ(0, CountHandles()); |
for (int i = 0; i < kIterations; i++) { |
Local<v8::Number> n(v8::Integer::New(42)); |
@@ -9069,7 +9069,7 @@ THREADED_TEST(HandleIteration) { |
CHECK_EQ(kIterations, CountHandles()); |
{ |
- v8::HandleScope scope2; |
+ v8::HandleScope scope2(v8::Isolate::GetCurrent()); |
for (int j = 0; j < kIterations; j++) { |
Local<v8::Number> n(v8::Integer::New(42)); |
CHECK_EQ(j + 1 + kIterations, CountHandles()); |
@@ -9091,8 +9091,8 @@ static v8::Handle<Value> InterceptorHasOwnPropertyGetter( |
THREADED_TEST(InterceptorHasOwnProperty) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(); |
Local<v8::ObjectTemplate> instance_templ = fun_templ->InstanceTemplate(); |
instance_templ->SetNamedPropertyHandler(InterceptorHasOwnPropertyGetter); |
@@ -9123,8 +9123,8 @@ static v8::Handle<Value> InterceptorHasOwnPropertyGetterGC( |
THREADED_TEST(InterceptorHasOwnPropertyCausingGC) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(); |
Local<v8::ObjectTemplate> instance_templ = fun_templ->InstanceTemplate(); |
instance_templ->SetNamedPropertyHandler(InterceptorHasOwnPropertyGetterGC); |
@@ -9158,7 +9158,7 @@ typedef v8::Handle<Value> (*NamedPropertyGetter)(Local<String> property, |
static void CheckInterceptorLoadIC(NamedPropertyGetter getter, |
const char* source, |
int expected) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(getter, 0, 0, 0, 0, v8_str("data")); |
LocalContext context; |
@@ -9367,7 +9367,7 @@ static void SetOnThis(Local<String> name, |
THREADED_TEST(InterceptorLoadICWithCallbackOnHolder) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(InterceptorLoadXICGetter); |
templ->SetAccessor(v8_str("y"), Return239); |
@@ -9396,7 +9396,7 @@ THREADED_TEST(InterceptorLoadICWithCallbackOnHolder) { |
THREADED_TEST(InterceptorLoadICWithCallbackOnProto) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ_o = ObjectTemplate::New(); |
templ_o->SetNamedPropertyHandler(InterceptorLoadXICGetter); |
v8::Handle<v8::ObjectTemplate> templ_p = ObjectTemplate::New(); |
@@ -9429,7 +9429,7 @@ THREADED_TEST(InterceptorLoadICWithCallbackOnProto) { |
THREADED_TEST(InterceptorLoadICForCallbackWithOverride) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(InterceptorLoadXICGetter); |
templ->SetAccessor(v8_str("y"), Return239); |
@@ -9457,7 +9457,7 @@ THREADED_TEST(InterceptorLoadICForCallbackWithOverride) { |
// Test the case when we stored callback into |
// a stub, but interceptor produced value on its own. |
THREADED_TEST(InterceptorLoadICCallbackNotNeeded) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ_o = ObjectTemplate::New(); |
templ_o->SetNamedPropertyHandler(InterceptorLoadXICGetter); |
v8::Handle<v8::ObjectTemplate> templ_p = ObjectTemplate::New(); |
@@ -9485,7 +9485,7 @@ THREADED_TEST(InterceptorLoadICCallbackNotNeeded) { |
// Test the case when we stored callback into |
// a stub, but it got invalidated later on. |
THREADED_TEST(InterceptorLoadICInvalidatedCallback) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ_o = ObjectTemplate::New(); |
templ_o->SetNamedPropertyHandler(InterceptorLoadXICGetter); |
v8::Handle<v8::ObjectTemplate> templ_p = ObjectTemplate::New(); |
@@ -9517,7 +9517,7 @@ THREADED_TEST(InterceptorLoadICInvalidatedCallback) { |
// a stub, but it got invalidated later on due to override on |
// global object which is between interceptor and callbacks' holders. |
THREADED_TEST(InterceptorLoadICInvalidatedCallbackViaGlobal) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ_o = ObjectTemplate::New(); |
templ_o->SetNamedPropertyHandler(InterceptorLoadXICGetter); |
v8::Handle<v8::ObjectTemplate> templ_p = ObjectTemplate::New(); |
@@ -9569,7 +9569,7 @@ static v8::Handle<Value> InterceptorStoreICSetter( |
// This test should hit the store IC for the interceptor case. |
THREADED_TEST(InterceptorStoreIC) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(InterceptorLoadICGetter, |
InterceptorStoreICSetter, |
@@ -9584,7 +9584,7 @@ THREADED_TEST(InterceptorStoreIC) { |
THREADED_TEST(InterceptorStoreICWithNoSetter) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(InterceptorLoadXICGetter); |
LocalContext context; |
@@ -9614,7 +9614,7 @@ static v8::Handle<Value> InterceptorCallICGetter(Local<String> name, |
// This test should hit the call IC for the interceptor case. |
THREADED_TEST(InterceptorCallIC) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(InterceptorCallICGetter); |
LocalContext context; |
@@ -9633,7 +9633,7 @@ THREADED_TEST(InterceptorCallIC) { |
// This test checks that if interceptor doesn't provide |
// a value, we can fetch regular value. |
THREADED_TEST(InterceptorCallICSeesOthers) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(NoBlockGetterX); |
LocalContext context; |
@@ -9661,7 +9661,7 @@ static v8::Handle<Value> InterceptorCallICGetter4(Local<String> name, |
// even if we cached shadowed variant, interceptor's function |
// is invoked |
THREADED_TEST(InterceptorCallICCacheableNotNeeded) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(InterceptorCallICGetter4); |
LocalContext context; |
@@ -9681,7 +9681,7 @@ THREADED_TEST(InterceptorCallICCacheableNotNeeded) { |
// Test the case when we stored cacheable lookup into |
// a stub, but it got invalidated later on |
THREADED_TEST(InterceptorCallICInvalidatedCacheable) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(NoBlockGetterX); |
LocalContext context; |
@@ -9708,7 +9708,7 @@ THREADED_TEST(InterceptorCallICInvalidatedCacheable) { |
// This test checks that if interceptor doesn't provide a function, |
// cached constant function is used |
THREADED_TEST(InterceptorCallICConstantFunctionUsed) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(NoBlockGetterX); |
LocalContext context; |
@@ -9740,7 +9740,7 @@ static v8::Handle<Value> InterceptorCallICGetter5(Local<String> name, |
// even if we cached constant function, interceptor's function |
// is invoked |
THREADED_TEST(InterceptorCallICConstantFunctionNotNeeded) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(InterceptorCallICGetter5); |
LocalContext context; |
@@ -9774,7 +9774,7 @@ static v8::Handle<Value> InterceptorCallICGetter6(Local<String> name, |
// to test the optimized compiler. |
THREADED_TEST(InterceptorCallICConstantFunctionNotNeededWrapped) { |
i::FLAG_allow_natives_syntax = true; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(InterceptorCallICGetter6); |
LocalContext context; |
@@ -9804,7 +9804,7 @@ THREADED_TEST(InterceptorCallICConstantFunctionNotNeededWrapped) { |
// Test the case when we stored constant function into |
// a stub, but it got invalidated later on |
THREADED_TEST(InterceptorCallICInvalidatedConstantFunction) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(NoBlockGetterX); |
LocalContext context; |
@@ -9834,7 +9834,7 @@ THREADED_TEST(InterceptorCallICInvalidatedConstantFunction) { |
// a stub, but it got invalidated later on due to override on |
// global object which is between interceptor and constant function' holders. |
THREADED_TEST(InterceptorCallICInvalidatedConstantFunctionViaGlobal) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(NoBlockGetterX); |
LocalContext context; |
@@ -9859,7 +9859,7 @@ THREADED_TEST(InterceptorCallICInvalidatedConstantFunctionViaGlobal) { |
// Test the case when actual function to call sits on global object. |
THREADED_TEST(InterceptorCallICCachedFromGlobal) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ_o = ObjectTemplate::New(); |
templ_o->SetNamedPropertyHandler(NoBlockGetterX); |
@@ -9943,8 +9943,8 @@ v8::Handle<v8::Value> DirectApiCallback(const v8::Arguments& args) { |
THREADED_TEST(CallICFastApi_DirectCall_GCMoveStub) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<v8::ObjectTemplate> nativeobject_templ = v8::ObjectTemplate::New(); |
nativeobject_templ->Set("callback", |
v8::FunctionTemplate::New(DirectApiCallback)); |
@@ -9967,8 +9967,8 @@ v8::Handle<v8::Value> ThrowingDirectApiCallback(const v8::Arguments& args) { |
THREADED_TEST(CallICFastApi_DirectCall_Throw) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<v8::ObjectTemplate> nativeobject_templ = v8::ObjectTemplate::New(); |
nativeobject_templ->Set("callback", |
v8::FunctionTemplate::New(ThrowingDirectApiCallback)); |
@@ -9998,8 +9998,8 @@ v8::Handle<v8::Value> DirectGetterCallback(Local<String> name, |
THREADED_TEST(LoadICFastApi_DirectCall_GCMoveStub) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<v8::ObjectTemplate> obj = v8::ObjectTemplate::New(); |
obj->SetAccessor(v8_str("p1"), DirectGetterCallback); |
context->Global()->Set(v8_str("o1"), obj->NewInstance()); |
@@ -10020,8 +10020,8 @@ v8::Handle<v8::Value> ThrowingDirectGetterCallback( |
THREADED_TEST(LoadICFastApi_DirectCall_Throw) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<v8::ObjectTemplate> obj = v8::ObjectTemplate::New(); |
obj->SetAccessor(v8_str("p1"), ThrowingDirectGetterCallback); |
context->Global()->Set(v8_str("o1"), obj->NewInstance()); |
@@ -10037,7 +10037,7 @@ THREADED_TEST(LoadICFastApi_DirectCall_Throw) { |
THREADED_TEST(InterceptorCallICFastApi_TrivialSignature) { |
int interceptor_call_count = 0; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(); |
v8::Handle<v8::FunctionTemplate> method_templ = |
v8::FunctionTemplate::New(FastApiCallback_TrivialSignature, |
@@ -10064,7 +10064,7 @@ THREADED_TEST(InterceptorCallICFastApi_TrivialSignature) { |
THREADED_TEST(InterceptorCallICFastApi_SimpleSignature) { |
int interceptor_call_count = 0; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(); |
v8::Handle<v8::FunctionTemplate> method_templ = |
v8::FunctionTemplate::New(FastApiCallback_SimpleSignature, |
@@ -10095,7 +10095,7 @@ THREADED_TEST(InterceptorCallICFastApi_SimpleSignature) { |
THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss1) { |
int interceptor_call_count = 0; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(); |
v8::Handle<v8::FunctionTemplate> method_templ = |
v8::FunctionTemplate::New(FastApiCallback_SimpleSignature, |
@@ -10132,7 +10132,7 @@ THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss1) { |
THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss2) { |
int interceptor_call_count = 0; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(); |
v8::Handle<v8::FunctionTemplate> method_templ = |
v8::FunctionTemplate::New(FastApiCallback_SimpleSignature, |
@@ -10169,7 +10169,7 @@ THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss2) { |
THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss3) { |
int interceptor_call_count = 0; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(); |
v8::Handle<v8::FunctionTemplate> method_templ = |
v8::FunctionTemplate::New(FastApiCallback_SimpleSignature, |
@@ -10209,7 +10209,7 @@ THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss3) { |
THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_TypeError) { |
int interceptor_call_count = 0; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(); |
v8::Handle<v8::FunctionTemplate> method_templ = |
v8::FunctionTemplate::New(FastApiCallback_SimpleSignature, |
@@ -10248,7 +10248,7 @@ THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_TypeError) { |
} |
THREADED_TEST(CallICFastApi_TrivialSignature) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(); |
v8::Handle<v8::FunctionTemplate> method_templ = |
v8::FunctionTemplate::New(FastApiCallback_TrivialSignature, |
@@ -10272,7 +10272,7 @@ THREADED_TEST(CallICFastApi_TrivialSignature) { |
} |
THREADED_TEST(CallICFastApi_SimpleSignature) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(); |
v8::Handle<v8::FunctionTemplate> method_templ = |
v8::FunctionTemplate::New(FastApiCallback_SimpleSignature, |
@@ -10300,7 +10300,7 @@ THREADED_TEST(CallICFastApi_SimpleSignature) { |
} |
THREADED_TEST(CallICFastApi_SimpleSignature_Miss1) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(); |
v8::Handle<v8::FunctionTemplate> method_templ = |
v8::FunctionTemplate::New(FastApiCallback_SimpleSignature, |
@@ -10333,7 +10333,7 @@ THREADED_TEST(CallICFastApi_SimpleSignature_Miss1) { |
} |
THREADED_TEST(CallICFastApi_SimpleSignature_Miss2) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(); |
v8::Handle<v8::FunctionTemplate> method_templ = |
v8::FunctionTemplate::New(FastApiCallback_SimpleSignature, |
@@ -10369,7 +10369,7 @@ THREADED_TEST(CallICFastApi_SimpleSignature_Miss2) { |
} |
THREADED_TEST(CallICFastApi_SimpleSignature_TypeError) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(); |
v8::Handle<v8::FunctionTemplate> method_templ = |
v8::FunctionTemplate::New(FastApiCallback_SimpleSignature, |
@@ -10420,7 +10420,7 @@ static v8::Handle<Value> InterceptorKeyedCallICGetter( |
// Test the case when we stored cacheable lookup into |
// a stub, but the function name changed (to another cacheable function). |
THREADED_TEST(InterceptorKeyedCallICKeyChange1) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(NoBlockGetterX); |
LocalContext context; |
@@ -10444,7 +10444,7 @@ THREADED_TEST(InterceptorKeyedCallICKeyChange1) { |
// a stub, but the function name changed (and the new function is present |
// both before and after the interceptor in the prototype chain). |
THREADED_TEST(InterceptorKeyedCallICKeyChange2) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(InterceptorKeyedCallICGetter); |
LocalContext context; |
@@ -10471,7 +10471,7 @@ THREADED_TEST(InterceptorKeyedCallICKeyChange2) { |
// Same as InterceptorKeyedCallICKeyChange1 only the cacheable function sit |
// on the global object. |
THREADED_TEST(InterceptorKeyedCallICKeyChangeOnGlobal) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(NoBlockGetterX); |
LocalContext context; |
@@ -10496,7 +10496,7 @@ THREADED_TEST(InterceptorKeyedCallICKeyChangeOnGlobal) { |
// Test the case when actual function to call sits on global object. |
THREADED_TEST(InterceptorKeyedCallICFromGlobal) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ_o = ObjectTemplate::New(); |
templ_o->SetNamedPropertyHandler(NoBlockGetterX); |
LocalContext context; |
@@ -10520,7 +10520,7 @@ THREADED_TEST(InterceptorKeyedCallICFromGlobal) { |
// Test the map transition before the interceptor. |
THREADED_TEST(InterceptorKeyedCallICMapChangeBefore) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ_o = ObjectTemplate::New(); |
templ_o->SetNamedPropertyHandler(NoBlockGetterX); |
LocalContext context; |
@@ -10542,7 +10542,7 @@ THREADED_TEST(InterceptorKeyedCallICMapChangeBefore) { |
// Test the map transition after the interceptor. |
THREADED_TEST(InterceptorKeyedCallICMapChangeAfter) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ_o = ObjectTemplate::New(); |
templ_o->SetNamedPropertyHandler(NoBlockGetterX); |
LocalContext context; |
@@ -10578,7 +10578,7 @@ static v8::Handle<Value> InterceptorICRefErrorGetter(Local<String> name, |
// Once in a while, the interceptor will reply that a property was not |
// found in which case we should get a reference error. |
THREADED_TEST(InterceptorICReferenceErrors) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(InterceptorICRefErrorGetter); |
LocalContext context(0, templ, v8::Handle<Value>()); |
@@ -10625,7 +10625,7 @@ static v8::Handle<Value> InterceptorICExceptionGetter( |
// exception once in a while. |
THREADED_TEST(InterceptorICGetterExceptions) { |
interceptor_ic_exception_get_count = 0; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(InterceptorICExceptionGetter); |
LocalContext context(0, templ, v8::Handle<Value>()); |
@@ -10668,7 +10668,7 @@ static v8::Handle<Value> InterceptorICExceptionSetter( |
// once in a while. |
THREADED_TEST(InterceptorICSetterExceptions) { |
interceptor_ic_exception_set_count = 0; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(0, InterceptorICExceptionSetter); |
LocalContext context(0, templ, v8::Handle<Value>()); |
@@ -10686,7 +10686,7 @@ THREADED_TEST(InterceptorICSetterExceptions) { |
// Test that we ignore null interceptors. |
THREADED_TEST(NullNamedInterceptor) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(0); |
LocalContext context; |
@@ -10701,7 +10701,7 @@ THREADED_TEST(NullNamedInterceptor) { |
// Test that we ignore null interceptors. |
THREADED_TEST(NullIndexedInterceptor) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(0); |
LocalContext context; |
@@ -10715,7 +10715,7 @@ THREADED_TEST(NullIndexedInterceptor) { |
THREADED_TEST(NamedPropertyHandlerGetterAttributes) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(); |
templ->InstanceTemplate()->SetNamedPropertyHandler(InterceptorLoadXICGetter); |
LocalContext env; |
@@ -10735,8 +10735,8 @@ static Handle<Value> ThrowingGetter(Local<String> name, |
THREADED_TEST(VariousGetPropertiesAndThrowingCallbacks) { |
- HandleScope scope; |
LocalContext context; |
+ HandleScope scope(context->GetIsolate()); |
Local<FunctionTemplate> templ = FunctionTemplate::New(); |
Local<ObjectTemplate> instance_templ = templ->InstanceTemplate(); |
@@ -10826,8 +10826,8 @@ static void WebKitLike(Handle<Message> message, Handle<Value> data) { |
} |
THREADED_TEST(ExceptionsDoNotPropagatePastTryCatch) { |
- HandleScope scope; |
LocalContext context; |
+ HandleScope scope(context->GetIsolate()); |
Local<Function> func = |
FunctionTemplate::New(ThrowingCallbackWithTryCatch)->GetFunction(); |
@@ -10870,8 +10870,8 @@ static v8::Handle<Value> ChildGetter(Local<String> name, |
THREADED_TEST(Overriding) { |
i::FLAG_es5_readonly = true; |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
// Parent template. |
Local<v8::FunctionTemplate> parent_templ = v8::FunctionTemplate::New(); |
@@ -10933,7 +10933,7 @@ static v8::Handle<Value> IsConstructHandler(const v8::Arguments& args) { |
THREADED_TEST(IsConstructCall) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
// Function template with call handler. |
Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(); |
@@ -10950,7 +10950,7 @@ THREADED_TEST(IsConstructCall) { |
THREADED_TEST(ObjectProtoToString) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(); |
templ->SetClassName(v8_str("MyClass")); |
@@ -10984,8 +10984,8 @@ THREADED_TEST(ObjectProtoToString) { |
THREADED_TEST(ObjectGetConstructorName) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8_compile("function Parent() {};" |
"function Child() {};" |
"Child.prototype = new Parent();" |
@@ -11176,7 +11176,7 @@ static v8::Handle<Value> ThrowInJS(const v8::Arguments& args) { |
const char* code = "throw 7;"; |
{ |
v8::Locker nested_locker(CcTest::default_isolate()); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(args.GetIsolate()); |
v8::Handle<Value> exception; |
{ v8::TryCatch try_catch; |
v8::Handle<Value> value = CompileRun(code); |
@@ -11199,7 +11199,7 @@ static v8::Handle<Value> ThrowInJSNoCatch(const v8::Arguments& args) { |
const char* code = "throw 7;"; |
{ |
v8::Locker nested_locker(CcTest::default_isolate()); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(args.GetIsolate()); |
v8::Handle<Value> value = CompileRun(code); |
CHECK(value.IsEmpty()); |
return v8_str("foo"); |
@@ -11212,8 +11212,8 @@ static v8::Handle<Value> ThrowInJSNoCatch(const v8::Arguments& args) { |
TEST(NestedLockers) { |
v8::Locker locker(CcTest::default_isolate()); |
CHECK(v8::Locker::IsLocked(CcTest::default_isolate())); |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(ThrowInJS); |
Local<Function> fun = fun_templ->GetFunction(); |
env->Global()->Set(v8_str("throw_in_js"), fun); |
@@ -11233,8 +11233,8 @@ TEST(NestedLockers) { |
// as part of the locking aggregation tests. |
TEST(NestedLockersNoTryCatch) { |
v8::Locker locker(CcTest::default_isolate()); |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<v8::FunctionTemplate> fun_templ = |
v8::FunctionTemplate::New(ThrowInJSNoCatch); |
Local<Function> fun = fun_templ->GetFunction(); |
@@ -11270,7 +11270,7 @@ static v8::Handle<Value> UnlockForAMoment(const v8::Arguments& args) { |
THREADED_TEST(LockUnlockLock) { |
{ |
v8::Locker locker(CcTest::default_isolate()); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(CcTest::default_isolate()); |
LocalContext env; |
Local<v8::FunctionTemplate> fun_templ = |
v8::FunctionTemplate::New(UnlockForAMoment); |
@@ -11284,7 +11284,7 @@ THREADED_TEST(LockUnlockLock) { |
} |
{ |
v8::Locker locker(CcTest::default_isolate()); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(CcTest::default_isolate()); |
LocalContext env; |
Local<v8::FunctionTemplate> fun_templ = |
v8::FunctionTemplate::New(UnlockForAMoment); |
@@ -11331,27 +11331,27 @@ TEST(DontLeakGlobalObjects) { |
v8::V8::Initialize(); |
for (int i = 0; i < 5; i++) { |
- { v8::HandleScope scope; |
+ { v8::HandleScope scope(v8::Isolate::GetCurrent()); |
LocalContext context; |
} |
v8::V8::ContextDisposedNotification(); |
CheckSurvivingGlobalObjectsCount(0); |
- { v8::HandleScope scope; |
+ { v8::HandleScope scope(v8::Isolate::GetCurrent()); |
LocalContext context; |
v8_compile("Date")->Run(); |
} |
v8::V8::ContextDisposedNotification(); |
CheckSurvivingGlobalObjectsCount(0); |
- { v8::HandleScope scope; |
+ { v8::HandleScope scope(v8::Isolate::GetCurrent()); |
LocalContext context; |
v8_compile("/aaa/")->Run(); |
} |
v8::V8::ContextDisposedNotification(); |
CheckSurvivingGlobalObjectsCount(0); |
- { v8::HandleScope scope; |
+ { v8::HandleScope scope(v8::Isolate::GetCurrent()); |
const char* extension_list[] = { "v8/gc" }; |
v8::ExtensionConfiguration extensions(1, extension_list); |
LocalContext context(&extensions); |
@@ -11369,7 +11369,7 @@ v8::Persistent<v8::Object> bad_handle; |
void NewPersistentHandleCallback(v8::Isolate* isolate, |
v8::Persistent<v8::Value> handle, |
void*) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(isolate); |
bad_handle = v8::Persistent<v8::Object>::New(isolate, some_object); |
handle.Dispose(isolate); |
} |
@@ -11381,7 +11381,7 @@ THREADED_TEST(NewPersistentHandleFromWeakCallback) { |
v8::Persistent<v8::Object> handle1, handle2; |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(isolate); |
some_object = v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
handle1 = v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
handle2 = v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
@@ -11413,7 +11413,7 @@ THREADED_TEST(DoNotUseDeletedNodesInSecondLevelGc) { |
v8::Persistent<v8::Object> handle1, handle2; |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(isolate); |
handle1 = v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
handle2 = v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
} |
@@ -11431,7 +11431,7 @@ void DisposingCallback(v8::Isolate* isolate, |
void HandleCreatingCallback(v8::Isolate* isolate, |
v8::Persistent<v8::Value> handle, |
void*) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(isolate); |
v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
handle.Dispose(isolate); |
} |
@@ -11443,7 +11443,7 @@ THREADED_TEST(NoGlobalHandlesOrphaningDueToWeakCallback) { |
v8::Persistent<v8::Object> handle1, handle2, handle3; |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(isolate); |
handle3 = v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
handle2 = v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
handle1 = v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
@@ -11465,11 +11465,11 @@ THREADED_TEST(CheckForCrossContextObjectLiterals) { |
for (int i = 0; i < nof; i++) { |
const char* source = sources[i]; |
- { v8::HandleScope scope; |
+ { v8::HandleScope scope(v8::Isolate::GetCurrent()); |
LocalContext context; |
CompileRun(source); |
} |
- { v8::HandleScope scope; |
+ { v8::HandleScope scope(v8::Isolate::GetCurrent()); |
LocalContext context; |
CompileRun(source); |
} |
@@ -11478,7 +11478,7 @@ THREADED_TEST(CheckForCrossContextObjectLiterals) { |
static v8::Handle<Value> NestedScope(v8::Persistent<Context> env) { |
- v8::HandleScope inner; |
+ v8::HandleScope inner(env->GetIsolate()); |
env->Enter(); |
v8::Handle<Value> three = v8_num(3); |
v8::Handle<Value> value = inner.Close(three); |
@@ -11488,7 +11488,7 @@ static v8::Handle<Value> NestedScope(v8::Persistent<Context> env) { |
THREADED_TEST(NestedHandleScopeAndContexts) { |
- v8::HandleScope outer; |
+ v8::HandleScope outer(v8::Isolate::GetCurrent()); |
v8::Persistent<Context> env = Context::New(); |
env->Enter(); |
v8::Handle<Value> value = NestedScope(env); |
@@ -11527,7 +11527,7 @@ static void RunLoopInNewEnv() { |
bar_ptr = NULL; |
foo_ptr = NULL; |
- v8::HandleScope outer; |
+ v8::HandleScope outer(v8::Isolate::GetCurrent()); |
v8::Persistent<Context> env = Context::New(); |
env->Enter(); |
@@ -11767,7 +11767,7 @@ TEST(SetJitCodeEventHandler) { |
isolate->Enter(); |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(isolate); |
i::HashMap code(MatchPointers); |
code_map = &code; |
@@ -11820,7 +11820,7 @@ TEST(SetJitCodeEventHandler) { |
// Verify that we get callbacks for existing code objects when we |
// request enumeration of existing code. |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(isolate); |
LocalContext env; |
CompileRun(script); |
@@ -11853,7 +11853,7 @@ static int64_t cast(intptr_t x) { return static_cast<int64_t>(x); } |
THREADED_TEST(ExternalAllocatedMemory) { |
- v8::HandleScope outer; |
+ v8::HandleScope outer(v8::Isolate::GetCurrent()); |
v8::Persistent<Context> env(Context::New()); |
CHECK(!env.IsEmpty()); |
const intptr_t kSize = 1024*1024; |
@@ -11866,8 +11866,8 @@ THREADED_TEST(ExternalAllocatedMemory) { |
THREADED_TEST(DisposeEnteredContext) { |
- v8::HandleScope scope; |
LocalContext outer; |
+ v8::HandleScope scope(outer->GetIsolate()); |
{ v8::Persistent<v8::Context> inner = v8::Context::New(); |
inner->Enter(); |
inner.Dispose(inner->GetIsolate()); |
@@ -11881,12 +11881,12 @@ THREADED_TEST(DisposeEnteredContext) { |
// but no accessors or interceptors did not get their internal field |
// count set on instances. |
THREADED_TEST(Regress54) { |
- v8::HandleScope outer; |
LocalContext context; |
v8::Isolate* isolate = context->GetIsolate(); |
+ v8::HandleScope outer(isolate); |
static v8::Persistent<v8::ObjectTemplate> templ; |
if (templ.IsEmpty()) { |
- v8::HandleScope inner; |
+ v8::HandleScope inner(isolate); |
v8::Handle<v8::ObjectTemplate> local = v8::ObjectTemplate::New(); |
local->SetInternalFieldCount(1); |
templ = |
@@ -11900,8 +11900,8 @@ THREADED_TEST(Regress54) { |
// If part of the threaded tests, this test makes ThreadingTest fail |
// on mac. |
TEST(CatchStackOverflow) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::TryCatch try_catch; |
v8::Handle<v8::Script> script = v8::Script::Compile(v8::String::New( |
"function f() {" |
@@ -11917,7 +11917,7 @@ TEST(CatchStackOverflow) { |
static void CheckTryCatchSourceInfo(v8::Handle<v8::Script> script, |
const char* resource_name, |
int line_offset) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::TryCatch try_catch; |
v8::Handle<v8::Value> result = script->Run(); |
CHECK(result.IsEmpty()); |
@@ -11937,8 +11937,8 @@ static void CheckTryCatchSourceInfo(v8::Handle<v8::Script> script, |
THREADED_TEST(TryCatchSourceInfo) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<v8::String> source = v8::String::New( |
"function Foo() {\n" |
" return Bar();\n" |
@@ -11973,8 +11973,8 @@ THREADED_TEST(TryCatchSourceInfo) { |
THREADED_TEST(CompilationCache) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<v8::String> source0 = v8::String::New("1234"); |
v8::Handle<v8::String> source1 = v8::String::New("1234"); |
v8::Handle<v8::Script> script0 = |
@@ -11996,8 +11996,8 @@ static v8::Handle<Value> FunctionNameCallback(const v8::Arguments& args) { |
THREADED_TEST(CallbackFunctionName) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<ObjectTemplate> t = ObjectTemplate::New(); |
t->Set(v8_str("asdf"), v8::FunctionTemplate::New(FunctionNameCallback)); |
context->Global()->Set(v8_str("obj"), t->NewInstance()); |
@@ -12009,8 +12009,8 @@ THREADED_TEST(CallbackFunctionName) { |
THREADED_TEST(DateAccess) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<v8::Value> date = v8::Date::New(1224744689038.0); |
CHECK(date->IsDate()); |
CHECK_EQ(1224744689038.0, date.As<v8::Date>()->NumberValue()); |
@@ -12042,8 +12042,8 @@ void CheckOwnProperties(v8::Handle<v8::Value> val, |
THREADED_TEST(PropertyEnumeration) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<v8::Value> obj = v8::Script::Compile(v8::String::New( |
"var result = [];" |
"result[0] = {};" |
@@ -12076,8 +12076,8 @@ THREADED_TEST(PropertyEnumeration) { |
} |
THREADED_TEST(PropertyEnumeration2) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<v8::Value> obj = v8::Script::Compile(v8::String::New( |
"var result = [];" |
"result[0] = {};" |
@@ -12118,8 +12118,8 @@ static bool IndexedSetAccessBlocker(Local<v8::Object> obj, |
THREADED_TEST(DisableAccessChecksWhileConfiguring) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetAccessCheckCallbacks(NamedSetAccessBlocker, |
IndexedSetAccessBlocker); |
@@ -12149,8 +12149,8 @@ static bool IndexedGetAccessBlocker(Local<v8::Object> obj, |
THREADED_TEST(AccessChecksReenabledCorrectly) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetAccessCheckCallbacks(NamedGetAccessBlocker, |
IndexedGetAccessBlocker); |
@@ -12188,7 +12188,7 @@ THREADED_TEST(AccessChecksReenabledCorrectly) { |
// This tests that access check information remains on the global |
// object template when creating contexts. |
THREADED_TEST(AccessControlRepeatedContextCreation) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(); |
global_template->SetAccessCheckCallbacks(NamedSetAccessBlocker, |
IndexedSetAccessBlocker); |
@@ -12205,7 +12205,7 @@ THREADED_TEST(AccessControlRepeatedContextCreation) { |
THREADED_TEST(TurnOnAccessCheck) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
// Create an environment with access check to the global object disabled by |
// default. |
@@ -12285,7 +12285,7 @@ static bool NamedGetAccessBlockAandH(Local<v8::Object> obj, |
THREADED_TEST(TurnOnAccessCheckAndRecompile) { |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
// Create an environment with access check to the global object disabled by |
// default. When the registered access checker will block access to properties |
@@ -12449,8 +12449,8 @@ TEST(PreCompileDeserializationError) { |
// Attempts to deserialize bad data. |
TEST(PreCompileInvalidPreparseDataError) { |
v8::V8::Initialize(); |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
const char* script = "function foo(){ return 5;}\n" |
"function bar(){ return 6 + 7;} foo();"; |
@@ -12496,7 +12496,7 @@ TEST(PreCompileInvalidPreparseDataError) { |
// the same results (at least for one trivial case). |
TEST(PreCompileAPIVariationsAreSame) { |
v8::V8::Initialize(); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
const char* cstring = "function foo(a) { return a+1; }"; |
@@ -12533,7 +12533,7 @@ TEST(PreCompileAPIVariationsAreSame) { |
// arise because we share code between contexts via the compilation |
// cache. |
THREADED_TEST(DictionaryICLoadedFunction) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
// Test LoadIC. |
for (int i = 0; i < 2; i++) { |
LocalContext context; |
@@ -12554,7 +12554,7 @@ THREADED_TEST(DictionaryICLoadedFunction) { |
// Test that cross-context new calls use the context of the callee to |
// create the new JavaScript object. |
THREADED_TEST(CrossContextNew) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Persistent<Context> context0 = Context::New(); |
v8::Persistent<Context> context1 = Context::New(); |
@@ -12689,7 +12689,7 @@ class RegExpInterruptTest { |
TEST(RegExpInterruption) { |
v8::Locker lock(CcTest::default_isolate()); |
v8::V8::Initialize(); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(CcTest::default_isolate()); |
Local<Context> local_env; |
{ |
LocalContext env; |
@@ -12798,7 +12798,7 @@ class ApplyInterruptTest { |
TEST(ApplyInterruption) { |
v8::Locker lock(CcTest::default_isolate()); |
v8::V8::Initialize(); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(CcTest::default_isolate()); |
Local<Context> local_env; |
{ |
LocalContext env; |
@@ -12818,8 +12818,8 @@ TEST(ApplyInterruption) { |
// Verify that we can clone an object |
TEST(ObjectClone) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
const char* sample = |
"var rv = {};" \ |
@@ -12906,8 +12906,8 @@ THREADED_TEST(MorphCompositeStringTest) { |
" to come to the aid of the party"; |
uint16_t* two_byte_string = AsciiToTwoByteString(c_string); |
{ |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
AsciiVectorResource ascii_resource( |
i::Vector<const char>(c_string, i::StrLength(c_string))); |
UC16VectorResource uc16_resource( |
@@ -12969,8 +12969,8 @@ THREADED_TEST(MorphCompositeStringTest) { |
TEST(CompileExternalTwoByteSource) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
// This is a very short list of sources, which currently is to check for a |
// regression caused by r2703. |
@@ -13078,7 +13078,7 @@ class RegExpStringModificationTest { |
morphs_ < kMaxModifications) { |
int morphs_before = morphs_; |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
// Match 15-30 "a"'s against 14 and a "b". |
const char* c_source = |
"/a?a?a?a?a?a?a?a?a?a?a?a?a?a?aaaaaaaaaaaaaaaa/" |
@@ -13111,7 +13111,7 @@ class RegExpStringModificationTest { |
TEST(RegExpStringModification) { |
v8::Locker lock(CcTest::default_isolate()); |
v8::V8::Initialize(); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(CcTest::default_isolate()); |
Local<Context> local_env; |
{ |
LocalContext env; |
@@ -13133,7 +13133,7 @@ TEST(RegExpStringModification) { |
// is a read-only property in the prototype chain. |
TEST(ReadOnlyPropertyInGlobalProto) { |
i::FLAG_es5_readonly = true; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(); |
LocalContext context(0, templ); |
v8::Handle<v8::Object> global = context->Global(); |
@@ -13186,7 +13186,7 @@ TEST(ForceSet) { |
force_set_set_count = 0; |
pass_on_get = false; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(); |
v8::Handle<v8::String> access_property = v8::String::New("a"); |
templ->SetAccessor(access_property, ForceSetGetter, ForceSetSetter); |
@@ -13227,7 +13227,7 @@ TEST(ForceSetWithInterceptor) { |
force_set_set_count = 0; |
pass_on_get = false; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(ForceSetGetter, ForceSetInterceptSetter); |
LocalContext context(NULL, templ); |
@@ -13270,7 +13270,7 @@ TEST(ForceSetWithInterceptor) { |
THREADED_TEST(ForceDelete) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(); |
LocalContext context(NULL, templ); |
v8::Handle<v8::Object> global = context->Global(); |
@@ -13308,7 +13308,7 @@ THREADED_TEST(ForceDeleteWithInterceptor) { |
force_delete_interceptor_count = 0; |
pass_on_delete = false; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(0, 0, 0, ForceDeleteDeleter); |
LocalContext context(NULL, templ); |
@@ -13340,8 +13340,8 @@ THREADED_TEST(ForceDeleteWithInterceptor) { |
// Make sure that forcing a delete invalidates any IC stubs, so we |
// don't read the hole value. |
THREADED_TEST(ForceDeleteIC) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
// Create a DontDelete variable on the global object. |
CompileRun("this.__proto__ = { foo: 'horse' };" |
"var foo = 'fish';" |
@@ -13361,13 +13361,13 @@ THREADED_TEST(ForceDeleteIC) { |
TEST(InlinedFunctionAcrossContexts) { |
i::FLAG_allow_natives_syntax = true; |
- v8::HandleScope outer_scope; |
+ v8::HandleScope outer_scope(v8::Isolate::GetCurrent()); |
v8::Persistent<v8::Context> ctx1 = v8::Context::New(); |
v8::Persistent<v8::Context> ctx2 = v8::Context::New(); |
ctx1->Enter(); |
{ |
- v8::HandleScope inner_scope; |
+ v8::HandleScope inner_scope(v8::Isolate::GetCurrent()); |
CompileRun("var G = 42; function foo() { return G; }"); |
v8::Local<v8::Value> foo = ctx1->Global()->Get(v8_str("foo")); |
ctx2->Enter(); |
@@ -13417,7 +13417,7 @@ static v8::Handle<Value> GetCallingContextCallback(const v8::Arguments& args) { |
THREADED_TEST(GetCallingContext) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
calling_context0 = Context::New(); |
calling_context1 = Context::New(); |
@@ -13467,8 +13467,8 @@ THREADED_TEST(GetCallingContext) { |
// value does shadow an existing property in the prototype chain. |
THREADED_TEST(InitGlobalVarInProtoChain) { |
i::FLAG_es52_globals = true; |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
// Introduce a variable in the prototype chain. |
CompileRun("__proto__.x = 42"); |
v8::Handle<v8::Value> result = CompileRun("var x = 43; x"); |
@@ -13483,8 +13483,8 @@ THREADED_TEST(InitGlobalVarInProtoChain) { |
// original should not affect the clone. |
// See http://code.google.com/p/v8/issues/detail?id=398 |
THREADED_TEST(ReplaceConstantFunction) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<v8::Object> obj = v8::Object::New(); |
v8::Handle<v8::FunctionTemplate> func_templ = v8::FunctionTemplate::New(); |
v8::Handle<v8::String> foo_string = v8::String::New("foo"); |
@@ -13497,8 +13497,8 @@ THREADED_TEST(ReplaceConstantFunction) { |
// Regression test for http://crbug.com/16276. |
THREADED_TEST(Regress16276) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
// Force the IC in f to be a dictionary load IC. |
CompileRun("function f(obj) { return obj.x; }\n" |
"var obj = { x: { foo: 42 }, y: 87 };\n" |
@@ -13514,8 +13514,8 @@ THREADED_TEST(Regress16276) { |
THREADED_TEST(PixelArray) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
const int kElementCount = 260; |
uint8_t* pixel_data = reinterpret_cast<uint8_t*>(malloc(kElementCount)); |
i::Handle<i::ExternalPixelArray> pixels = |
@@ -13904,8 +13904,8 @@ THREADED_TEST(PixelArray) { |
THREADED_TEST(PixelArrayInfo) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
for (int size = 0; size < 100; size += 10) { |
uint8_t* pixel_data = reinterpret_cast<uint8_t*>(malloc(size)); |
v8::Handle<v8::Object> obj = v8::Object::New(); |
@@ -13936,8 +13936,8 @@ static v8::Handle<Value> NotHandledIndexedPropertySetter( |
THREADED_TEST(PixelArrayWithInterceptor) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
const int kElementCount = 260; |
uint8_t* pixel_data = reinterpret_cast<uint8_t*>(malloc(kElementCount)); |
i::Handle<i::ExternalPixelArray> pixels = |
@@ -14000,8 +14000,8 @@ template <class ExternalArrayClass, class ElementType> |
static void ExternalArrayTestHelper(v8::ExternalArrayType array_type, |
int64_t low, |
int64_t high) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
const int kElementCount = 40; |
int element_size = ExternalArrayElementSize(array_type); |
ElementType* array_data = |
@@ -14571,8 +14571,8 @@ THREADED_TEST(ExternalArrays) { |
void ExternalArrayInfoTestHelper(v8::ExternalArrayType array_type) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
for (int size = 0; size < 100; size += 10) { |
int element_size = ExternalArrayElementSize(array_type); |
void* external_data = malloc(size * element_size); |
@@ -14613,8 +14613,8 @@ void ExternalArrayLimitTestHelper(v8::ExternalArrayType array_type, int size) { |
TEST(ExternalArrayLimits) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
ExternalArrayLimitTestHelper(v8::kExternalByteArray, 0x40000000); |
ExternalArrayLimitTestHelper(v8::kExternalByteArray, 0xffffffff); |
ExternalArrayLimitTestHelper(v8::kExternalUnsignedByteArray, 0x40000000); |
@@ -14637,8 +14637,8 @@ TEST(ExternalArrayLimits) { |
THREADED_TEST(ScriptContextDependence) { |
- v8::HandleScope scope; |
LocalContext c1; |
+ v8::HandleScope scope(c1->GetIsolate()); |
const char *source = "foo"; |
v8::Handle<v8::Script> dep = v8::Script::Compile(v8::String::New(source)); |
v8::Handle<v8::Script> indep = v8::Script::New(v8::String::New(source)); |
@@ -14653,8 +14653,8 @@ THREADED_TEST(ScriptContextDependence) { |
THREADED_TEST(StackTrace) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::TryCatch try_catch; |
const char *source = "function foo() { FAIL.FAIL; }; foo();"; |
v8::Handle<v8::String> src = v8::String::New(source); |
@@ -14671,7 +14671,7 @@ void checkStackFrame(const char* expected_script_name, |
const char* expected_func_name, int expected_line_number, |
int expected_column, bool is_eval, bool is_constructor, |
v8::Handle<v8::StackFrame> frame) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::String::Utf8Value func_name(frame->GetFunctionName()); |
v8::String::Utf8Value script_name(frame->GetScriptName()); |
if (*script_name == NULL) { |
@@ -14689,7 +14689,7 @@ void checkStackFrame(const char* expected_script_name, |
v8::Handle<Value> AnalyzeStackInNativeCode(const v8::Arguments& args) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(args.GetIsolate()); |
const char* origin = "capture-stack-trace-test"; |
const int kOverviewTest = 1; |
const int kDetailedTest = 2; |
@@ -14744,7 +14744,7 @@ v8::Handle<Value> AnalyzeStackInNativeCode(const v8::Arguments& args) { |
// TODO(3074796): Reenable this as a THREADED_TEST once it passes. |
// THREADED_TEST(CaptureStackTrace) { |
TEST(CaptureStackTrace) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Handle<v8::String> origin = v8::String::New("capture-stack-trace-test"); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("AnalyzeStackInNativeCode"), |
@@ -14803,8 +14803,8 @@ static void StackTraceForUncaughtExceptionListener( |
TEST(CaptureStackTraceForUncaughtException) { |
report_count = 0; |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::V8::AddMessageListener(StackTraceForUncaughtExceptionListener); |
v8::V8::SetCaptureStackTraceForUncaughtExceptions(true); |
@@ -14825,8 +14825,8 @@ TEST(CaptureStackTraceForUncaughtException) { |
TEST(CaptureStackTraceForUncaughtExceptionAndSetters) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::V8::SetCaptureStackTraceForUncaughtExceptions(true, |
1024, |
v8::StackTrace::kDetailed); |
@@ -14861,8 +14861,8 @@ static void RethrowStackTraceHandler(v8::Handle<v8::Message> message, |
// Test that we only return the stack trace at the site where the exception |
// is first thrown (not where it is rethrown). |
TEST(RethrowStackTrace) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
// We make sure that |
// - the stack trace of the ReferenceError in g() is reported. |
// - the stack trace is not overwritten when e1 is rethrown by t(). |
@@ -14903,8 +14903,8 @@ static void RethrowPrimitiveStackTraceHandler(v8::Handle<v8::Message> message, |
// Test that we do not recognize identity for primitive exceptions. |
TEST(RethrowPrimitiveStackTrace) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
// We do not capture stack trace for non Error objects on creation time. |
// Instead, we capture the stack trace on last throw. |
const char* source = |
@@ -14937,8 +14937,8 @@ static void RethrowExistingStackTraceHandler(v8::Handle<v8::Message> message, |
// Test that the stack trace is captured when the error object is created and |
// not where it is thrown. |
TEST(RethrowExistingStackTrace) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
const char* source = |
"var e = new Error(); \n" |
"throw e; \n"; |
@@ -14962,8 +14962,8 @@ static void RethrowBogusErrorStackTraceHandler(v8::Handle<v8::Message> message, |
// Test that the stack trace is captured where the bogus Error object is thrown. |
TEST(RethrowBogusErrorStackTrace) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
const char* source = |
"var e = {__proto__: new Error()} \n" |
"throw e; \n"; |
@@ -14976,7 +14976,7 @@ TEST(RethrowBogusErrorStackTrace) { |
v8::Handle<Value> AnalyzeStackOfEvalWithSourceURL(const v8::Arguments& args) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(args.GetIsolate()); |
v8::Handle<v8::StackTrace> stackTrace = |
v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed); |
CHECK_EQ(5, stackTrace->GetFrameCount()); |
@@ -14992,7 +14992,7 @@ v8::Handle<Value> AnalyzeStackOfEvalWithSourceURL(const v8::Arguments& args) { |
TEST(SourceURLInStackTrace) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("AnalyzeStackOfEvalWithSourceURL"), |
v8::FunctionTemplate::New(AnalyzeStackOfEvalWithSourceURL)); |
@@ -15016,7 +15016,7 @@ TEST(SourceURLInStackTrace) { |
v8::Handle<Value> AnalyzeStackOfInlineScriptWithSourceURL( |
const v8::Arguments& args) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(args.GetIsolate()); |
v8::Handle<v8::StackTrace> stackTrace = |
v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed); |
CHECK_EQ(4, stackTrace->GetFrameCount()); |
@@ -15032,7 +15032,7 @@ v8::Handle<Value> AnalyzeStackOfInlineScriptWithSourceURL( |
TEST(InlineScriptWithSourceURLInStackTrace) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("AnalyzeStackOfInlineScriptWithSourceURL"), |
v8::FunctionTemplate::New( |
@@ -15058,7 +15058,7 @@ TEST(InlineScriptWithSourceURLInStackTrace) { |
v8::Handle<Value> AnalyzeStackOfDynamicScriptWithSourceURL( |
const v8::Arguments& args) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(args.GetIsolate()); |
v8::Handle<v8::StackTrace> stackTrace = |
v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed); |
CHECK_EQ(4, stackTrace->GetFrameCount()); |
@@ -15074,7 +15074,7 @@ v8::Handle<Value> AnalyzeStackOfDynamicScriptWithSourceURL( |
TEST(DynamicWithSourceURLInStackTrace) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->Set(v8_str("AnalyzeStackOfDynamicScriptWithSourceURL"), |
v8::FunctionTemplate::New( |
@@ -15098,7 +15098,7 @@ TEST(DynamicWithSourceURLInStackTrace) { |
} |
static void CreateGarbageInOldSpace() { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
i::AlwaysAllocateScope always_allocate; |
for (int i = 0; i < 1000; i++) { |
FACTORY->NewFixedArray(1000, i::TENURED); |
@@ -15108,8 +15108,8 @@ static void CreateGarbageInOldSpace() { |
// Test that idle notification can be handled and eventually returns true. |
TEST(IdleNotification) { |
const intptr_t MB = 1024 * 1024; |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
intptr_t initial_size = HEAP->SizeOfObjects(); |
CreateGarbageInOldSpace(); |
intptr_t size_with_garbage = HEAP->SizeOfObjects(); |
@@ -15128,8 +15128,8 @@ TEST(IdleNotification) { |
TEST(IdleNotificationWithSmallHint) { |
const intptr_t MB = 1024 * 1024; |
const int IdlePauseInMs = 900; |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
intptr_t initial_size = HEAP->SizeOfObjects(); |
CreateGarbageInOldSpace(); |
intptr_t size_with_garbage = HEAP->SizeOfObjects(); |
@@ -15148,8 +15148,8 @@ TEST(IdleNotificationWithSmallHint) { |
TEST(IdleNotificationWithLargeHint) { |
const intptr_t MB = 1024 * 1024; |
const int IdlePauseInMs = 900; |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
intptr_t initial_size = HEAP->SizeOfObjects(); |
CreateGarbageInOldSpace(); |
intptr_t size_with_garbage = HEAP->SizeOfObjects(); |
@@ -15168,8 +15168,8 @@ TEST(Regress2107) { |
const intptr_t MB = 1024 * 1024; |
const int kShortIdlePauseInMs = 100; |
const int kLongIdlePauseInMs = 1000; |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
intptr_t initial_size = HEAP->SizeOfObjects(); |
// Send idle notification to start a round of incremental GCs. |
v8::V8::IdleNotification(kShortIdlePauseInMs); |
@@ -15228,8 +15228,8 @@ TEST(SetResourceConstraints) { |
CHECK(v8::SetResourceConstraints(&constraints)); |
// Execute a script. |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
Local<v8::FunctionTemplate> fun_templ = |
v8::FunctionTemplate::New(GetStackLimitCallback); |
Local<Function> fun = fun_templ->GetFunction(); |
@@ -15253,7 +15253,7 @@ TEST(SetResourceConstraintsInThread) { |
CHECK(v8::SetResourceConstraints(&constraints)); |
// Execute a script. |
- v8::HandleScope scope; |
+ v8::HandleScope scope(CcTest::default_isolate()); |
LocalContext env; |
Local<v8::FunctionTemplate> fun_templ = |
v8::FunctionTemplate::New(GetStackLimitCallback); |
@@ -15271,8 +15271,8 @@ TEST(SetResourceConstraintsInThread) { |
THREADED_TEST(GetHeapStatistics) { |
- v8::HandleScope scope; |
LocalContext c1; |
+ v8::HandleScope scope(c1->GetIsolate()); |
v8::HeapStatistics heap_statistics; |
CHECK_EQ(static_cast<int>(heap_statistics.total_heap_size()), 0); |
CHECK_EQ(static_cast<int>(heap_statistics.used_heap_size()), 0); |
@@ -15318,8 +15318,8 @@ class VisitorImpl : public v8::ExternalResourceVisitor { |
}; |
TEST(VisitExternalStrings) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
const char* string = "Some string"; |
uint16_t* two_byte_string = AsciiToTwoByteString(string); |
TestResource* resource[4]; |
@@ -15384,8 +15384,8 @@ static double DoubleFromBits(uint32_t high_bits, uint32_t low_bits) { |
THREADED_TEST(QuietSignalingNaNs) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::TryCatch try_catch; |
// Special double values. |
@@ -15468,7 +15468,7 @@ THREADED_TEST(QuietSignalingNaNs) { |
static v8::Handle<Value> SpaghettiIncident(const v8::Arguments& args) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(args.GetIsolate()); |
v8::TryCatch tc; |
v8::Handle<v8::String> str(args[0]->ToString()); |
USE(str); |
@@ -15481,7 +15481,7 @@ static v8::Handle<Value> SpaghettiIncident(const v8::Arguments& args) { |
// Test that an exception can be propagated down through a spaghetti |
// stack using ReThrow. |
THREADED_TEST(SpaghettiStackReThrow) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
LocalContext context; |
context->Global()->Set( |
v8::String::New("s"), |
@@ -15509,7 +15509,7 @@ THREADED_TEST(SpaghettiStackReThrow) { |
TEST(Regress528) { |
v8::V8::Initialize(); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
v8::Persistent<Context> context; |
v8::Persistent<Context> other_context; |
int gc_count; |
@@ -15523,7 +15523,7 @@ TEST(Regress528) { |
const char* source_simple = "1"; |
context = Context::New(); |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
context->Enter(); |
Local<v8::String> obj = v8::String::New(""); |
@@ -15548,7 +15548,7 @@ TEST(Regress528) { |
const char* source_eval = "function f(){eval('1')}; f()"; |
context = Context::New(); |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
context->Enter(); |
CompileRun(source_eval); |
@@ -15571,7 +15571,7 @@ TEST(Regress528) { |
const char* source_exception = "function f(){throw 1;} f()"; |
context = Context::New(); |
{ |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
context->Enter(); |
v8::TryCatch try_catch; |
@@ -15600,8 +15600,8 @@ TEST(Regress528) { |
THREADED_TEST(ScriptOrigin) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::ScriptOrigin origin = v8::ScriptOrigin(v8::String::New("test")); |
v8::Handle<v8::String> script = v8::String::New( |
"function f() {}\n\nfunction g() {}"); |
@@ -15621,8 +15621,8 @@ THREADED_TEST(ScriptOrigin) { |
} |
THREADED_TEST(FunctionGetInferredName) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::ScriptOrigin origin = v8::ScriptOrigin(v8::String::New("test")); |
v8::Handle<v8::String> script = v8::String::New( |
"var foo = { bar : { baz : function() {}}}; var f = foo.bar.baz;"); |
@@ -15633,8 +15633,8 @@ THREADED_TEST(FunctionGetInferredName) { |
} |
THREADED_TEST(ScriptLineNumber) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::ScriptOrigin origin = v8::ScriptOrigin(v8::String::New("test")); |
v8::Handle<v8::String> script = v8::String::New( |
"function f() {}\n\nfunction g() {}"); |
@@ -15649,8 +15649,8 @@ THREADED_TEST(ScriptLineNumber) { |
THREADED_TEST(ScriptColumnNumber) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::ScriptOrigin origin = v8::ScriptOrigin(v8::String::New("test"), |
v8::Integer::New(3), v8::Integer::New(2)); |
v8::Handle<v8::String> script = v8::String::New( |
@@ -15666,8 +15666,8 @@ THREADED_TEST(ScriptColumnNumber) { |
THREADED_TEST(FunctionGetScriptId) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::ScriptOrigin origin = v8::ScriptOrigin(v8::String::New("test"), |
v8::Integer::New(3), v8::Integer::New(2)); |
v8::Handle<v8::String> scriptSource = v8::String::New( |
@@ -15721,7 +15721,7 @@ Handle<Value> FooSetInterceptor(Local<String> name, |
TEST(SetterOnConstructorPrototype) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetAccessor(v8_str("x"), |
GetterWhichReturns42, |
@@ -15771,7 +15771,7 @@ static v8::Handle<Value> NamedPropertySetterWhichSetsYOnThisTo23( |
THREADED_TEST(InterceptorOnConstructorPrototype) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetNamedPropertyHandler(NamedPropertyGetterWhichReturns42, |
NamedPropertySetterWhichSetsYOnThisTo23); |
@@ -15810,8 +15810,8 @@ TEST(Bug618) { |
"};" |
"C1.prototype = P;"; |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Local<v8::Script> script; |
// Use a simple object as prototype. |
@@ -15906,7 +15906,7 @@ TEST(GCCallbacks) { |
THREADED_TEST(AddToJSFunctionResultCache) { |
i::FLAG_allow_natives_syntax = true; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
LocalContext context; |
@@ -15933,9 +15933,8 @@ static const int k0CacheSize = 16; |
THREADED_TEST(FillJSFunctionResultCache) { |
i::FLAG_allow_natives_syntax = true; |
- v8::HandleScope scope; |
- |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
const char* code = |
"(function() {" |
@@ -15955,9 +15954,8 @@ THREADED_TEST(FillJSFunctionResultCache) { |
THREADED_TEST(RoundRobinGetFromCache) { |
i::FLAG_allow_natives_syntax = true; |
- v8::HandleScope scope; |
- |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
const char* code = |
"(function() {" |
@@ -15980,9 +15978,8 @@ THREADED_TEST(RoundRobinGetFromCache) { |
THREADED_TEST(ReverseGetFromCache) { |
i::FLAG_allow_natives_syntax = true; |
- v8::HandleScope scope; |
- |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
const char* code = |
"(function() {" |
@@ -16005,9 +16002,8 @@ THREADED_TEST(ReverseGetFromCache) { |
THREADED_TEST(TestEviction) { |
i::FLAG_allow_natives_syntax = true; |
- v8::HandleScope scope; |
- |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
const char* code = |
"(function() {" |
@@ -16023,9 +16019,9 @@ THREADED_TEST(TestEviction) { |
THREADED_TEST(TwoByteStringInAsciiCons) { |
// See Chromium issue 47824. |
- v8::HandleScope scope; |
- |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
+ |
const char* init_code = |
"var str1 = 'abelspendabel';" |
"var str2 = str1 + str1 + str1;" |
@@ -16124,7 +16120,7 @@ TEST(GCInFailedAccessCheckCallback) { |
v8::V8::Initialize(); |
v8::V8::SetFailedAccessCheckCallbackFunction(&FailedAccessCheckCallbackGC); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
// Create an ObjectTemplate for global objects and install access |
// check callbacks that will block access. |
@@ -16217,10 +16213,10 @@ TEST(IsolateNewDispose) { |
} |
TEST(IsolateEnterExitDefault) { |
- v8::HandleScope scope; |
- LocalContext context; |
v8::Isolate* current_isolate = v8::Isolate::GetCurrent(); |
CHECK(current_isolate != NULL); // Default isolate. |
+ v8::HandleScope scope(current_isolate); |
+ LocalContext context; |
ExpectString("'hello'", "hello"); |
current_isolate->Enter(); |
ExpectString("'still working'", "still working"); |
@@ -16238,7 +16234,7 @@ TEST(DisposeDefaultIsolate) { |
v8::V8::SetFatalErrorHandler(StoringErrorCallback); |
// Run some V8 code to trigger default isolate to become 'current'. |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
LocalContext context; |
ExpectString("'run some V8'", "run some V8"); |
@@ -16252,7 +16248,7 @@ TEST(DisposeDefaultIsolate) { |
} |
TEST(RunDefaultAndAnotherIsolate) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
LocalContext context; |
// Enter new isolate. |
@@ -16261,7 +16257,7 @@ TEST(RunDefaultAndAnotherIsolate) { |
isolate->Enter(); |
{ // Need this block because subsequent Exit() will deallocate Heap, |
// so we need all scope objects to be deconstructed when it happens. |
- v8::HandleScope scope_new; |
+ v8::HandleScope scope_new(isolate); |
LocalContext context_new; |
// Run something in new isolate. |
@@ -16297,7 +16293,7 @@ TEST(DisposeIsolateWhenInUse) { |
v8::Isolate* isolate = v8::Isolate::New(); |
CHECK(isolate); |
isolate->Enter(); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(isolate); |
LocalContext context; |
// Run something in this isolate. |
ExpectTrue("true"); |
@@ -16317,7 +16313,7 @@ TEST(RunTwoIsolatesOnSingleThread) { |
{ |
v8::Context::Scope cscope(context1); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(isolate1); |
// Run something in new isolate. |
CompileRun("var foo = 'isolate 1';"); |
ExpectString("function f() { return foo; }; f()", "isolate 1"); |
@@ -16331,7 +16327,7 @@ TEST(RunTwoIsolatesOnSingleThread) { |
v8::Isolate::Scope iscope(isolate2); |
context2 = v8::Context::New(); |
v8::Context::Scope cscope(context2); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(isolate2); |
// Run something in new isolate. |
CompileRun("var foo = 'isolate 2';"); |
@@ -16340,7 +16336,7 @@ TEST(RunTwoIsolatesOnSingleThread) { |
{ |
v8::Context::Scope cscope(context1); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(isolate1); |
// Now again in isolate 1 |
ExpectString("function f() { return foo; }; f()", "isolate 1"); |
} |
@@ -16352,7 +16348,7 @@ TEST(RunTwoIsolatesOnSingleThread) { |
{ |
v8::Context::Scope cscope(context_default); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
// Variables in other isolates should be not available, verify there |
// is an exception. |
ExpectTrue("function f() {" |
@@ -16372,13 +16368,13 @@ TEST(RunTwoIsolatesOnSingleThread) { |
{ |
v8::Isolate::Scope iscope(isolate2); |
v8::Context::Scope cscope(context2); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
ExpectString("function f() { return foo; }; f()", "isolate 2"); |
} |
{ |
v8::Context::Scope cscope(context1); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
ExpectString("function f() { return foo; }; f()", "isolate 1"); |
} |
@@ -16404,14 +16400,14 @@ TEST(RunTwoIsolatesOnSingleThread) { |
// Check that default isolate still runs. |
{ |
v8::Context::Scope cscope(context_default); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
ExpectTrue("function f() { return isDefaultIsolate; }; f()"); |
} |
} |
static int CalcFibonacci(v8::Isolate* isolate, int limit) { |
v8::Isolate::Scope isolate_scope(isolate); |
- v8::HandleScope scope; |
+ v8::HandleScope scope(isolate); |
LocalContext context; |
i::ScopedVector<char> code(1024); |
i::OS::SNPrintF(code, "function fib(n) {" |
@@ -16477,7 +16473,7 @@ TEST(IsolateDifferentContexts) { |
Persistent<v8::Context> context; |
{ |
v8::Isolate::Scope isolate_scope(isolate); |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(isolate); |
context = v8::Context::New(); |
v8::Context::Scope context_scope(context); |
Local<Value> v = CompileRun("2"); |
@@ -16486,7 +16482,7 @@ TEST(IsolateDifferentContexts) { |
} |
{ |
v8::Isolate::Scope isolate_scope(isolate); |
- v8::HandleScope handle_scope; |
+ v8::HandleScope handle_scope(isolate); |
context = v8::Context::New(); |
v8::Context::Scope context_scope(context); |
Local<Value> v = CompileRun("22"); |
@@ -16592,8 +16588,8 @@ TEST(StringCheckMultipleContexts) { |
{ |
// Run the code twice in the first context to initialize the call IC. |
- v8::HandleScope scope; |
LocalContext context1; |
+ v8::HandleScope scope(context1->GetIsolate()); |
ExpectString(code, "a"); |
ExpectString(code, "a"); |
} |
@@ -16601,8 +16597,8 @@ TEST(StringCheckMultipleContexts) { |
{ |
// Change the String.prototype in the second context and check |
// that the right function gets called. |
- v8::HandleScope scope; |
LocalContext context2; |
+ v8::HandleScope scope(context2->GetIsolate()); |
CompileRun("String.prototype.charAt = function() { return \"not a\"; }"); |
ExpectString(code, "not a"); |
} |
@@ -16615,8 +16611,8 @@ TEST(NumberCheckMultipleContexts) { |
{ |
// Run the code twice in the first context to initialize the call IC. |
- v8::HandleScope scope; |
LocalContext context1; |
+ v8::HandleScope scope(context1->GetIsolate()); |
ExpectString(code, "42"); |
ExpectString(code, "42"); |
} |
@@ -16624,8 +16620,8 @@ TEST(NumberCheckMultipleContexts) { |
{ |
// Change the Number.prototype in the second context and check |
// that the right function gets called. |
- v8::HandleScope scope; |
LocalContext context2; |
+ v8::HandleScope scope(context2->GetIsolate()); |
CompileRun("Number.prototype.toString = function() { return \"not 42\"; }"); |
ExpectString(code, "not 42"); |
} |
@@ -16638,8 +16634,8 @@ TEST(BooleanCheckMultipleContexts) { |
{ |
// Run the code twice in the first context to initialize the call IC. |
- v8::HandleScope scope; |
LocalContext context1; |
+ v8::HandleScope scope(context1->GetIsolate()); |
ExpectString(code, "true"); |
ExpectString(code, "true"); |
} |
@@ -16647,8 +16643,8 @@ TEST(BooleanCheckMultipleContexts) { |
{ |
// Change the Boolean.prototype in the second context and check |
// that the right function gets called. |
- v8::HandleScope scope; |
LocalContext context2; |
+ v8::HandleScope scope(context2->GetIsolate()); |
CompileRun("Boolean.prototype.toString = function() { return \"\"; }"); |
ExpectString(code, ""); |
} |
@@ -16662,8 +16658,8 @@ TEST(DontDeleteCellLoadIC) { |
{ |
// Run the code twice in the first context to initialize the load |
// IC for a don't delete cell. |
- v8::HandleScope scope; |
LocalContext context1; |
+ v8::HandleScope scope(context1->GetIsolate()); |
CompileRun("var cell = \"first\";"); |
ExpectBoolean("delete cell", false); |
CompileRun(function_code); |
@@ -16673,8 +16669,8 @@ TEST(DontDeleteCellLoadIC) { |
{ |
// Use a deletable cell in the second context. |
- v8::HandleScope scope; |
LocalContext context2; |
+ v8::HandleScope scope(context2->GetIsolate()); |
CompileRun("cell = \"second\";"); |
CompileRun(function_code); |
ExpectString("readCell()", "second"); |
@@ -16701,8 +16697,8 @@ TEST(DontDeleteCellLoadICForceDelete) { |
// Run the code twice to initialize the load IC for a don't delete |
// cell. |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
CompileRun("var cell = \"value\";"); |
ExpectBoolean("delete cell", false); |
CompileRun(function_code); |
@@ -16729,8 +16725,8 @@ TEST(DontDeleteCellLoadICAPI) { |
// Run the code twice to initialize the load IC for a don't delete |
// cell created using the API. |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
context->Global()->Set(v8_str("cell"), v8_str("value"), v8::DontDelete); |
ExpectBoolean("delete cell", false); |
CompileRun(function_code); |
@@ -16774,9 +16770,9 @@ class Visitor42 : public v8::PersistentHandleVisitor { |
TEST(PersistentHandleVisitor) { |
- v8::HandleScope scope; |
LocalContext context; |
v8::Isolate* isolate = context->GetIsolate(); |
+ v8::HandleScope scope(isolate); |
v8::Persistent<v8::Object> object = |
v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
CHECK_EQ(0, object.WrapperClassId(isolate)); |
@@ -16792,9 +16788,9 @@ TEST(PersistentHandleVisitor) { |
TEST(WrapperClassId) { |
- v8::HandleScope scope; |
LocalContext context; |
v8::Isolate* isolate = context->GetIsolate(); |
+ v8::HandleScope scope(isolate); |
v8::Persistent<v8::Object> object = |
v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
CHECK_EQ(0, object.WrapperClassId(isolate)); |
@@ -16805,9 +16801,9 @@ TEST(WrapperClassId) { |
TEST(PersistentHandleInNewSpaceVisitor) { |
- v8::HandleScope scope; |
LocalContext context; |
v8::Isolate* isolate = context->GetIsolate(); |
+ v8::HandleScope scope(isolate); |
v8::Persistent<v8::Object> object1 = |
v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
CHECK_EQ(0, object1.WrapperClassId(isolate)); |
@@ -16832,8 +16828,8 @@ TEST(PersistentHandleInNewSpaceVisitor) { |
TEST(RegExp) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<v8::RegExp> re = v8::RegExp::New(v8_str("foo"), v8::RegExp::kNone); |
CHECK(re->IsRegExp()); |
@@ -16902,8 +16898,8 @@ TEST(RegExp) { |
THREADED_TEST(Equals) { |
- v8::HandleScope handleScope; |
LocalContext localContext; |
+ v8::HandleScope handleScope(localContext->GetIsolate()); |
v8::Handle<v8::Object> globalProxy = localContext->Global(); |
v8::Handle<Value> global = globalProxy->GetPrototype(); |
@@ -16934,8 +16930,8 @@ static v8::Handle<v8::Array> Enumerator(const v8::AccessorInfo& info) { |
TEST(NamedEnumeratorAndForIn) { |
- v8::HandleScope handle_scope; |
LocalContext context; |
+ v8::HandleScope handle_scope(context->GetIsolate()); |
v8::Context::Scope context_scope(context.local()); |
v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New(); |
@@ -16949,8 +16945,8 @@ TEST(NamedEnumeratorAndForIn) { |
TEST(DefinePropertyPostDetach) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
v8::Handle<v8::Object> proxy = context->Global(); |
v8::Handle<v8::Function> define_property = |
CompileRun("(function() {" |
@@ -16977,7 +16973,7 @@ static void CheckContextId(v8::Handle<Object> object, int expected) { |
THREADED_TEST(CreationContext) { |
- HandleScope handle_scope; |
+ HandleScope handle_scope(v8::Isolate::GetCurrent()); |
Persistent<Context> context1 = Context::New(); |
InstallContextId(context1, 1); |
Persistent<Context> context2 = Context::New(); |
@@ -17064,7 +17060,7 @@ THREADED_TEST(CreationContext) { |
THREADED_TEST(CreationContextOfJsFunction) { |
- HandleScope handle_scope; |
+ HandleScope handle_scope(v8::Isolate::GetCurrent()); |
Persistent<Context> context = Context::New(); |
InstallContextId(context, 1); |
@@ -17123,8 +17119,8 @@ Handle<Value> HasOwnPropertyAccessorGetter(Local<String> property, |
TEST(HasOwnProperty) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
{ // Check normal properties and defined getters. |
Handle<Value> value = CompileRun( |
"function Foo() {" |
@@ -17196,7 +17192,7 @@ TEST(HasOwnProperty) { |
TEST(IndexedInterceptorWithStringProto) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Handle<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetIndexedPropertyHandler(NULL, |
NULL, |
@@ -17258,8 +17254,8 @@ bool CodeGenerationDisallowed(Local<Context> context) { |
THREADED_TEST(AllowCodeGenFromStrings) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
// eval and the Function constructor allowed by default. |
CHECK(context->IsCodeGenerationFromStringsAllowed()); |
@@ -17288,8 +17284,8 @@ THREADED_TEST(AllowCodeGenFromStrings) { |
TEST(SetErrorMessageForCodeGenFromStrings) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
TryCatch try_catch; |
Handle<String> message = v8_str("Message") ; |
@@ -17311,8 +17307,8 @@ static v8::Handle<Value> NonObjectThis(const v8::Arguments& args) { |
THREADED_TEST(CallAPIFunctionOnNonObject) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Handle<FunctionTemplate> templ = v8::FunctionTemplate::New(NonObjectThis); |
Handle<Function> function = templ->GetFunction(); |
context->Global()->Set(v8_str("f"), function); |
@@ -17323,7 +17319,7 @@ THREADED_TEST(CallAPIFunctionOnNonObject) { |
// Regression test for issue 1470. |
THREADED_TEST(ReadOnlyIndexedProperties) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
LocalContext context; |
@@ -17344,10 +17340,10 @@ THREADED_TEST(ReadOnlyIndexedProperties) { |
THREADED_TEST(Regress1516) { |
- v8::HandleScope scope; |
- |
LocalContext context; |
- { v8::HandleScope temp_scope; |
+ v8::HandleScope scope(context->GetIsolate()); |
+ |
+ { v8::HandleScope temp_scope(context->GetIsolate()); |
CompileRun("({'a': 0})"); |
} |
@@ -17388,7 +17384,7 @@ static bool BlockProtoNamedSecurityTestCallback(Local<v8::Object> global, |
THREADED_TEST(Regress93759) { |
- HandleScope scope; |
+ HandleScope scope(v8::Isolate::GetCurrent()); |
// Template for object with security check. |
Local<ObjectTemplate> no_proto_template = v8::ObjectTemplate::New(); |
@@ -17479,7 +17475,7 @@ THREADED_TEST(Regress93759) { |
THREADED_TEST(Regress125988) { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
Handle<FunctionTemplate> intercept = FunctionTemplate::New(); |
AddInterceptor(intercept, EmptyInterceptorGetter, EmptyInterceptorSetter); |
LocalContext env; |
@@ -17513,7 +17509,7 @@ static void TestReceiver(Local<Value> expected_result, |
THREADED_TEST(ForeignFunctionReceiver) { |
- HandleScope scope; |
+ HandleScope scope(v8::Isolate::GetCurrent()); |
// Create two contexts with different "id" properties ('i' and 'o'). |
// Call a function both from its own context and from a the foreign |
@@ -17641,8 +17637,8 @@ Handle<Value> RecursiveCall(const Arguments& args) { |
TEST(CallCompletedCallback) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::Handle<v8::FunctionTemplate> recursive_runtime = |
v8::FunctionTemplate::New(RecursiveCall); |
env->Global()->Set(v8_str("recursion"), |
@@ -17674,28 +17670,28 @@ TEST(CallCompletedCallback) { |
void CallCompletedCallbackNoException() { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
CompileRun("1+1;"); |
} |
void CallCompletedCallbackException() { |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
CompileRun("throw 'second exception';"); |
} |
TEST(CallCompletedCallbackOneException) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::V8::AddCallCompletedCallback(CallCompletedCallbackNoException); |
CompileRun("throw 'exception';"); |
} |
TEST(CallCompletedCallbackTwoExceptions) { |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
v8::V8::AddCallCompletedCallback(CallCompletedCallbackException); |
CompileRun("throw 'first exception';"); |
} |
@@ -17743,8 +17739,8 @@ static void StubCacheHelper(bool primary) { |
i::FLAG_test_secondary_stub_cache = true; |
} |
i::FLAG_crankshaft = false; |
- v8::HandleScope scope; |
LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
int initial_probes = probes_counter; |
int initial_misses = misses_counter; |
int initial_updates = updates_counter; |
@@ -17777,9 +17773,9 @@ static void CountingErrorCallback(const char* location, const char* message) { |
TEST(StaticGetters) { |
- v8::HandleScope scope; |
LocalContext context; |
v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
+ v8::HandleScope scope(isolate); |
i::Handle<i::Object> undefined_value = FACTORY->undefined_value(); |
CHECK(*v8::Utils::OpenHandle(*v8::Undefined()) == *undefined_value); |
CHECK(*v8::Utils::OpenHandle(*v8::Undefined(isolate)) == *undefined_value); |
@@ -17839,9 +17835,9 @@ TEST(IsolateEmbedderData) { |
TEST(StringEmpty) { |
- v8::HandleScope scope; |
LocalContext context; |
v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
+ v8::HandleScope scope(isolate); |
i::Handle<i::Object> empty_string = FACTORY->empty_string(); |
CHECK(*v8::Utils::OpenHandle(*v8::String::Empty()) == *empty_string); |
CHECK(*v8::Utils::OpenHandle(*v8::String::Empty(isolate)) == *empty_string); |
@@ -17942,8 +17938,8 @@ static void CheckInstanceCheckedAccessors(bool expects_callbacks) { |
THREADED_TEST(InstanceCheckOnInstanceAccessor) { |
v8::internal::FLAG_allow_natives_syntax = true; |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<FunctionTemplate> templ = FunctionTemplate::New(); |
Local<ObjectTemplate> inst = templ->InstanceTemplate(); |
@@ -17970,8 +17966,8 @@ THREADED_TEST(InstanceCheckOnInstanceAccessor) { |
THREADED_TEST(InstanceCheckOnInstanceAccessorWithInterceptor) { |
v8::internal::FLAG_allow_natives_syntax = true; |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<FunctionTemplate> templ = FunctionTemplate::New(); |
Local<ObjectTemplate> inst = templ->InstanceTemplate(); |
@@ -17999,8 +17995,8 @@ THREADED_TEST(InstanceCheckOnInstanceAccessorWithInterceptor) { |
THREADED_TEST(InstanceCheckOnPrototypeAccessor) { |
v8::internal::FLAG_allow_natives_syntax = true; |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<FunctionTemplate> templ = FunctionTemplate::New(); |
Local<ObjectTemplate> proto = templ->PrototypeTemplate(); |
@@ -18034,8 +18030,8 @@ THREADED_TEST(InstanceCheckOnPrototypeAccessor) { |
TEST(TryFinallyMessage) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
{ |
// Test that the original error message is not lost if there is a |
// recursive call into Javascript is done in the finally block, e.g. to |
@@ -18126,7 +18122,7 @@ static void Helper137002(bool do_store, |
THREADED_TEST(Regress137002a) { |
i::FLAG_allow_natives_syntax = true; |
i::FLAG_compilation_cache = false; |
- v8::HandleScope scope; |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
for (int i = 0; i < 16; i++) { |
Helper137002(i & 8, i & 4, i & 2, i & 1); |
} |
@@ -18135,8 +18131,8 @@ THREADED_TEST(Regress137002a) { |
THREADED_TEST(Regress137002b) { |
i::FLAG_allow_natives_syntax = true; |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetAccessor(v8_str("foo"), |
GetterWhichReturns42, |
@@ -18203,8 +18199,8 @@ THREADED_TEST(Regress137002b) { |
THREADED_TEST(Regress142088) { |
i::FLAG_allow_natives_syntax = true; |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
templ->SetAccessor(v8_str("foo"), |
GetterWhichReturns42, |
@@ -18220,8 +18216,8 @@ THREADED_TEST(Regress142088) { |
THREADED_TEST(Regress137496) { |
i::FLAG_expose_gc = true; |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
// Compile a try-finally clause where the finally block causes a GC |
// while there still is a message pending for external reporting. |
@@ -18233,8 +18229,8 @@ THREADED_TEST(Regress137496) { |
THREADED_TEST(Regress149912) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Handle<FunctionTemplate> templ = FunctionTemplate::New(); |
AddInterceptor(templ, EmptyInterceptorGetter, EmptyInterceptorSetter); |
context->Global()->Set(v8_str("Bug"), templ->GetFunction()); |
@@ -18243,8 +18239,8 @@ THREADED_TEST(Regress149912) { |
THREADED_TEST(Regress157124) { |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<ObjectTemplate> templ = ObjectTemplate::New(); |
Local<Object> obj = templ->NewInstance(); |
obj->GetIdentityHash(); |
@@ -18254,8 +18250,8 @@ THREADED_TEST(Regress157124) { |
THREADED_TEST(Regress2535) { |
i::FLAG_harmony_collections = true; |
- v8::HandleScope scope; |
LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
Local<Value> set_value = CompileRun("new Set();"); |
Local<Object> set_object(Object::Cast(*set_value)); |
CHECK_EQ(0, set_object->InternalFieldCount()); |