From 1143ab132e74e9e2bc8e5e5b97f9515fd32a7075 Mon Sep 17 00:00:00 2001 From: "svenpanne@chromium.org" Date: Fri, 3 Jan 2014 11:56:33 +0000 Subject: [PATCH] Reland r18383: More API cleanup. * Removed String::Empty, Number::New, Integer::New, Integer::NewFromUnsigned, FunctionTemplate::New and Object::New without Isolate* parameter. * Removed Integer::New and Integer::NewUnsigned with weird argument order. Chrome CLs matching this change have been landed. TBR=dcarney@chromium.org LOG=y BUG=324225 Review URL: https://codereview.chromium.org/108783007 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18449 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- include/v8.h | 21 +- src/api.cc | 73 +-- src/d8-posix.cc | 4 +- src/extensions/statistics-extension.cc | 8 +- test/cctest/cctest.h | 6 +- test/cctest/profiler-extension.cc | 6 +- test/cctest/test-accessors.cc | 8 +- test/cctest/test-api.cc | 804 ++++++++++++++++-------------- test/cctest/test-assembler-ia32.cc | 2 +- test/cctest/test-assembler-x64.cc | 2 +- test/cctest/test-compiler.cc | 2 +- test/cctest/test-cpu-profiler.cc | 48 +- test/cctest/test-debug.cc | 137 ++--- test/cctest/test-declarative-accessors.cc | 16 +- test/cctest/test-decls.cc | 82 +-- test/cctest/test-global-handles.cc | 6 +- test/cctest/test-global-object.cc | 2 +- test/cctest/test-heap-profiler.cc | 21 +- test/cctest/test-heap.cc | 12 +- test/cctest/test-object-observe.cc | 65 +-- test/cctest/test-strings.cc | 8 +- test/cctest/test-thread-termination.cc | 4 +- 22 files changed, 700 insertions(+), 637 deletions(-) diff --git a/include/v8.h b/include/v8.h index 2c82451..c073fb3 100644 --- a/include/v8.h +++ b/include/v8.h @@ -1668,7 +1668,6 @@ class V8_EXPORT String : public Primitive { /** * A zero length string. */ - static v8::Local Empty(); V8_INLINE static v8::Local Empty(Isolate* isolate); /** @@ -1963,8 +1962,6 @@ class V8_EXPORT Number : public Primitive { public: double Value() const; static Local New(Isolate* isolate, double value); - // Will be deprecated soon. - static Local New(double value); V8_INLINE static Number* Cast(v8::Value* obj); private: Number(); @@ -1979,11 +1976,6 @@ class V8_EXPORT Integer : public Number { public: static Local New(Isolate* isolate, int32_t value); static Local NewFromUnsigned(Isolate* isolate, uint32_t value); - // Will be deprecated soon. - static Local New(int32_t value, Isolate*); - static Local NewFromUnsigned(uint32_t value, Isolate*); - static Local New(int32_t value); - static Local NewFromUnsigned(uint32_t value); int64_t Value() const; V8_INLINE static Integer* Cast(v8::Value* obj); private: @@ -2337,8 +2329,7 @@ class V8_EXPORT Object : public Value { Local CallAsConstructor(int argc, Handle argv[]); static Local New(Isolate* isolate); - // Will be deprecated soon. - static Local New(); + V8_INLINE static Object* Cast(Value* obj); private: @@ -3353,12 +3344,6 @@ class V8_EXPORT FunctionTemplate : public Template { Handle data = Handle(), Handle signature = Handle(), int length = 0); - // Will be deprecated soon. - static Local New( - FunctionCallback callback = 0, - Handle data = Handle(), - Handle signature = Handle(), - int length = 0); /** Returns the unique function instance in the current execution context.*/ Local GetFunction(); @@ -5798,7 +5783,7 @@ void ReturnValue::Set(int32_t i) { *value_ = I::IntToSmi(i); return; } - Set(Integer::New(i, GetIsolate())); + Set(Integer::New(GetIsolate(), i)); } template @@ -5810,7 +5795,7 @@ void ReturnValue::Set(uint32_t i) { Set(static_cast(i)); return; } - Set(Integer::NewFromUnsigned(i, GetIsolate())); + Set(Integer::NewFromUnsigned(GetIsolate(), i)); } template diff --git a/src/api.cc b/src/api.cc index c5023f8..5a35cb6 100644 --- a/src/api.cc +++ b/src/api.cc @@ -885,7 +885,7 @@ static void TemplateSet(i::Isolate* isolate, Utils::OpenHandle(templ)->set_property_list(*list); } NeanderArray array(list); - array.add(Utils::OpenHandle(*v8::Integer::New(length))); + array.add(isolate->factory()->NewNumberFromInt(length)); for (int i = 0; i < length; i++) { i::Handle value = data[i].IsEmpty() ? i::Handle(isolate->factory()->undefined_value()) : @@ -902,10 +902,11 @@ void Template::Set(v8::Handle name, ENTER_V8(isolate); i::HandleScope scope(isolate); const int kSize = 3; + v8::Isolate* v8_isolate = reinterpret_cast(isolate); v8::Handle data[kSize] = { name, value, - v8::Integer::New(attribute)}; + v8::Integer::New(v8_isolate, attribute)}; TemplateSet(isolate, this, kSize, data); } @@ -922,12 +923,13 @@ void Template::SetAccessorProperty( ASSERT(!getter.IsEmpty() || !setter.IsEmpty()); i::HandleScope scope(isolate); const int kSize = 5; + v8::Isolate* v8_isolate = reinterpret_cast(isolate); v8::Handle data[kSize] = { name, getter, setter, - v8::Integer::New(attribute), - v8::Integer::New(access_control)}; + v8::Integer::New(v8_isolate, attribute), + v8::Integer::New(v8_isolate, access_control)}; TemplateSet(isolate, this, kSize, data); } @@ -1008,14 +1010,6 @@ Local FunctionTemplate::New( } -Local FunctionTemplate::New( - FunctionCallback callback, - v8::Handle data, - v8::Handle signature, - int length) { - return New(Isolate::GetCurrent(), callback, data, signature, length); -} - Local Signature::New(Isolate* isolate, Handle receiver, int argc, Handle argv[]) { @@ -4116,10 +4110,11 @@ ScriptOrigin Function::GetScriptOrigin() const { if (func->shared()->script()->IsScript()) { i::Handle script(i::Script::cast(func->shared()->script())); i::Handle scriptName = GetScriptNameOrSourceURL(script); + v8::Isolate* isolate = reinterpret_cast(func->GetIsolate()); v8::ScriptOrigin origin( Utils::ToLocal(scriptName), - v8::Integer::New(script->line_offset()->value()), - v8::Integer::New(script->column_offset()->value())); + v8::Integer::New(isolate, script->line_offset()->value()), + v8::Integer::New(isolate, script->column_offset()->value())); return origin; } return v8::ScriptOrigin(Handle()); @@ -5350,16 +5345,6 @@ void* External::Value() const { } -Local v8::String::Empty() { - i::Isolate* isolate = i::Isolate::Current(); - if (!EnsureInitializedForIsolate(isolate, "v8::String::Empty()")) { - return v8::Local(); - } - LOG_API(isolate, "String::Empty()"); - return Utils::ToLocal(isolate->factory()->empty_string()); -} - - // anonymous namespace for string creation helper functions namespace { @@ -5422,7 +5407,7 @@ inline Local NewString(Isolate* v8_isolate, EnsureInitializedForIsolate(isolate, location); LOG_API(isolate, env); if (length == 0 && type != String::kUndetectableString) { - return String::Empty(); + return String::Empty(v8_isolate); } ENTER_V8(isolate); if (length == -1) length = StringLength(data); @@ -5653,11 +5638,6 @@ Local v8::Object::New(Isolate* isolate) { } -Local v8::Object::New() { - return New(Isolate::GetCurrent()); -} - - Local v8::NumberObject::New(Isolate* isolate, double value) { i::Isolate* i_isolate = reinterpret_cast(isolate); EnsureInitializedForIsolate(i_isolate, "v8::NumberObject::New()"); @@ -6143,13 +6123,6 @@ Local v8::Private::New( } -Local v8::Number::New(double value) { - i::Isolate* isolate = i::Isolate::Current(); - EnsureInitializedForIsolate(isolate, "v8::Number::New()"); - return Number::New(reinterpret_cast(isolate), value); -} - - Local v8::Number::New(Isolate* isolate, double value) { i::Isolate* internal_isolate = reinterpret_cast(isolate); ASSERT(internal_isolate->IsInitialized()); @@ -6163,30 +6136,6 @@ Local v8::Number::New(Isolate* isolate, double value) { } -Local v8::Integer::New(int32_t value) { - i::Isolate* isolate = i::Isolate::UncheckedCurrent(); - EnsureInitializedForIsolate(isolate, "v8::Integer::New()"); - return v8::Integer::New(reinterpret_cast(isolate), value); -} - - -Local Integer::NewFromUnsigned(uint32_t value) { - i::Isolate* isolate = i::Isolate::Current(); - EnsureInitializedForIsolate(isolate, "v8::Integer::NewFromUnsigned()"); - return Integer::NewFromUnsigned(reinterpret_cast(isolate), value); -} - - -Local v8::Integer::New(int32_t value, Isolate* isolate) { - return Integer::New(isolate, value); -} - - -Local v8::Integer::NewFromUnsigned(uint32_t value, Isolate* isolate) { - return Integer::NewFromUnsigned(isolate, value); -} - - Local v8::Integer::New(Isolate* isolate, int32_t value) { i::Isolate* internal_isolate = reinterpret_cast(isolate); ASSERT(internal_isolate->IsInitialized()); @@ -6205,7 +6154,7 @@ Local v8::Integer::NewFromUnsigned(Isolate* isolate, uint32_t value) { ASSERT(internal_isolate->IsInitialized()); bool fits_into_int32_t = (value & (1 << 31)) == 0; if (fits_into_int32_t) { - return Integer::New(static_cast(value), isolate); + return Integer::New(isolate, static_cast(value)); } ENTER_V8(internal_isolate); i::Handle result = internal_isolate->factory()->NewNumber(value); diff --git a/src/d8-posix.cc b/src/d8-posix.cc index c0485c6..36ade48 100644 --- a/src/d8-posix.cc +++ b/src/d8-posix.cc @@ -202,7 +202,7 @@ class ExecArgs { exec_args_[0] = c_arg; int i = 1; for (unsigned j = 0; j < command_args->Length(); i++, j++) { - Handle arg(command_args->Get(Integer::New(j))); + Handle arg(command_args->Get(Integer::New(isolate, j))); String::Utf8Value utf8_arg(arg); if (*utf8_arg == NULL) { exec_args_[i] = NULL; // Consistent state for destructor. @@ -314,7 +314,7 @@ static Handle GetStdout(Isolate* isolate, struct timeval& start_time, int read_timeout, int total_timeout) { - Handle accumulator = String::Empty(); + Handle accumulator = String::Empty(isolate); int fullness = 0; static const int kStdoutReadBufferSize = 4096; diff --git a/src/extensions/statistics-extension.cc b/src/extensions/statistics-extension.cc index 767c9e7..a2e07ef 100644 --- a/src/extensions/statistics-extension.cc +++ b/src/extensions/statistics-extension.cc @@ -48,7 +48,7 @@ static void AddCounter(v8::Isolate* isolate, const char* name) { if (counter->Enabled()) { object->Set(v8::String::NewFromUtf8(isolate, name), - v8::Number::New(*counter->GetInternalPointer())); + v8::Number::New(isolate, *counter->GetInternalPointer())); } } @@ -57,7 +57,7 @@ static void AddNumber(v8::Isolate* isolate, intptr_t value, const char* name) { object->Set(v8::String::NewFromUtf8(isolate, name), - v8::Number::New(static_cast(value))); + v8::Number::New(isolate, static_cast(value))); } @@ -66,7 +66,7 @@ static void AddNumber64(v8::Isolate* isolate, int64_t value, const char* name) { object->Set(v8::String::NewFromUtf8(isolate, name), - v8::Number::New(static_cast(value))); + v8::Number::New(isolate, static_cast(value))); } @@ -82,7 +82,7 @@ void StatisticsExtension::GetCounters( } Counters* counters = isolate->counters(); - v8::Local result = v8::Object::New(); + v8::Local result = v8::Object::New(args.GetIsolate()); #define ADD_COUNTER(name, caption) \ AddCounter(args.GetIsolate(), result, counters->name(), #name); diff --git a/test/cctest/cctest.h b/test/cctest/cctest.h index 40e9b9a..7b44a98 100644 --- a/test/cctest/cctest.h +++ b/test/cctest/cctest.h @@ -289,7 +289,7 @@ class LocalContext { }; static inline v8::Local v8_num(double x) { - return v8::Number::New(x); + return v8::Number::New(v8::Isolate::GetCurrent(), x); } @@ -317,8 +317,8 @@ static inline v8::Local CompileRunWithOrigin(const char* source, int column_number) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::ScriptOrigin origin(v8::String::NewFromUtf8(isolate, origin_url), - v8::Integer::New(line_number), - v8::Integer::New(column_number)); + v8::Integer::New(isolate, line_number), + v8::Integer::New(isolate, column_number)); return v8::Script::Compile(v8::String::NewFromUtf8(isolate, source), &origin) ->Run(); } diff --git a/test/cctest/profiler-extension.cc b/test/cctest/profiler-extension.cc index 7b0b099..193b1ce 100644 --- a/test/cctest/profiler-extension.cc +++ b/test/cctest/profiler-extension.cc @@ -39,9 +39,11 @@ const char* ProfilerExtension::kSource = v8::Handle ProfilerExtension::GetNativeFunctionTemplate( v8::Isolate* isolate, v8::Handle name) { if (name->Equals(v8::String::NewFromUtf8(isolate, "startProfiling"))) { - return v8::FunctionTemplate::New(ProfilerExtension::StartProfiling); + return v8::FunctionTemplate::New(isolate, + ProfilerExtension::StartProfiling); } else if (name->Equals(v8::String::NewFromUtf8(isolate, "stopProfiling"))) { - return v8::FunctionTemplate::New(ProfilerExtension::StopProfiling); + return v8::FunctionTemplate::New(isolate, + ProfilerExtension::StopProfiling); } else { CHECK(false); return v8::Handle(); diff --git a/test/cctest/test-accessors.cc b/test/cctest/test-accessors.cc index ba71600..a478c8a 100644 --- a/test/cctest/test-accessors.cc +++ b/test/cctest/test-accessors.cc @@ -201,7 +201,7 @@ THREADED_TEST(AccessorIC) { v8::FunctionTemplate::New(isolate, XSetter)); x_holder = obj->NewInstance(); context->Global()->Set(v8_str("holder"), x_holder); - x_receiver = v8::Object::New(); + x_receiver = v8::Object::New(isolate); context->Global()->Set(v8_str("obj"), x_receiver); v8::Handle array = v8::Handle::Cast(CompileRun( "obj.__proto__ = holder;" @@ -222,8 +222,8 @@ THREADED_TEST(AccessorIC) { "result")); CHECK_EQ(40, array->Length()); for (int i = 0; i < 40; i++) { - v8::Handle entry = array->Get(v8::Integer::New(i)); - CHECK_EQ(v8::Integer::New(i), entry); + v8::Handle entry = array->Get(v8::Integer::New(isolate, i)); + CHECK_EQ(v8::Integer::New(isolate, i), entry); } } @@ -524,7 +524,7 @@ static void AllocateHandles(Local name, for (int i = 0; i < i::kHandleBlockSize + 1; i++) { v8::Local::New(info.GetIsolate(), name); } - info.GetReturnValue().Set(v8::Integer::New(100)); + info.GetReturnValue().Set(v8::Integer::New(info.GetIsolate(), 100)); } diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc index 916a1d7..85ba7a9 100644 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc @@ -153,7 +153,7 @@ static void IncrementingSignatureCallback( v8::Handle result = v8::Array::New(args.GetIsolate(), args.Length()); for (int i = 0; i < args.Length(); i++) - result->Set(v8::Integer::New(i), args[i]); + result->Set(v8::Integer::New(args.GetIsolate(), i), args[i]); args.GetReturnValue().Set(result); } @@ -164,7 +164,7 @@ static void SignatureCallback( v8::Handle result = v8::Array::New(args.GetIsolate(), args.Length()); for (int i = 0; i < args.Length(); i++) { - result->Set(v8::Integer::New(i), args[i]); + result->Set(v8::Integer::New(args.GetIsolate(), i), args[i]); } args.GetReturnValue().Set(result); } @@ -411,7 +411,7 @@ THREADED_TEST(Access) { LocalContext env; v8::Isolate* isolate = env->GetIsolate(); v8::HandleScope scope(isolate); - Local obj = v8::Object::New(); + Local obj = v8::Object::New(isolate); Local foo_before = obj->Get(v8_str("foo")); CHECK(foo_before->IsUndefined()); Local bar_str = v8_str("bar"); @@ -426,7 +426,7 @@ THREADED_TEST(Access) { THREADED_TEST(AccessElement) { LocalContext env; v8::HandleScope scope(env->GetIsolate()); - Local obj = v8::Object::New(); + Local obj = v8::Object::New(env->GetIsolate()); Local before = obj->Get(1); CHECK(before->IsUndefined()); Local bar_str = v8_str("bar"); @@ -1199,7 +1199,9 @@ template<> void FastReturnValueCallback( const v8::FunctionCallbackInfo& info) { v8::Handle object; - if (!fast_return_value_object_is_empty) object = Object::New(); + if (!fast_return_value_object_is_empty) { + object = Object::New(info.GetIsolate()); + } info.GetReturnValue().Set(object); } @@ -1337,7 +1339,7 @@ static void TestExternalPointerWrapping() { v8::Handle data = v8::External::New(isolate, expected_ptr); - v8::Handle obj = v8::Object::New(); + v8::Handle obj = v8::Object::New(isolate); obj->Set(v8_str("func"), v8::FunctionTemplate::New(isolate, callback, data)->GetFunction()); env->Global()->Set(v8_str("obj"), obj); @@ -1446,14 +1448,14 @@ THREADED_TEST(FindInstanceInPrototypeChain) { THREADED_TEST(TinyInteger) { LocalContext env; - v8::HandleScope scope(env->GetIsolate()); - v8::Isolate* isolate = CcTest::isolate(); + v8::Isolate* isolate = env->GetIsolate(); + v8::HandleScope scope(isolate); int32_t value = 239; - Local value_obj = v8::Integer::New(value); + Local value_obj = v8::Integer::New(isolate, value); CHECK_EQ(static_cast(value), value_obj->Value()); - value_obj = v8::Integer::New(value, isolate); + value_obj = v8::Integer::New(isolate, value); CHECK_EQ(static_cast(value), value_obj->Value()); } @@ -1469,10 +1471,10 @@ THREADED_TEST(BigSmiInteger) { CHECK(i::Smi::IsValid(value)); CHECK(!i::Smi::IsValid(value + 1)); - Local value_obj = v8::Integer::New(value); + Local value_obj = v8::Integer::New(isolate, value); CHECK_EQ(static_cast(value), value_obj->Value()); - value_obj = v8::Integer::New(value, isolate); + value_obj = v8::Integer::New(isolate, value); CHECK_EQ(static_cast(value), value_obj->Value()); } } @@ -1492,10 +1494,10 @@ THREADED_TEST(BigInteger) { CHECK(value > i::Smi::kMaxValue); CHECK(!i::Smi::IsValid(value)); - Local value_obj = v8::Integer::New(value); + Local value_obj = v8::Integer::New(isolate, value); CHECK_EQ(static_cast(value), value_obj->Value()); - value_obj = v8::Integer::New(value, isolate); + value_obj = v8::Integer::New(isolate, value); CHECK_EQ(static_cast(value), value_obj->Value()); } } @@ -1508,10 +1510,10 @@ THREADED_TEST(TinyUnsignedInteger) { uint32_t value = 239; - Local value_obj = v8::Integer::NewFromUnsigned(value); + Local value_obj = v8::Integer::NewFromUnsigned(isolate, value); CHECK_EQ(static_cast(value), value_obj->Value()); - value_obj = v8::Integer::NewFromUnsigned(value, isolate); + value_obj = v8::Integer::NewFromUnsigned(isolate, value); CHECK_EQ(static_cast(value), value_obj->Value()); } @@ -1525,10 +1527,10 @@ THREADED_TEST(BigUnsignedSmiInteger) { CHECK(i::Smi::IsValid(value)); CHECK(!i::Smi::IsValid(value + 1)); - Local value_obj = v8::Integer::NewFromUnsigned(value); + Local value_obj = v8::Integer::NewFromUnsigned(isolate, value); CHECK_EQ(static_cast(value), value_obj->Value()); - value_obj = v8::Integer::NewFromUnsigned(value, isolate); + value_obj = v8::Integer::NewFromUnsigned(isolate, value); CHECK_EQ(static_cast(value), value_obj->Value()); } @@ -1542,10 +1544,10 @@ THREADED_TEST(BigUnsignedInteger) { CHECK(value > static_cast(i::Smi::kMaxValue)); CHECK(!i::Smi::IsValid(value)); - Local value_obj = v8::Integer::NewFromUnsigned(value); + Local value_obj = v8::Integer::NewFromUnsigned(isolate, value); CHECK_EQ(static_cast(value), value_obj->Value()); - value_obj = v8::Integer::NewFromUnsigned(value, isolate); + value_obj = v8::Integer::NewFromUnsigned(isolate, value); CHECK_EQ(static_cast(value), value_obj->Value()); } @@ -1559,10 +1561,10 @@ THREADED_TEST(OutOfSignedRangeUnsignedInteger) { uint32_t value = INT32_MAX_AS_UINT + 1; CHECK(value > INT32_MAX_AS_UINT); // No overflow. - Local value_obj = v8::Integer::NewFromUnsigned(value); + Local value_obj = v8::Integer::NewFromUnsigned(isolate, value); CHECK_EQ(static_cast(value), value_obj->Value()); - value_obj = v8::Integer::NewFromUnsigned(value, isolate); + value_obj = v8::Integer::NewFromUnsigned(isolate, value); CHECK_EQ(static_cast(value), value_obj->Value()); } @@ -1708,7 +1710,7 @@ THREADED_TEST(Number) { LocalContext env; v8::HandleScope scope(env->GetIsolate()); double PI = 3.1415926; - Local pi_obj = v8::Number::New(PI); + Local pi_obj = v8::Number::New(env->GetIsolate(), PI); CHECK_EQ(PI, pi_obj->NumberValue()); } @@ -1732,30 +1734,32 @@ THREADED_TEST(Date) { double PI = 3.1415926; Local date = v8::Date::New(env->GetIsolate(), PI); CHECK_EQ(3.0, date->NumberValue()); - date.As()->Set(v8_str("property"), v8::Integer::New(42)); + date.As()->Set(v8_str("property"), + v8::Integer::New(env->GetIsolate(), 42)); CHECK_EQ(42, date.As()->Get(v8_str("property"))->Int32Value()); } THREADED_TEST(Boolean) { LocalContext env; - v8::HandleScope scope(env->GetIsolate()); - v8::Handle t = v8::True(CcTest::isolate()); + v8::Isolate* isolate = env->GetIsolate(); + v8::HandleScope scope(isolate); + v8::Handle t = v8::True(isolate); CHECK(t->Value()); - v8::Handle f = v8::False(CcTest::isolate()); + v8::Handle f = v8::False(isolate); CHECK(!f->Value()); - v8::Handle u = v8::Undefined(CcTest::isolate()); + v8::Handle u = v8::Undefined(isolate); CHECK(!u->BooleanValue()); - v8::Handle n = v8::Null(CcTest::isolate()); + v8::Handle n = v8::Null(isolate); CHECK(!n->BooleanValue()); v8::Handle str1 = v8_str(""); CHECK(!str1->BooleanValue()); v8::Handle str2 = v8_str("x"); CHECK(str2->BooleanValue()); - CHECK(!v8::Number::New(0)->BooleanValue()); - CHECK(v8::Number::New(-1)->BooleanValue()); - CHECK(v8::Number::New(1)->BooleanValue()); - CHECK(v8::Number::New(42)->BooleanValue()); + CHECK(!v8::Number::New(isolate, 0)->BooleanValue()); + CHECK(v8::Number::New(isolate, -1)->BooleanValue()); + CHECK(v8::Number::New(isolate, 1)->BooleanValue()); + CHECK(v8::Number::New(isolate, 42)->BooleanValue()); CHECK(!v8_compile("NaN")->Run()->BooleanValue()); } @@ -2444,7 +2448,8 @@ static void CallScriptRecursivelyCall( ApiTestFuzzer::Fuzz(); int depth = args.This()->Get(v8_str("depth"))->Int32Value(); if (depth == kTargetRecursionDepth) return; - args.This()->Set(v8_str("depth"), v8::Integer::New(depth + 1)); + args.This()->Set(v8_str("depth"), + v8::Integer::New(args.GetIsolate(), depth + 1)); args.GetReturnValue().Set(call_recursively_script->Run()); } @@ -2457,7 +2462,8 @@ static void CallFunctionRecursivelyCall( printf("[depth = %d]\n", depth); return; } - args.This()->Set(v8_str("depth"), v8::Integer::New(depth + 1)); + args.This()->Set(v8_str("depth"), + v8::Integer::New(args.GetIsolate(), depth + 1)); v8::Handle function = args.This()->Get(v8_str("callFunctionRecursively")); args.GetReturnValue().Set( @@ -2475,12 +2481,12 @@ THREADED_TEST(DeepCrossLanguageRecursion) { v8::FunctionTemplate::New(isolate, CallFunctionRecursivelyCall)); LocalContext env(NULL, global); - env->Global()->Set(v8_str("depth"), v8::Integer::New(0)); + env->Global()->Set(v8_str("depth"), v8::Integer::New(isolate, 0)); call_recursively_script = v8_compile("callScriptRecursively()"); call_recursively_script->Run(); call_recursively_script = v8::Handle