Revert r18451 "Revert r18449 "Reland r18383: More API cleanup." and r18450 "Unbreak...
authorulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 3 Jan 2014 14:31:17 +0000 (14:31 +0000)
committerulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 3 Jan 2014 14:31:17 +0000 (14:31 +0000)
TBR=svenpanne@chromium.org
BUG=

Review URL: https://codereview.chromium.org/119753008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18452 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

22 files changed:
include/v8.h
src/api.cc
src/d8-posix.cc
src/extensions/statistics-extension.cc
test/cctest/cctest.h
test/cctest/profiler-extension.cc
test/cctest/test-accessors.cc
test/cctest/test-api.cc
test/cctest/test-assembler-ia32.cc
test/cctest/test-assembler-x64.cc
test/cctest/test-compiler.cc
test/cctest/test-cpu-profiler.cc
test/cctest/test-debug.cc
test/cctest/test-declarative-accessors.cc
test/cctest/test-decls.cc
test/cctest/test-global-handles.cc
test/cctest/test-global-object.cc
test/cctest/test-heap-profiler.cc
test/cctest/test-heap.cc
test/cctest/test-object-observe.cc
test/cctest/test-strings.cc
test/cctest/test-thread-termination.cc

index 2c82451..c073fb3 100644 (file)
@@ -1668,7 +1668,6 @@ class V8_EXPORT String : public Primitive {
   /**
    * A zero length string.
    */
-  static v8::Local<v8::String> Empty();
   V8_INLINE static v8::Local<v8::String> Empty(Isolate* isolate);
 
   /**
@@ -1963,8 +1962,6 @@ class V8_EXPORT Number : public Primitive {
  public:
   double Value() const;
   static Local<Number> New(Isolate* isolate, double value);
-  // Will be deprecated soon.
-  static Local<Number> 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<Integer> New(Isolate* isolate, int32_t value);
   static Local<Integer> NewFromUnsigned(Isolate* isolate, uint32_t value);
-  // Will be deprecated soon.
-  static Local<Integer> New(int32_t value, Isolate*);
-  static Local<Integer> NewFromUnsigned(uint32_t value, Isolate*);
-  static Local<Integer> New(int32_t value);
-  static Local<Integer> 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<Value> CallAsConstructor(int argc, Handle<Value> argv[]);
 
   static Local<Object> New(Isolate* isolate);
-  // Will be deprecated soon.
-  static Local<Object> New();
+
   V8_INLINE static Object* Cast(Value* obj);
 
  private:
@@ -3353,12 +3344,6 @@ class V8_EXPORT FunctionTemplate : public Template {
       Handle<Value> data = Handle<Value>(),
       Handle<Signature> signature = Handle<Signature>(),
       int length = 0);
-  // Will be deprecated soon.
-  static Local<FunctionTemplate> New(
-      FunctionCallback callback = 0,
-      Handle<Value> data = Handle<Value>(),
-      Handle<Signature> signature = Handle<Signature>(),
-      int length = 0);
 
   /** Returns the unique function instance in the current execution context.*/
   Local<Function> GetFunction();
@@ -5798,7 +5783,7 @@ void ReturnValue<T>::Set(int32_t i) {
     *value_ = I::IntToSmi(i);
     return;
   }
-  Set(Integer::New(i, GetIsolate()));
+  Set(Integer::New(GetIsolate(), i));
 }
 
 template<typename T>
@@ -5810,7 +5795,7 @@ void ReturnValue<T>::Set(uint32_t i) {
     Set(static_cast<int32_t>(i));
     return;
   }
-  Set(Integer::NewFromUnsigned(i, GetIsolate()));
+  Set(Integer::NewFromUnsigned(GetIsolate(), i));
 }
 
 template<typename T>
index c5023f8..5a35cb6 100644 (file)
@@ -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<i::Object> value = data[i].IsEmpty() ?
         i::Handle<i::Object>(isolate->factory()->undefined_value()) :
@@ -902,10 +902,11 @@ void Template::Set(v8::Handle<String> name,
   ENTER_V8(isolate);
   i::HandleScope scope(isolate);
   const int kSize = 3;
+  v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate);
   v8::Handle<v8::Data> 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<v8::Isolate*>(isolate);
   v8::Handle<v8::Data> 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> FunctionTemplate::New(
 }
 
 
-Local<FunctionTemplate> FunctionTemplate::New(
-    FunctionCallback callback,
-    v8::Handle<Value> data,
-    v8::Handle<Signature> signature,
-    int length) {
-  return New(Isolate::GetCurrent(), callback, data, signature, length);
-}
-
 Local<Signature> Signature::New(Isolate* isolate,
                                 Handle<FunctionTemplate> receiver, int argc,
                                 Handle<FunctionTemplate> argv[]) {
@@ -4116,10 +4110,11 @@ ScriptOrigin Function::GetScriptOrigin() const {
   if (func->shared()->script()->IsScript()) {
     i::Handle<i::Script> script(i::Script::cast(func->shared()->script()));
     i::Handle<i::Object> scriptName = GetScriptNameOrSourceURL(script);
+    v8::Isolate* isolate = reinterpret_cast<v8::Isolate*>(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<Value>());
@@ -5350,16 +5345,6 @@ void* External::Value() const {
 }
 
 
-Local<String> v8::String::Empty() {
-  i::Isolate* isolate = i::Isolate::Current();
-  if (!EnsureInitializedForIsolate(isolate, "v8::String::Empty()")) {
-    return v8::Local<String>();
-  }
-  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<String> 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> v8::Object::New(Isolate* isolate) {
 }
 
 
-Local<v8::Object> v8::Object::New() {
-  return New(Isolate::GetCurrent());
-}
-
-
 Local<v8::Value> v8::NumberObject::New(Isolate* isolate, double value) {
   i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
   EnsureInitializedForIsolate(i_isolate, "v8::NumberObject::New()");
@@ -6143,13 +6123,6 @@ Local<Private> v8::Private::New(
 }
 
 
-Local<Number> v8::Number::New(double value) {
-  i::Isolate* isolate = i::Isolate::Current();
-  EnsureInitializedForIsolate(isolate, "v8::Number::New()");
-  return Number::New(reinterpret_cast<Isolate*>(isolate), value);
-}
-
-
 Local<Number> v8::Number::New(Isolate* isolate, double value) {
   i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
   ASSERT(internal_isolate->IsInitialized());
@@ -6163,30 +6136,6 @@ Local<Number> v8::Number::New(Isolate* isolate, double value) {
 }
 
 
-Local<Integer> v8::Integer::New(int32_t value) {
-  i::Isolate* isolate = i::Isolate::UncheckedCurrent();
-  EnsureInitializedForIsolate(isolate, "v8::Integer::New()");
-  return v8::Integer::New(reinterpret_cast<Isolate*>(isolate), value);
-}
-
-
-Local<Integer> Integer::NewFromUnsigned(uint32_t value) {
-  i::Isolate* isolate = i::Isolate::Current();
-  EnsureInitializedForIsolate(isolate, "v8::Integer::NewFromUnsigned()");
-  return Integer::NewFromUnsigned(reinterpret_cast<Isolate*>(isolate), value);
-}
-
-
-Local<Integer> v8::Integer::New(int32_t value, Isolate* isolate) {
-  return Integer::New(isolate, value);
-}
-
-
-Local<Integer> v8::Integer::NewFromUnsigned(uint32_t value, Isolate* isolate) {
-  return Integer::NewFromUnsigned(isolate, value);
-}
-
-
 Local<Integer> v8::Integer::New(Isolate* isolate, int32_t value) {
   i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
   ASSERT(internal_isolate->IsInitialized());
@@ -6205,7 +6154,7 @@ Local<Integer> 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<int32_t>(value), isolate);
+    return Integer::New(isolate, static_cast<int32_t>(value));
   }
   ENTER_V8(internal_isolate);
   i::Handle<i::Object> result = internal_isolate->factory()->NewNumber(value);
index c0485c6..36ade48 100644 (file)
@@ -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<Value> arg(command_args->Get(Integer::New(j)));
+      Handle<Value> 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<Value> GetStdout(Isolate* isolate,
                                struct timeval& start_time,
                                int read_timeout,
                                int total_timeout) {
-  Handle<String> accumulator = String::Empty();
+  Handle<String> accumulator = String::Empty(isolate);
 
   int fullness = 0;
   static const int kStdoutReadBufferSize = 4096;
index 767c9e7..a2e07ef 100644 (file)
@@ -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<double>(value)));
+              v8::Number::New(isolate, static_cast<double>(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<double>(value)));
+              v8::Number::New(isolate, static_cast<double>(value)));
 }
 
 
@@ -82,7 +82,7 @@ void StatisticsExtension::GetCounters(
   }
 
   Counters* counters = isolate->counters();
-  v8::Local<v8::Object> result = v8::Object::New();
+  v8::Local<v8::Object> result = v8::Object::New(args.GetIsolate());
 
 #define ADD_COUNTER(name, caption)                                            \
   AddCounter(args.GetIsolate(), result, counters->name(), #name);
index 40e9b9a..7b44a98 100644 (file)
@@ -289,7 +289,7 @@ class LocalContext {
 };
 
 static inline v8::Local<v8::Value> 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<v8::Value> 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();
 }
index 7b0b099..193b1ce 100644 (file)
@@ -39,9 +39,11 @@ const char* ProfilerExtension::kSource =
 v8::Handle<v8::FunctionTemplate> ProfilerExtension::GetNativeFunctionTemplate(
     v8::Isolate* isolate, v8::Handle<v8::String> 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<v8::FunctionTemplate>();
index ba71600..a478c8a 100644 (file)
@@ -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<v8::Array> array = v8::Handle<v8::Array>::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<Value> entry = array->Get(v8::Integer::New(i));
-    CHECK_EQ(v8::Integer::New(i), entry);
+    v8::Handle<Value> entry = array->Get(v8::Integer::New(isolate, i));
+    CHECK_EQ(v8::Integer::New(isolate, i), entry);
   }
 }
 
@@ -524,7 +524,7 @@ static void AllocateHandles(Local<String> name,
   for (int i = 0; i < i::kHandleBlockSize + 1; i++) {
     v8::Local<v8::Value>::New(info.GetIsolate(), name);
   }
-  info.GetReturnValue().Set(v8::Integer::New(100));
+  info.GetReturnValue().Set(v8::Integer::New(info.GetIsolate(), 100));
 }
 
 
index 916a1d7..eeb7865 100644 (file)
@@ -153,7 +153,7 @@ static void IncrementingSignatureCallback(
   v8::Handle<v8::Array> 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<v8::Array> 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<v8::Object> obj = v8::Object::New();
+  Local<v8::Object> obj = v8::Object::New(isolate);
   Local<Value> foo_before = obj->Get(v8_str("foo"));
   CHECK(foo_before->IsUndefined());
   Local<String> bar_str = v8_str("bar");
@@ -426,7 +426,7 @@ THREADED_TEST(Access) {
 THREADED_TEST(AccessElement) {
   LocalContext env;
   v8::HandleScope scope(env->GetIsolate());
-  Local<v8::Object> obj = v8::Object::New();
+  Local<v8::Object> obj = v8::Object::New(env->GetIsolate());
   Local<Value> before = obj->Get(1);
   CHECK(before->IsUndefined());
   Local<String> bar_str = v8_str("bar");
@@ -1199,7 +1199,9 @@ template<>
 void FastReturnValueCallback<Object>(
     const v8::FunctionCallbackInfo<v8::Value>& info) {
   v8::Handle<v8::Object> 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<v8::Value> data =
       v8::External::New(isolate, expected_ptr);
 
-  v8::Handle<v8::Object> obj = v8::Object::New();
+  v8::Handle<v8::Object> 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<v8::Integer> value_obj = v8::Integer::New(value);
+  Local<v8::Integer> value_obj = v8::Integer::New(isolate, value);
   CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
 
-  value_obj = v8::Integer::New(value, isolate);
+  value_obj = v8::Integer::New(isolate, value);
   CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
 }
 
@@ -1469,10 +1471,10 @@ THREADED_TEST(BigSmiInteger) {
     CHECK(i::Smi::IsValid(value));
     CHECK(!i::Smi::IsValid(value + 1));
 
-    Local<v8::Integer> value_obj = v8::Integer::New(value);
+    Local<v8::Integer> value_obj = v8::Integer::New(isolate, value);
     CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
 
-    value_obj = v8::Integer::New(value, isolate);
+    value_obj = v8::Integer::New(isolate, value);
     CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
   }
 }
@@ -1492,10 +1494,10 @@ THREADED_TEST(BigInteger) {
     CHECK(value > i::Smi::kMaxValue);
     CHECK(!i::Smi::IsValid(value));
 
-    Local<v8::Integer> value_obj = v8::Integer::New(value);
+    Local<v8::Integer> value_obj = v8::Integer::New(isolate, value);
     CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
 
-    value_obj = v8::Integer::New(value, isolate);
+    value_obj = v8::Integer::New(isolate, value);
     CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
   }
 }
@@ -1508,10 +1510,10 @@ THREADED_TEST(TinyUnsignedInteger) {
 
   uint32_t value = 239;
 
-  Local<v8::Integer> value_obj = v8::Integer::NewFromUnsigned(value);
+  Local<v8::Integer> value_obj = v8::Integer::NewFromUnsigned(isolate, value);
   CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
 
-  value_obj = v8::Integer::NewFromUnsigned(value, isolate);
+  value_obj = v8::Integer::NewFromUnsigned(isolate, value);
   CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
 }
 
@@ -1525,10 +1527,10 @@ THREADED_TEST(BigUnsignedSmiInteger) {
   CHECK(i::Smi::IsValid(value));
   CHECK(!i::Smi::IsValid(value + 1));
 
-  Local<v8::Integer> value_obj = v8::Integer::NewFromUnsigned(value);
+  Local<v8::Integer> value_obj = v8::Integer::NewFromUnsigned(isolate, value);
   CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
 
-  value_obj = v8::Integer::NewFromUnsigned(value, isolate);
+  value_obj = v8::Integer::NewFromUnsigned(isolate, value);
   CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
 }
 
@@ -1542,10 +1544,10 @@ THREADED_TEST(BigUnsignedInteger) {
   CHECK(value > static_cast<uint32_t>(i::Smi::kMaxValue));
   CHECK(!i::Smi::IsValid(value));
 
-  Local<v8::Integer> value_obj = v8::Integer::NewFromUnsigned(value);
+  Local<v8::Integer> value_obj = v8::Integer::NewFromUnsigned(isolate, value);
   CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
 
-  value_obj = v8::Integer::NewFromUnsigned(value, isolate);
+  value_obj = v8::Integer::NewFromUnsigned(isolate, value);
   CHECK_EQ(static_cast<int64_t>(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<v8::Integer> value_obj = v8::Integer::NewFromUnsigned(value);
+  Local<v8::Integer> value_obj = v8::Integer::NewFromUnsigned(isolate, value);
   CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
 
-  value_obj = v8::Integer::NewFromUnsigned(value, isolate);
+  value_obj = v8::Integer::NewFromUnsigned(isolate, value);
   CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
 }
 
@@ -1708,7 +1710,7 @@ THREADED_TEST(Number) {
   LocalContext env;
   v8::HandleScope scope(env->GetIsolate());
   double PI = 3.1415926;
-  Local<v8::Number> pi_obj = v8::Number::New(PI);
+  Local<v8::Number> 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<Value> date = v8::Date::New(env->GetIsolate(), PI);
   CHECK_EQ(3.0, date->NumberValue());
-  date.As<v8::Date>()->Set(v8_str("property"), v8::Integer::New(42));
+  date.As<v8::Date>()->Set(v8_str("property"),
+                           v8::Integer::New(env->GetIsolate(), 42));
   CHECK_EQ(42, date.As<v8::Date>()->Get(v8_str("property"))->Int32Value());
 }
 
 
 THREADED_TEST(Boolean) {
   LocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
-  v8::Handle<v8::Boolean> t = v8::True(CcTest::isolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
+  v8::Handle<v8::Boolean> t = v8::True(isolate);
   CHECK(t->Value());
-  v8::Handle<v8::Boolean> f = v8::False(CcTest::isolate());
+  v8::Handle<v8::Boolean> f = v8::False(isolate);
   CHECK(!f->Value());
-  v8::Handle<v8::Primitive> u = v8::Undefined(CcTest::isolate());
+  v8::Handle<v8::Primitive> u = v8::Undefined(isolate);
   CHECK(!u->BooleanValue());
-  v8::Handle<v8::Primitive> n = v8::Null(CcTest::isolate());
+  v8::Handle<v8::Primitive> n = v8::Null(isolate);
   CHECK(!n->BooleanValue());
   v8::Handle<String> str1 = v8_str("");
   CHECK(!str1->BooleanValue());
   v8::Handle<String> 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<Value> 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<Script>();
 
-  env->Global()->Set(v8_str("depth"), v8::Integer::New(0));
+  env->Global()->Set(v8_str("depth"), v8::Integer::New(isolate, 0));
   Script::Compile(v8_str("callFunctionRecursively()"))->Run();
 }
 
@@ -2656,36 +2662,38 @@ static void CheckEmbedderData(LocalContext* env,
 
 THREADED_TEST(EmbedderData) {
   LocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
 
   CheckEmbedderData(
       &env, 3,
-      v8::String::NewFromUtf8(env->GetIsolate(), "The quick brown fox jumps"));
-  CheckEmbedderData(&env, 2, v8::String::NewFromUtf8(env->GetIsolate(),
+      v8::String::NewFromUtf8(isolate, "The quick brown fox jumps"));
+  CheckEmbedderData(&env, 2, v8::String::NewFromUtf8(isolate,
                                                      "over the lazy dog."));
-  CheckEmbedderData(&env, 1, v8::Number::New(1.2345));
-  CheckEmbedderData(&env, 0, v8::Boolean::New(env->GetIsolate(), true));
+  CheckEmbedderData(&env, 1, v8::Number::New(isolate, 1.2345));
+  CheckEmbedderData(&env, 0, v8::Boolean::New(isolate, true));
 }
 
 
 THREADED_TEST(IdentityHash) {
   LocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
 
   // Ensure that the test starts with an fresh heap to test whether the hash
   // code is based on the address.
   CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags);
-  Local<v8::Object> obj = v8::Object::New();
+  Local<v8::Object> obj = v8::Object::New(isolate);
   int hash = obj->GetIdentityHash();
   int hash1 = obj->GetIdentityHash();
   CHECK_EQ(hash, hash1);
-  int hash2 = v8::Object::New()->GetIdentityHash();
+  int hash2 = v8::Object::New(isolate)->GetIdentityHash();
   // Since the identity hash is essentially a random number two consecutive
   // objects should not be assigned the same hash code. If the test below fails
   // the random number generator should be evaluated.
   CHECK_NE(hash, hash2);
   CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags);
-  int hash3 = v8::Object::New()->GetIdentityHash();
+  int hash3 = v8::Object::New(isolate)->GetIdentityHash();
   // Make sure that the identity hash is not based on the initial address of
   // the object alone. If the test below fails the random number generator
   // should be evaluated.
@@ -2697,16 +2705,16 @@ THREADED_TEST(IdentityHash) {
   // Put a getter for 'v8::IdentityHash' on the Object's prototype:
   {
     CompileRun("Object.prototype['v8::IdentityHash'] = 42;\n");
-    Local<v8::Object> o1 = v8::Object::New();
-    Local<v8::Object> o2 = v8::Object::New();
+    Local<v8::Object> o1 = v8::Object::New(isolate);
+    Local<v8::Object> o2 = v8::Object::New(isolate);
     CHECK_NE(o1->GetIdentityHash(), o2->GetIdentityHash());
   }
   {
     CompileRun(
         "function cnst() { return 42; };\n"
         "Object.prototype.__defineGetter__('v8::IdentityHash', cnst);\n");
-    Local<v8::Object> o1 = v8::Object::New();
-    Local<v8::Object> o2 = v8::Object::New();
+    Local<v8::Object> o1 = v8::Object::New(isolate);
+    Local<v8::Object> o2 = v8::Object::New(isolate);
     CHECK_NE(o1->GetIdentityHash(), o2->GetIdentityHash());
   }
 }
@@ -2719,7 +2727,7 @@ THREADED_TEST(SymbolProperties) {
   v8::Isolate* isolate = env->GetIsolate();
   v8::HandleScope scope(isolate);
 
-  v8::Local<v8::Object> obj = v8::Object::New();
+  v8::Local<v8::Object> obj = v8::Object::New(isolate);
   v8::Local<v8::Symbol> sym1 = v8::Symbol::New(isolate);
   v8::Local<v8::Symbol> sym2 = v8::Symbol::New(isolate, "my-symbol");
 
@@ -2760,18 +2768,18 @@ THREADED_TEST(SymbolProperties) {
   CHECK(obj->Delete(sym1));
   CHECK(!obj->Has(sym1));
 
-  CHECK(obj->Set(sym1, v8::Integer::New(1503)));
+  CHECK(obj->Set(sym1, v8::Integer::New(isolate, 1503)));
   CHECK(obj->Has(sym1));
   CHECK_EQ(1503, obj->Get(sym1)->Int32Value());
-  CHECK(obj->Set(sym1, v8::Integer::New(2002)));
+  CHECK(obj->Set(sym1, v8::Integer::New(isolate, 2002)));
   CHECK(obj->Has(sym1));
   CHECK_EQ(2002, obj->Get(sym1)->Int32Value());
   CHECK_EQ(v8::None, obj->GetPropertyAttributes(sym1));
 
   CHECK_EQ(0, obj->GetOwnPropertyNames()->Length());
   int num_props = obj->GetPropertyNames()->Length();
-  CHECK(
-      obj->Set(v8::String::NewFromUtf8(isolate, "bla"), v8::Integer::New(20)));
+  CHECK(obj->Set(v8::String::NewFromUtf8(isolate, "bla"),
+                 v8::Integer::New(isolate, 20)));
   CHECK_EQ(1, obj->GetOwnPropertyNames()->Length());
   CHECK_EQ(num_props + 1, obj->GetPropertyNames()->Length());
 
@@ -2779,7 +2787,7 @@ THREADED_TEST(SymbolProperties) {
 
   // Add another property and delete it afterwards to force the object in
   // slow case.
-  CHECK(obj->Set(sym2, v8::Integer::New(2008)));
+  CHECK(obj->Set(sym2, v8::Integer::New(isolate, 2008)));
   CHECK_EQ(2002, obj->Get(sym1)->Int32Value());
   CHECK_EQ(2008, obj->Get(sym2)->Int32Value());
   CHECK_EQ(2002, obj->Get(sym1)->Int32Value());
@@ -2794,7 +2802,7 @@ THREADED_TEST(SymbolProperties) {
   CHECK_EQ(1, obj->GetOwnPropertyNames()->Length());
 
   // Symbol properties are inherited.
-  v8::Local<v8::Object> child = v8::Object::New();
+  v8::Local<v8::Object> child = v8::Object::New(isolate);
   child->SetPrototype(obj);
   CHECK(child->Has(sym1));
   CHECK_EQ(2002, child->Get(sym1)->Int32Value());
@@ -2807,7 +2815,7 @@ THREADED_TEST(PrivateProperties) {
   v8::Isolate* isolate = env->GetIsolate();
   v8::HandleScope scope(isolate);
 
-  v8::Local<v8::Object> obj = v8::Object::New();
+  v8::Local<v8::Object> obj = v8::Object::New(isolate);
   v8::Local<v8::Private> priv1 = v8::Private::New(isolate);
   v8::Local<v8::Private> priv2 = v8::Private::New(isolate, "my-private");
 
@@ -2819,17 +2827,17 @@ THREADED_TEST(PrivateProperties) {
   CHECK(obj->DeletePrivate(priv1));
   CHECK(!obj->HasPrivate(priv1));
 
-  CHECK(obj->SetPrivate(priv1, v8::Integer::New(1503)));
+  CHECK(obj->SetPrivate(priv1, v8::Integer::New(isolate, 1503)));
   CHECK(obj->HasPrivate(priv1));
   CHECK_EQ(1503, obj->GetPrivate(priv1)->Int32Value());
-  CHECK(obj->SetPrivate(priv1, v8::Integer::New(2002)));
+  CHECK(obj->SetPrivate(priv1, v8::Integer::New(isolate, 2002)));
   CHECK(obj->HasPrivate(priv1));
   CHECK_EQ(2002, obj->GetPrivate(priv1)->Int32Value());
 
   CHECK_EQ(0, obj->GetOwnPropertyNames()->Length());
   int num_props = obj->GetPropertyNames()->Length();
-  CHECK(
-      obj->Set(v8::String::NewFromUtf8(isolate, "bla"), v8::Integer::New(20)));
+  CHECK(obj->Set(v8::String::NewFromUtf8(isolate, "bla"),
+                 v8::Integer::New(isolate, 20)));
   CHECK_EQ(1, obj->GetOwnPropertyNames()->Length());
   CHECK_EQ(num_props + 1, obj->GetPropertyNames()->Length());
 
@@ -2837,7 +2845,7 @@ THREADED_TEST(PrivateProperties) {
 
   // Add another property and delete it afterwards to force the object in
   // slow case.
-  CHECK(obj->SetPrivate(priv2, v8::Integer::New(2008)));
+  CHECK(obj->SetPrivate(priv2, v8::Integer::New(isolate, 2008)));
   CHECK_EQ(2002, obj->GetPrivate(priv1)->Int32Value());
   CHECK_EQ(2008, obj->GetPrivate(priv2)->Int32Value());
   CHECK_EQ(2002, obj->GetPrivate(priv1)->Int32Value());
@@ -2852,7 +2860,7 @@ THREADED_TEST(PrivateProperties) {
   CHECK_EQ(1, obj->GetOwnPropertyNames()->Length());
 
   // Private properties are inherited (for the time being).
-  v8::Local<v8::Object> child = v8::Object::New();
+  v8::Local<v8::Object> child = v8::Object::New(isolate);
   child->SetPrototype(obj);
   CHECK(child->HasPrivate(priv1));
   CHECK_EQ(2002, child->GetPrivate(priv1)->Int32Value());
@@ -3126,9 +3134,10 @@ THREADED_TEST(ArrayBuffer_NeuteringScript) {
 
 THREADED_TEST(HiddenProperties) {
   LocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
 
-  v8::Local<v8::Object> obj = v8::Object::New();
+  v8::Local<v8::Object> obj = v8::Object::New(env->GetIsolate());
   v8::Local<v8::String> key = v8_str("api-test::hidden-key");
   v8::Local<v8::String> empty = v8_str("");
   v8::Local<v8::String> prop_name = v8_str("prop_name");
@@ -3138,9 +3147,9 @@ THREADED_TEST(HiddenProperties) {
   // Make sure delete of a non-existent hidden value works
   CHECK(obj->DeleteHiddenValue(key));
 
-  CHECK(obj->SetHiddenValue(key, v8::Integer::New(1503)));
+  CHECK(obj->SetHiddenValue(key, v8::Integer::New(isolate, 1503)));
   CHECK_EQ(1503, obj->GetHiddenValue(key)->Int32Value());
-  CHECK(obj->SetHiddenValue(key, v8::Integer::New(2002)));
+  CHECK(obj->SetHiddenValue(key, v8::Integer::New(isolate, 2002)));
   CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value());
 
   CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags);
@@ -3150,7 +3159,7 @@ THREADED_TEST(HiddenProperties) {
   CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value());
   CHECK(obj->Get(empty)->IsUndefined());
   CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value());
-  CHECK(obj->Set(empty, v8::Integer::New(2003)));
+  CHECK(obj->Set(empty, v8::Integer::New(isolate, 2003)));
   CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value());
   CHECK_EQ(2003, obj->Get(empty)->Int32Value());
 
@@ -3158,7 +3167,7 @@ THREADED_TEST(HiddenProperties) {
 
   // Add another property and delete it afterwards to force the object in
   // slow case.
-  CHECK(obj->Set(prop_name, v8::Integer::New(2008)));
+  CHECK(obj->Set(prop_name, v8::Integer::New(isolate, 2008)));
   CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value());
   CHECK_EQ(2008, obj->Get(prop_name)->Int32Value());
   CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value());
@@ -3170,7 +3179,7 @@ THREADED_TEST(HiddenProperties) {
   CHECK(obj->SetHiddenValue(key, Handle<Value>()));
   CHECK(obj->GetHiddenValue(key).IsEmpty());
 
-  CHECK(obj->SetHiddenValue(key, v8::Integer::New(2002)));
+  CHECK(obj->SetHiddenValue(key, v8::Integer::New(isolate, 2002)));
   CHECK(obj->DeleteHiddenValue(key));
   CHECK(obj->GetHiddenValue(key).IsEmpty());
 }
@@ -3183,7 +3192,7 @@ THREADED_TEST(Regress97784) {
   LocalContext env;
   v8::HandleScope scope(env->GetIsolate());
 
-  v8::Local<v8::Object> obj = v8::Object::New();
+  v8::Local<v8::Object> obj = v8::Object::New(env->GetIsolate());
   v8::Local<v8::String> key = v8_str("hidden");
 
   CompileRun(
@@ -3198,7 +3207,7 @@ THREADED_TEST(Regress97784) {
   // Make sure that the getter and setter from Object.prototype is not invoked.
   // If it did we would have full access to the hidden properties in
   // the accessor.
-  CHECK(obj->SetHiddenValue(key, v8::Integer::New(42)));
+  CHECK(obj->SetHiddenValue(key, v8::Integer::New(env->GetIsolate(), 42)));
   ExpectFalse("set_called");
   CHECK_EQ(42, obj->GetHiddenValue(key)->Int32Value());
 }
@@ -3226,7 +3235,7 @@ THREADED_TEST(HiddenPropertiesWithInterceptors) {
   instance_templ->SetNamedPropertyHandler(InterceptorForHiddenProperties);
   Local<v8::Function> function = fun_templ->GetFunction();
   Local<v8::Object> obj = function->NewInstance();
-  CHECK(obj->SetHiddenValue(key, v8::Integer::New(2302)));
+  CHECK(obj->SetHiddenValue(key, v8::Integer::New(isolate, 2302)));
   CHECK_EQ(2302, obj->GetHiddenValue(key)->Int32Value());
   CHECK(!interceptor_for_hidden_properties_called);
 }
@@ -3518,16 +3527,16 @@ THREADED_TEST(ApiObjectGroups) {
 
   {
     HandleScope scope(iso);
-    g1s1.handle.Reset(iso, Object::New());
-    g1s2.handle.Reset(iso, Object::New());
-    g1c1.handle.Reset(iso, Object::New());
+    g1s1.handle.Reset(iso, Object::New(iso));
+    g1s2.handle.Reset(iso, Object::New(iso));
+    g1c1.handle.Reset(iso, Object::New(iso));
     g1s1.handle.SetWeak(&g1s1, &WeakPointerCallback);
     g1s2.handle.SetWeak(&g1s2, &WeakPointerCallback);
     g1c1.handle.SetWeak(&g1c1, &WeakPointerCallback);
 
-    g2s1.handle.Reset(iso, Object::New());
-    g2s2.handle.Reset(iso, Object::New());
-    g2c1.handle.Reset(iso, Object::New());
+    g2s1.handle.Reset(iso, Object::New(iso));
+    g2s2.handle.Reset(iso, Object::New(iso));
+    g2c1.handle.Reset(iso, Object::New(iso));
     g2s1.handle.SetWeak(&g2s1, &WeakPointerCallback);
     g2s2.handle.SetWeak(&g2s2, &WeakPointerCallback);
     g2c1.handle.SetWeak(&g2c1, &WeakPointerCallback);
@@ -3612,14 +3621,14 @@ THREADED_TEST(ApiObjectGroupsForSubtypes) {
 
   {
     HandleScope scope(iso);
-    g1s1.handle.Reset(iso, Object::New());
+    g1s1.handle.Reset(iso, Object::New(iso));
     g1s2.handle.Reset(iso, String::NewFromUtf8(iso, "foo1"));
     g1c1.handle.Reset(iso, String::NewFromUtf8(iso, "foo2"));
     g1s1.handle.SetWeak(&g1s1, &WeakPointerCallback);
     g1s2.handle.SetWeak(&g1s2, &WeakPointerCallback);
     g1c1.handle.SetWeak(&g1c1, &WeakPointerCallback);
 
-    g2s1.handle.Reset(iso, Object::New());
+    g2s1.handle.Reset(iso, Object::New(iso));
     g2s2.handle.Reset(iso, String::NewFromUtf8(iso, "foo3"));
     g2c1.handle.Reset(iso, String::NewFromUtf8(iso, "foo4"));
     g2s1.handle.SetWeak(&g2s1, &WeakPointerCallback);
@@ -3708,29 +3717,29 @@ THREADED_TEST(ApiObjectGroupsCycle) {
 
   {
     HandleScope scope(iso);
-    g1s1.handle.Reset(iso, Object::New());
-    g1s2.handle.Reset(iso, Object::New());
+    g1s1.handle.Reset(iso, Object::New(iso));
+    g1s2.handle.Reset(iso, Object::New(iso));
     g1s1.handle.SetWeak(&g1s1, &WeakPointerCallback);
     g1s2.handle.SetWeak(&g1s2, &WeakPointerCallback);
     CHECK(g1s1.handle.IsWeak());
     CHECK(g1s2.handle.IsWeak());
 
-    g2s1.handle.Reset(iso, Object::New());
-    g2s2.handle.Reset(iso, Object::New());
+    g2s1.handle.Reset(iso, Object::New(iso));
+    g2s2.handle.Reset(iso, Object::New(iso));
     g2s1.handle.SetWeak(&g2s1, &WeakPointerCallback);
     g2s2.handle.SetWeak(&g2s2, &WeakPointerCallback);
     CHECK(g2s1.handle.IsWeak());
     CHECK(g2s2.handle.IsWeak());
 
-    g3s1.handle.Reset(iso, Object::New());
-    g3s2.handle.Reset(iso, Object::New());
+    g3s1.handle.Reset(iso, Object::New(iso));
+    g3s2.handle.Reset(iso, Object::New(iso));
     g3s1.handle.SetWeak(&g3s1, &WeakPointerCallback);
     g3s2.handle.SetWeak(&g3s2, &WeakPointerCallback);
     CHECK(g3s1.handle.IsWeak());
     CHECK(g3s2.handle.IsWeak());
 
-    g4s1.handle.Reset(iso, Object::New());
-    g4s2.handle.Reset(iso, Object::New());
+    g4s1.handle.Reset(iso, Object::New(iso));
+    g4s2.handle.Reset(iso, Object::New(iso));
     g4s1.handle.SetWeak(&g4s1, &WeakPointerCallback);
     g4s2.handle.SetWeak(&g4s2, &WeakPointerCallback);
     CHECK(g4s1.handle.IsWeak());
@@ -3819,18 +3828,18 @@ TEST(ApiObjectGroupsCycleForScavenger) {
 
   {
     HandleScope scope(iso);
-    g1s1.handle.Reset(iso, Object::New());
-    g1s2.handle.Reset(iso, Object::New());
+    g1s1.handle.Reset(iso, Object::New(iso));
+    g1s2.handle.Reset(iso, Object::New(iso));
     g1s1.handle.SetWeak(&g1s1, &WeakPointerCallback);
     g1s2.handle.SetWeak(&g1s2, &WeakPointerCallback);
 
-    g2s1.handle.Reset(iso, Object::New());
-    g2s2.handle.Reset(iso, Object::New());
+    g2s1.handle.Reset(iso, Object::New(iso));
+    g2s2.handle.Reset(iso, Object::New(iso));
     g2s1.handle.SetWeak(&g2s1, &WeakPointerCallback);
     g2s2.handle.SetWeak(&g2s2, &WeakPointerCallback);
 
-    g3s1.handle.Reset(iso, Object::New());
-    g3s2.handle.Reset(iso, Object::New());
+    g3s1.handle.Reset(iso, Object::New(iso));
+    g3s2.handle.Reset(iso, Object::New(iso));
     g3s1.handle.SetWeak(&g3s1, &WeakPointerCallback);
     g3s2.handle.SetWeak(&g3s2, &WeakPointerCallback);
   }
@@ -3948,8 +3957,8 @@ THREADED_TEST(MessageHandler0) {
   message_received = false;
   v8::HandleScope scope(CcTest::isolate());
   CHECK(!message_received);
-  v8::V8::AddMessageListener(check_message_0, v8_num(5.76));
   LocalContext context;
+  v8::V8::AddMessageListener(check_message_0, v8_num(5.76));
   v8::ScriptOrigin origin =
       v8::ScriptOrigin(v8_str("6.75"));
   v8::Handle<v8::Script> script = Script::Compile(v8_str("throw 'error'"),
@@ -4030,8 +4039,8 @@ TEST(MessageHandler3) {
   LocalContext context;
   v8::ScriptOrigin origin =
       v8::ScriptOrigin(v8_str("6.75"),
-                       v8::Integer::New(1, isolate),
-                       v8::Integer::New(2, isolate),
+                       v8::Integer::New(isolate, 1),
+                       v8::Integer::New(isolate, 2),
                        v8::True(isolate));
   v8::Handle<v8::Script> script = Script::Compile(v8_str("throw 'error'"),
                                                   &origin);
@@ -4059,8 +4068,8 @@ TEST(MessageHandler4) {
   LocalContext context;
   v8::ScriptOrigin origin =
       v8::ScriptOrigin(v8_str("6.75"),
-                       v8::Integer::New(1, isolate),
-                       v8::Integer::New(2, isolate),
+                       v8::Integer::New(isolate, 1),
+                       v8::Integer::New(isolate, 2),
                        v8::False(isolate));
   v8::Handle<v8::Script> script = Script::Compile(v8_str("throw 'error'"),
                                                   &origin);
@@ -4096,8 +4105,8 @@ TEST(MessageHandler5) {
   LocalContext context;
   v8::ScriptOrigin origin =
       v8::ScriptOrigin(v8_str("6.75"),
-                       v8::Integer::New(1, isolate),
-                       v8::Integer::New(2, isolate),
+                       v8::Integer::New(isolate, 1),
+                       v8::Integer::New(isolate, 2),
                        v8::True(isolate));
   v8::Handle<v8::Script> script = Script::Compile(v8_str("throw 'error'"),
                                                   &origin);
@@ -4110,8 +4119,8 @@ TEST(MessageHandler5) {
   v8::V8::AddMessageListener(check_message_5b);
   origin =
       v8::ScriptOrigin(v8_str("6.75"),
-                       v8::Integer::New(1, isolate),
-                       v8::Integer::New(2, isolate),
+                       v8::Integer::New(isolate, 1),
+                       v8::Integer::New(isolate, 2),
                        v8::False(isolate));
   script = Script::Compile(v8_str("throw 'error'"),
                            &origin);
@@ -4124,10 +4133,11 @@ TEST(MessageHandler5) {
 
 THREADED_TEST(GetSetProperty) {
   LocalContext context;
-  v8::HandleScope scope(context->GetIsolate());
+  v8::Isolate* isolate = context->GetIsolate();
+  v8::HandleScope scope(isolate);
   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));
+  context->Global()->Set(v8::Integer::New(isolate, 16), v8_num(32));
   context->Global()->Set(v8_num(13), v8_num(56));
   Local<Value> foo = Script::Compile(v8_str("this.foo"))->Run();
   CHECK_EQ(14, foo->Int32Value());
@@ -4137,13 +4147,16 @@ THREADED_TEST(GetSetProperty) {
   CHECK_EQ(32, sixteen->Int32Value());
   Local<Value> thirteen = Script::Compile(v8_str("this[13]"))->Run();
   CHECK_EQ(56, thirteen->Int32Value());
-  CHECK_EQ(92, context->Global()->Get(v8::Integer::New(12))->Int32Value());
+  CHECK_EQ(92,
+           context->Global()->Get(v8::Integer::New(isolate, 12))->Int32Value());
   CHECK_EQ(92, context->Global()->Get(v8_str("12"))->Int32Value());
   CHECK_EQ(92, context->Global()->Get(v8_num(12))->Int32Value());
-  CHECK_EQ(32, context->Global()->Get(v8::Integer::New(16))->Int32Value());
+  CHECK_EQ(32,
+           context->Global()->Get(v8::Integer::New(isolate, 16))->Int32Value());
   CHECK_EQ(32, context->Global()->Get(v8_str("16"))->Int32Value());
   CHECK_EQ(32, context->Global()->Get(v8_num(16))->Int32Value());
-  CHECK_EQ(56, context->Global()->Get(v8::Integer::New(13))->Int32Value());
+  CHECK_EQ(56,
+           context->Global()->Get(v8::Integer::New(isolate, 13))->Int32Value());
   CHECK_EQ(56, context->Global()->Get(v8_str("13"))->Int32Value());
   CHECK_EQ(56, context->Global()->Get(v8_num(13))->Int32Value());
 }
@@ -4303,23 +4316,23 @@ THREADED_TEST(FunctionCall) {
   v8::Handle<Value> args1[] = { v8_num(1.1) };
   Local<v8::Array> a1 = Local<v8::Array>::Cast(Foo->Call(Foo, 1, args1));
   CHECK_EQ(1, a1->Length());
-  CHECK_EQ(1.1, a1->Get(v8::Integer::New(0))->NumberValue());
+  CHECK_EQ(1.1, a1->Get(v8::Integer::New(isolate, 0))->NumberValue());
 
   v8::Handle<Value> args2[] = { v8_num(2.2),
                                 v8_num(3.3) };
   Local<v8::Array> a2 = Local<v8::Array>::Cast(Foo->Call(Foo, 2, args2));
   CHECK_EQ(2, a2->Length());
-  CHECK_EQ(2.2, a2->Get(v8::Integer::New(0))->NumberValue());
-  CHECK_EQ(3.3, a2->Get(v8::Integer::New(1))->NumberValue());
+  CHECK_EQ(2.2, a2->Get(v8::Integer::New(isolate, 0))->NumberValue());
+  CHECK_EQ(3.3, a2->Get(v8::Integer::New(isolate, 1))->NumberValue());
 
   v8::Handle<Value> args3[] = { v8_num(4.4),
                                 v8_num(5.5),
                                 v8_num(6.6) };
   Local<v8::Array> a3 = Local<v8::Array>::Cast(Foo->Call(Foo, 3, args3));
   CHECK_EQ(3, a3->Length());
-  CHECK_EQ(4.4, a3->Get(v8::Integer::New(0))->NumberValue());
-  CHECK_EQ(5.5, a3->Get(v8::Integer::New(1))->NumberValue());
-  CHECK_EQ(6.6, a3->Get(v8::Integer::New(2))->NumberValue());
+  CHECK_EQ(4.4, a3->Get(v8::Integer::New(isolate, 0))->NumberValue());
+  CHECK_EQ(5.5, a3->Get(v8::Integer::New(isolate, 1))->NumberValue());
+  CHECK_EQ(6.6, a3->Get(v8::Integer::New(isolate, 2))->NumberValue());
 
   v8::Handle<Value> args4[] = { v8_num(7.7),
                                 v8_num(8.8),
@@ -4327,10 +4340,10 @@ THREADED_TEST(FunctionCall) {
                                 v8_num(10.11) };
   Local<v8::Array> a4 = Local<v8::Array>::Cast(Foo->Call(Foo, 4, args4));
   CHECK_EQ(4, a4->Length());
-  CHECK_EQ(7.7, a4->Get(v8::Integer::New(0))->NumberValue());
-  CHECK_EQ(8.8, a4->Get(v8::Integer::New(1))->NumberValue());
-  CHECK_EQ(9.9, a4->Get(v8::Integer::New(2))->NumberValue());
-  CHECK_EQ(10.11, a4->Get(v8::Integer::New(3))->NumberValue());
+  CHECK_EQ(7.7, a4->Get(v8::Integer::New(isolate, 0))->NumberValue());
+  CHECK_EQ(8.8, a4->Get(v8::Integer::New(isolate, 1))->NumberValue());
+  CHECK_EQ(9.9, a4->Get(v8::Integer::New(isolate, 2))->NumberValue());
+  CHECK_EQ(10.11, a4->Get(v8::Integer::New(isolate, 3))->NumberValue());
 
   Local<v8::Value> r1 = ReturnThisSloppy->Call(v8::Undefined(isolate), 0, NULL);
   CHECK(r1->StrictEquals(context->Global()));
@@ -4467,7 +4480,8 @@ TEST(HugeConsStringOutOfMemory) {
 
 THREADED_TEST(ConstructCall) {
   LocalContext context;
-  v8::HandleScope scope(context->GetIsolate());
+  v8::Isolate* isolate = context->GetIsolate();
+  v8::HandleScope scope(isolate);
   CompileRun(
     "function Foo() {"
     "  var result = [];"
@@ -4486,23 +4500,23 @@ THREADED_TEST(ConstructCall) {
   v8::Handle<Value> args1[] = { v8_num(1.1) };
   Local<v8::Array> a1 = Local<v8::Array>::Cast(Foo->NewInstance(1, args1));
   CHECK_EQ(1, a1->Length());
-  CHECK_EQ(1.1, a1->Get(v8::Integer::New(0))->NumberValue());
+  CHECK_EQ(1.1, a1->Get(v8::Integer::New(isolate, 0))->NumberValue());
 
   v8::Handle<Value> args2[] = { v8_num(2.2),
                                 v8_num(3.3) };
   Local<v8::Array> a2 = Local<v8::Array>::Cast(Foo->NewInstance(2, args2));
   CHECK_EQ(2, a2->Length());
-  CHECK_EQ(2.2, a2->Get(v8::Integer::New(0))->NumberValue());
-  CHECK_EQ(3.3, a2->Get(v8::Integer::New(1))->NumberValue());
+  CHECK_EQ(2.2, a2->Get(v8::Integer::New(isolate, 0))->NumberValue());
+  CHECK_EQ(3.3, a2->Get(v8::Integer::New(isolate, 1))->NumberValue());
 
   v8::Handle<Value> args3[] = { v8_num(4.4),
                                 v8_num(5.5),
                                 v8_num(6.6) };
   Local<v8::Array> a3 = Local<v8::Array>::Cast(Foo->NewInstance(3, args3));
   CHECK_EQ(3, a3->Length());
-  CHECK_EQ(4.4, a3->Get(v8::Integer::New(0))->NumberValue());
-  CHECK_EQ(5.5, a3->Get(v8::Integer::New(1))->NumberValue());
-  CHECK_EQ(6.6, a3->Get(v8::Integer::New(2))->NumberValue());
+  CHECK_EQ(4.4, a3->Get(v8::Integer::New(isolate, 0))->NumberValue());
+  CHECK_EQ(5.5, a3->Get(v8::Integer::New(isolate, 1))->NumberValue());
+  CHECK_EQ(6.6, a3->Get(v8::Integer::New(isolate, 2))->NumberValue());
 
   v8::Handle<Value> args4[] = { v8_num(7.7),
                                 v8_num(8.8),
@@ -4510,10 +4524,10 @@ THREADED_TEST(ConstructCall) {
                                 v8_num(10.11) };
   Local<v8::Array> a4 = Local<v8::Array>::Cast(Foo->NewInstance(4, args4));
   CHECK_EQ(4, a4->Length());
-  CHECK_EQ(7.7, a4->Get(v8::Integer::New(0))->NumberValue());
-  CHECK_EQ(8.8, a4->Get(v8::Integer::New(1))->NumberValue());
-  CHECK_EQ(9.9, a4->Get(v8::Integer::New(2))->NumberValue());
-  CHECK_EQ(10.11, a4->Get(v8::Integer::New(3))->NumberValue());
+  CHECK_EQ(7.7, a4->Get(v8::Integer::New(isolate, 0))->NumberValue());
+  CHECK_EQ(8.8, a4->Get(v8::Integer::New(isolate, 1))->NumberValue());
+  CHECK_EQ(9.9, a4->Get(v8::Integer::New(isolate, 2))->NumberValue());
+  CHECK_EQ(10.11, a4->Get(v8::Integer::New(isolate, 3))->NumberValue());
 }
 
 
@@ -5127,13 +5141,13 @@ THREADED_TEST(ThrowValues) {
     "}"
     "[Run('str'), Run(1), Run(0), Run(null), Run(void 0)];"));
   CHECK_EQ(5, result->Length());
-  CHECK(result->Get(v8::Integer::New(0))->IsString());
-  CHECK(result->Get(v8::Integer::New(1))->IsNumber());
-  CHECK_EQ(1, result->Get(v8::Integer::New(1))->Int32Value());
-  CHECK(result->Get(v8::Integer::New(2))->IsNumber());
-  CHECK_EQ(0, result->Get(v8::Integer::New(2))->Int32Value());
-  CHECK(result->Get(v8::Integer::New(3))->IsNull());
-  CHECK(result->Get(v8::Integer::New(4))->IsUndefined());
+  CHECK(result->Get(v8::Integer::New(isolate, 0))->IsString());
+  CHECK(result->Get(v8::Integer::New(isolate, 1))->IsNumber());
+  CHECK_EQ(1, result->Get(v8::Integer::New(isolate, 1))->Int32Value());
+  CHECK(result->Get(v8::Integer::New(isolate, 2))->IsNumber());
+  CHECK_EQ(0, result->Get(v8::Integer::New(isolate, 2))->Int32Value());
+  CHECK(result->Get(v8::Integer::New(isolate, 3))->IsNull());
+  CHECK(result->Get(v8::Integer::New(isolate, 4))->IsUndefined());
 }
 
 
@@ -5290,7 +5304,7 @@ THREADED_TEST(Equality) {
   CHECK(v8::False(isolate)->StrictEquals(v8::False(isolate)));
   CHECK(!v8::False(isolate)->StrictEquals(v8::Undefined(isolate)));
 
-  v8::Handle<v8::Object> obj = v8::Object::New();
+  v8::Handle<v8::Object> obj = v8::Object::New(isolate);
   v8::Persistent<v8::Object> alias(isolate, obj);
   CHECK(v8::Local<v8::Object>::New(isolate, alias)->StrictEquals(obj));
   alias.Reset();
@@ -5753,7 +5767,8 @@ static void SetXOnPrototypeGetter(
     const v8::PropertyCallbackInfo<v8::Value>& info) {
   // Set x on the prototype object and do not handle the get request.
   v8::Handle<v8::Value> proto = info.Holder()->GetPrototype();
-  proto.As<v8::Object>()->Set(v8_str("x"), v8::Integer::New(23));
+  proto.As<v8::Object>()->Set(v8_str("x"),
+                              v8::Integer::New(info.GetIsolate(), 23));
 }
 
 
@@ -6410,7 +6425,7 @@ THREADED_TEST(ExtensibleOnUndetectable) {
 
   Local<Script> script = Script::Compile(source);
 
-  CHECK_EQ(v8::Integer::New(42), script->Run());
+  CHECK_EQ(v8::Integer::New(isolate, 42), script->Run());
 
   ExpectBoolean("Object.isExtensible(undetectable)", true);
 
@@ -6555,7 +6570,7 @@ THREADED_TEST(SimpleExtensions) {
       Context::New(CcTest::isolate(), &extensions);
   Context::Scope lock(context);
   v8::Handle<Value> result = Script::Compile(v8_str("Foo()"))->Run();
-  CHECK_EQ(result, v8::Integer::New(4));
+  CHECK_EQ(result, v8::Integer::New(CcTest::isolate(), 4));
 }
 
 
@@ -6568,7 +6583,7 @@ THREADED_TEST(NullExtensions) {
       Context::New(CcTest::isolate(), &extensions);
   Context::Scope lock(context);
   v8::Handle<Value> result = Script::Compile(v8_str("1+3"))->Run();
-  CHECK_EQ(result, v8::Integer::New(4));
+  CHECK_EQ(result, v8::Integer::New(CcTest::isolate(), 4));
 }
 
 
@@ -6606,7 +6621,7 @@ THREADED_TEST(ExtensionWithSourceLength) {
     if (source_len == kEmbeddedExtensionSourceValidLen) {
       Context::Scope lock(context);
       v8::Handle<Value> result = Script::Compile(v8_str("Ret54321()"))->Run();
-      CHECK_EQ(v8::Integer::New(54321), result);
+      CHECK_EQ(v8::Integer::New(CcTest::isolate(), 54321), result);
     } else {
       // Anything but exactly the right length should fail to compile.
       CHECK_EQ(0, *context);
@@ -6642,9 +6657,9 @@ THREADED_TEST(UseEvalFromExtension) {
       Context::New(CcTest::isolate(), &extensions);
   Context::Scope lock(context);
   v8::Handle<Value> result = Script::Compile(v8_str("UseEval1()"))->Run();
-  CHECK_EQ(result, v8::Integer::New(42));
+  CHECK_EQ(result, v8::Integer::New(CcTest::isolate(), 42));
   result = Script::Compile(v8_str("UseEval2()"))->Run();
-  CHECK_EQ(result, v8::Integer::New(42));
+  CHECK_EQ(result, v8::Integer::New(CcTest::isolate(), 42));
 }
 
 
@@ -6676,9 +6691,9 @@ THREADED_TEST(UseWithFromExtension) {
       Context::New(CcTest::isolate(), &extensions);
   Context::Scope lock(context);
   v8::Handle<Value> result = Script::Compile(v8_str("UseWith1()"))->Run();
-  CHECK_EQ(result, v8::Integer::New(87));
+  CHECK_EQ(result, v8::Integer::New(CcTest::isolate(), 87));
   result = Script::Compile(v8_str("UseWith2()"))->Run();
-  CHECK_EQ(result, v8::Integer::New(87));
+  CHECK_EQ(result, v8::Integer::New(CcTest::isolate(), 87));
 }
 
 
@@ -6691,7 +6706,7 @@ THREADED_TEST(AutoExtensions) {
       Context::New(CcTest::isolate());
   Context::Scope lock(context);
   v8::Handle<Value> result = Script::Compile(v8_str("Foo()"))->Run();
-  CHECK_EQ(result, v8::Integer::New(4));
+  CHECK_EQ(result, v8::Integer::New(CcTest::isolate(), 4));
 }
 
 
@@ -6751,7 +6766,7 @@ THREADED_TEST(NativeCallInExtensions) {
       Context::New(CcTest::isolate(), &extensions);
   Context::Scope lock(context);
   v8::Handle<Value> result = Script::Compile(v8_str(kNativeCallTest))->Run();
-  CHECK_EQ(result, v8::Integer::New(3));
+  CHECK_EQ(result, v8::Integer::New(CcTest::isolate(), 3));
 }
 
 
@@ -6788,7 +6803,7 @@ THREADED_TEST(NativeFunctionDeclaration) {
       Context::New(CcTest::isolate(), &extensions);
   Context::Scope lock(context);
   v8::Handle<Value> result = Script::Compile(v8_str("foo(42);"))->Run();
-  CHECK_EQ(result, v8::Integer::New(42));
+  CHECK_EQ(result, v8::Integer::New(CcTest::isolate(), 42));
 }
 
 
@@ -6896,11 +6911,14 @@ v8::Handle<v8::FunctionTemplate> FunctionExtension::GetNativeFunctionTemplate(
     v8::Isolate* isolate, v8::Handle<String> name) {
   lookup_count++;
   if (name->Equals(v8_str("A"))) {
-    return v8::FunctionTemplate::New(isolate, CallFun, v8::Integer::New(8));
+    return v8::FunctionTemplate::New(
+        isolate, CallFun, v8::Integer::New(isolate, 8));
   } else if (name->Equals(v8_str("B"))) {
-    return v8::FunctionTemplate::New(isolate, CallFun, v8::Integer::New(7));
+    return v8::FunctionTemplate::New(
+        isolate, CallFun, v8::Integer::New(isolate, 7));
   } else if (name->Equals(v8_str("C"))) {
-    return v8::FunctionTemplate::New(isolate, CallFun, v8::Integer::New(6));
+    return v8::FunctionTemplate::New(
+        isolate, CallFun, v8::Integer::New(isolate, 6));
   } else {
     return v8::Handle<v8::FunctionTemplate>();
   }
@@ -6914,9 +6932,12 @@ THREADED_TEST(FunctionLookup) {
   v8::ExtensionConfiguration config(1, exts);
   LocalContext context(&config);
   CHECK_EQ(3, lookup_count);
-  CHECK_EQ(v8::Integer::New(8), Script::Compile(v8_str("Foo(0)"))->Run());
-  CHECK_EQ(v8::Integer::New(7), Script::Compile(v8_str("Foo(1)"))->Run());
-  CHECK_EQ(v8::Integer::New(6), Script::Compile(v8_str("Foo(2)"))->Run());
+  CHECK_EQ(v8::Integer::New(CcTest::isolate(), 8),
+           Script::Compile(v8_str("Foo(0)"))->Run());
+  CHECK_EQ(v8::Integer::New(CcTest::isolate(), 7),
+           Script::Compile(v8_str("Foo(1)"))->Run());
+  CHECK_EQ(v8::Integer::New(CcTest::isolate(), 6),
+           Script::Compile(v8_str("Foo(2)"))->Run());
 }
 
 
@@ -6929,11 +6950,11 @@ THREADED_TEST(NativeFunctionConstructCall) {
   for (int i = 0; i < 10; i++) {
     // Run a few times to ensure that allocation of objects doesn't
     // change behavior of a constructor function.
-    CHECK_EQ(v8::Integer::New(8),
+    CHECK_EQ(v8::Integer::New(CcTest::isolate(), 8),
              Script::Compile(v8_str("(new A()).data"))->Run());
-    CHECK_EQ(v8::Integer::New(7),
+    CHECK_EQ(v8::Integer::New(CcTest::isolate(), 7),
              Script::Compile(v8_str("(new B()).data"))->Run());
-    CHECK_EQ(v8::Integer::New(6),
+    CHECK_EQ(v8::Integer::New(CcTest::isolate(), 6),
              Script::Compile(v8_str("(new C()).data"))->Run());
   }
 }
@@ -7049,7 +7070,7 @@ void WhammyPropertyGetter(Local<String> name,
 
   v8::Persistent<v8::Object>& prev = whammy->objects_[whammy->cursor_];
 
-  v8::Handle<v8::Object> obj = v8::Object::New();
+  v8::Handle<v8::Object> obj = v8::Object::New(info.GetIsolate());
   if (!prev.IsEmpty()) {
     v8::Local<v8::Object>::New(info.GetIsolate(), prev)
         ->Set(v8_str("next"), obj);
@@ -7115,8 +7136,8 @@ THREADED_TEST(IndependentWeakHandle) {
 
   {
     v8::HandleScope handle_scope(iso);
-    object_a.handle.Reset(iso, v8::Object::New());
-    object_b.handle.Reset(iso, v8::Object::New());
+    object_a.handle.Reset(iso, v8::Object::New(iso));
+    object_b.handle.Reset(iso, v8::Object::New(iso));
   }
 
   object_a.flag = false;
@@ -7179,7 +7200,7 @@ THREADED_TEST(GCFromWeakCallbacks) {
       FlagAndPersistent object;
       {
         v8::HandleScope handle_scope(isolate);
-        object.handle.Reset(isolate, v8::Object::New());
+        object.handle.Reset(isolate, v8::Object::New(isolate));
       }
       object.flag = false;
       object.handle.SetWeak(&object, gc_forcing_callback[inner_gc]);
@@ -7207,9 +7228,9 @@ THREADED_TEST(IndependentHandleRevival) {
   FlagAndPersistent object;
   {
     v8::HandleScope handle_scope(isolate);
-    v8::Local<v8::Object> o = v8::Object::New();
+    v8::Local<v8::Object> o = v8::Object::New(isolate);
     object.handle.Reset(isolate, o);
-    o->Set(v8_str("x"), v8::Integer::New(1));
+    o->Set(v8_str("x"), v8::Integer::New(isolate, 1));
     v8::Local<String> y_str = v8_str("y");
     o->Set(y_str, y_str);
   }
@@ -7224,7 +7245,7 @@ THREADED_TEST(IndependentHandleRevival) {
     v8::Local<v8::Object> o =
         v8::Local<v8::Object>::New(isolate, object.handle);
     v8::Local<String> y_str = v8_str("y");
-    CHECK_EQ(v8::Integer::New(1), o->Get(v8_str("x")));
+    CHECK_EQ(v8::Integer::New(isolate, 1), o->Get(v8_str("x")));
     CHECK(o->Get(y_str)->Equals(y_str));
   }
 }
@@ -7239,9 +7260,9 @@ static void ArgumentsTestCallback(
   v8::Isolate* isolate = args.GetIsolate();
   CHECK_EQ(args_fun, args.Callee());
   CHECK_EQ(3, args.Length());
-  CHECK_EQ(v8::Integer::New(1, isolate), args[0]);
-  CHECK_EQ(v8::Integer::New(2, isolate), args[1]);
-  CHECK_EQ(v8::Integer::New(3, isolate), args[2]);
+  CHECK_EQ(v8::Integer::New(isolate, 1), args[0]);
+  CHECK_EQ(v8::Integer::New(isolate, 2), args[1]);
+  CHECK_EQ(v8::Integer::New(isolate, 3), args[2]);
   CHECK_EQ(v8::Undefined(isolate), args[3]);
   v8::HandleScope scope(args.GetIsolate());
   CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags);
@@ -7337,9 +7358,9 @@ static void IndexedGetK(uint32_t index,
 static void NamedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) {
   ApiTestFuzzer::Fuzz();
   v8::Handle<v8::Array> result = v8::Array::New(info.GetIsolate(), 3);
-  result->Set(v8::Integer::New(0), v8_str("foo"));
-  result->Set(v8::Integer::New(1), v8_str("bar"));
-  result->Set(v8::Integer::New(2), v8_str("baz"));
+  result->Set(v8::Integer::New(info.GetIsolate(), 0), v8_str("foo"));
+  result->Set(v8::Integer::New(info.GetIsolate(), 1), v8_str("bar"));
+  result->Set(v8::Integer::New(info.GetIsolate(), 2), v8_str("baz"));
   info.GetReturnValue().Set(result);
 }
 
@@ -7347,14 +7368,15 @@ static void NamedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) {
 static void IndexedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) {
   ApiTestFuzzer::Fuzz();
   v8::Handle<v8::Array> result = v8::Array::New(info.GetIsolate(), 2);
-  result->Set(v8::Integer::New(0), v8_str("0"));
-  result->Set(v8::Integer::New(1), v8_str("1"));
+  result->Set(v8::Integer::New(info.GetIsolate(), 0), v8_str("0"));
+  result->Set(v8::Integer::New(info.GetIsolate(), 1), v8_str("1"));
   info.GetReturnValue().Set(result);
 }
 
 
 THREADED_TEST(Enumerators) {
-  v8::HandleScope scope(CcTest::isolate());
+  v8::Isolate* isolate = CcTest::isolate();
+  v8::HandleScope scope(isolate);
   v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New();
   obj->SetNamedPropertyHandler(GetK, NULL, NULL, NULL, NamedEnum);
   obj->SetIndexedPropertyHandler(IndexedGetK, NULL, NULL, NULL, IndexedEnum);
@@ -7386,27 +7408,27 @@ THREADED_TEST(Enumerators) {
   // documenting our behavior.
   CHECK_EQ(17, result->Length());
   // Indexed properties in numerical order.
-  CHECK_EQ(v8_str("5"), result->Get(v8::Integer::New(0)));
-  CHECK_EQ(v8_str("10"), result->Get(v8::Integer::New(1)));
-  CHECK_EQ(v8_str("140000"), result->Get(v8::Integer::New(2)));
-  CHECK_EQ(v8_str("4294967295"), result->Get(v8::Integer::New(3)));
+  CHECK_EQ(v8_str("5"), result->Get(v8::Integer::New(isolate, 0)));
+  CHECK_EQ(v8_str("10"), result->Get(v8::Integer::New(isolate, 1)));
+  CHECK_EQ(v8_str("140000"), result->Get(v8::Integer::New(isolate, 2)));
+  CHECK_EQ(v8_str("4294967295"), result->Get(v8::Integer::New(isolate, 3)));
   // Indexed interceptor properties in the order they are returned
   // from the enumerator interceptor.
-  CHECK_EQ(v8_str("0"), result->Get(v8::Integer::New(4)));
-  CHECK_EQ(v8_str("1"), result->Get(v8::Integer::New(5)));
+  CHECK_EQ(v8_str("0"), result->Get(v8::Integer::New(isolate, 4)));
+  CHECK_EQ(v8_str("1"), result->Get(v8::Integer::New(isolate, 5)));
   // Named properties in insertion order.
-  CHECK_EQ(v8_str("a"), result->Get(v8::Integer::New(6)));
-  CHECK_EQ(v8_str("b"), result->Get(v8::Integer::New(7)));
-  CHECK_EQ(v8_str("c"), result->Get(v8::Integer::New(8)));
-  CHECK_EQ(v8_str("4294967296"), result->Get(v8::Integer::New(9)));
-  CHECK_EQ(v8_str("d"), result->Get(v8::Integer::New(10)));
-  CHECK_EQ(v8_str("e"), result->Get(v8::Integer::New(11)));
-  CHECK_EQ(v8_str("30000000000"), result->Get(v8::Integer::New(12)));
-  CHECK_EQ(v8_str("f"), result->Get(v8::Integer::New(13)));
+  CHECK_EQ(v8_str("a"), result->Get(v8::Integer::New(isolate, 6)));
+  CHECK_EQ(v8_str("b"), result->Get(v8::Integer::New(isolate, 7)));
+  CHECK_EQ(v8_str("c"), result->Get(v8::Integer::New(isolate, 8)));
+  CHECK_EQ(v8_str("4294967296"), result->Get(v8::Integer::New(isolate, 9)));
+  CHECK_EQ(v8_str("d"), result->Get(v8::Integer::New(isolate, 10)));
+  CHECK_EQ(v8_str("e"), result->Get(v8::Integer::New(isolate, 11)));
+  CHECK_EQ(v8_str("30000000000"), result->Get(v8::Integer::New(isolate, 12)));
+  CHECK_EQ(v8_str("f"), result->Get(v8::Integer::New(isolate, 13)));
   // Named interceptor properties.
-  CHECK_EQ(v8_str("foo"), result->Get(v8::Integer::New(14)));
-  CHECK_EQ(v8_str("bar"), result->Get(v8::Integer::New(15)));
-  CHECK_EQ(v8_str("baz"), result->Get(v8::Integer::New(16)));
+  CHECK_EQ(v8_str("foo"), result->Get(v8::Integer::New(isolate, 14)));
+  CHECK_EQ(v8_str("bar"), result->Get(v8::Integer::New(isolate, 15)));
+  CHECK_EQ(v8_str("baz"), result->Get(v8::Integer::New(isolate, 16)));
 }
 
 
@@ -8025,7 +8047,8 @@ THREADED_TEST(Utf16Symbol) {
 
 THREADED_TEST(ToArrayIndex) {
   LocalContext context;
-  v8::HandleScope scope(context->GetIsolate());
+  v8::Isolate* isolate = context->GetIsolate();
+  v8::HandleScope scope(isolate);
 
   v8::Handle<String> str = v8_str("42");
   v8::Handle<v8::Uint32> index = str->ToArrayIndex();
@@ -8041,14 +8064,14 @@ THREADED_TEST(ToArrayIndex) {
   index = str->ToArrayIndex();
   CHECK(!index.IsEmpty());
   CHECK_EQ(4294967295.0, index->Uint32Value());
-  v8::Handle<v8::Number> num = v8::Number::New(1);
+  v8::Handle<v8::Number> num = v8::Number::New(isolate, 1);
   index = num->ToArrayIndex();
   CHECK(!index.IsEmpty());
   CHECK_EQ(1.0, index->Uint32Value());
-  num = v8::Number::New(-1);
+  num = v8::Number::New(isolate, -1);
   index = num->ToArrayIndex();
   CHECK(index.IsEmpty());
-  v8::Handle<v8::Object> obj = v8::Object::New();
+  v8::Handle<v8::Object> obj = v8::Object::New(isolate);
   index = obj->ToArrayIndex();
   CHECK(index.IsEmpty());
 }
@@ -8117,7 +8140,7 @@ THREADED_TEST(TypeSwitch) {
   v8::Handle<v8::FunctionTemplate> templs[3] = { templ1, templ2, templ3 };
   v8::Handle<v8::TypeSwitch> type_switch = v8::TypeSwitch::New(3, templs);
   LocalContext context;
-  v8::Handle<v8::Object> obj0 = v8::Object::New();
+  v8::Handle<v8::Object> obj0 = v8::Object::New(isolate);
   v8::Handle<v8::Object> obj1 = templ1->GetFunction()->NewInstance();
   v8::Handle<v8::Object> obj2 = templ2->GetFunction()->NewInstance();
   v8::Handle<v8::Object> obj3 = templ3->GetFunction()->NewInstance();
@@ -8570,7 +8593,7 @@ TEST(ContextDetachGlobal) {
 
   // Create a function in env2 and add a reference to it in env1.
   Local<v8::Object> global2 = env2->Global();
-  global2->Set(v8_str("prop"), v8::Integer::New(1));
+  global2->Set(v8_str("prop"), v8::Integer::New(env2->GetIsolate(), 1));
   CompileRun("function getProp() {return prop;}");
 
   env1->Global()->Set(v8_str("getProp"),
@@ -8591,8 +8614,8 @@ TEST(ContextDetachGlobal) {
   CHECK_EQ(global2, global3);
   CHECK(global3->Get(v8_str("prop"))->IsUndefined());
   CHECK(global3->Get(v8_str("getProp"))->IsUndefined());
-  global3->Set(v8_str("prop"), v8::Integer::New(-1));
-  global3->Set(v8_str("prop2"), v8::Integer::New(2));
+  global3->Set(v8_str("prop"), v8::Integer::New(env3->GetIsolate(), -1));
+  global3->Set(v8_str("prop2"), v8::Integer::New(env3->GetIsolate(), 2));
   env3->Exit();
 
   // Call getProp in env1, and it should return the value 1
@@ -8629,7 +8652,7 @@ TEST(DetachGlobal) {
   // Create a property on the global object in env2.
   {
     v8::Context::Scope scope(env2);
-    env2->Global()->Set(v8_str("p"), v8::Integer::New(42));
+    env2->Global()->Set(v8_str("p"), v8::Integer::New(env2->GetIsolate(), 42));
   }
 
   // Create a reference to env2 global from env1 global.
@@ -8662,7 +8685,7 @@ TEST(DetachGlobal) {
   // Create a property on the global object in env3.
   {
     v8::Context::Scope scope(env3);
-    env3->Global()->Set(v8_str("p"), v8::Integer::New(24));
+    env3->Global()->Set(v8_str("p"), v8::Integer::New(env3->GetIsolate(), 24));
   }
 
   // Check that other.p is now the property in env3 and that we have access.
@@ -9174,7 +9197,7 @@ THREADED_TEST(AccessControlGetOwnPropertyNames) {
   v8::HandleScope handle_scope(isolate);
   v8::Handle<v8::ObjectTemplate> obj_template = v8::ObjectTemplate::New();
 
-  obj_template->Set(v8_str("x"), v8::Integer::New(42));
+  obj_template->Set(v8_str("x"), v8::Integer::New(isolate, 42));
   obj_template->SetAccessCheckCallbacks(GetOwnPropertyNamesNamedBlocker,
                                         GetOwnPropertyNamesIndexedBlocker);
 
@@ -9214,8 +9237,8 @@ THREADED_TEST(AccessControlGetOwnPropertyNames) {
 static void IndexedPropertyEnumerator(
     const v8::PropertyCallbackInfo<v8::Array>& info) {
   v8::Handle<v8::Array> result = v8::Array::New(info.GetIsolate(), 2);
-  result->Set(0, v8::Integer::New(7));
-  result->Set(1, v8::Object::New());
+  result->Set(0, v8::Integer::New(info.GetIsolate(), 7));
+  result->Set(1, v8::Object::New(info.GetIsolate()));
   info.GetReturnValue().Set(result);
 }
 
@@ -9224,7 +9247,7 @@ static void NamedPropertyEnumerator(
     const v8::PropertyCallbackInfo<v8::Array>& info) {
   v8::Handle<v8::Array> result = v8::Array::New(info.GetIsolate(), 2);
   result->Set(0, v8_str("x"));
-  result->Set(1, v8::Object::New());
+  result->Set(1, v8::Object::New(info.GetIsolate()));
   info.GetReturnValue().Set(result);
 }
 
@@ -9233,8 +9256,8 @@ THREADED_TEST(GetOwnPropertyNamesWithInterceptor) {
   v8::HandleScope handle_scope(CcTest::isolate());
   v8::Handle<v8::ObjectTemplate> obj_template = v8::ObjectTemplate::New();
 
-  obj_template->Set(v8_str("7"), v8::Integer::New(7));
-  obj_template->Set(v8_str("x"), v8::Integer::New(42));
+  obj_template->Set(v8_str("7"), v8::Integer::New(CcTest::isolate(), 7));
+  obj_template->Set(v8_str("x"), v8::Integer::New(CcTest::isolate(), 42));
   obj_template->SetIndexedPropertyHandler(NULL, NULL, NULL, NULL,
                                           IndexedPropertyEnumerator);
   obj_template->SetNamedPropertyHandler(NULL, NULL, NULL, NULL,
@@ -9940,7 +9963,7 @@ THREADED_TEST(HiddenPrototypeIdentityHash) {
   t->SetHiddenPrototype(true);
   t->InstanceTemplate()->Set(v8_str("foo"), v8_num(75));
   Handle<Object> p = t->GetFunction()->NewInstance();
-  Handle<Object> o = Object::New();
+  Handle<Object> o = Object::New(context->GetIsolate());
   o->SetPrototype(p);
 
   int hash = o->GetIdentityHash();
@@ -10023,7 +10046,7 @@ THREADED_TEST(Regress91517) {
   Local<v8::FunctionTemplate> t2 = v8::FunctionTemplate::New(isolate);
   t2->SetHiddenPrototype(true);
   t2->InstanceTemplate()->Set(v8_str("fuz1"), v8_num(2));
-  t2->InstanceTemplate()->Set(v8_str("objects"), v8::Object::New());
+  t2->InstanceTemplate()->Set(v8_str("objects"), v8::Object::New(isolate));
   t2->InstanceTemplate()->Set(v8_str("fuz2"), v8_num(2));
   Local<v8::FunctionTemplate> t3 = v8::FunctionTemplate::New(isolate);
   t3->SetHiddenPrototype(true);
@@ -10098,7 +10121,8 @@ THREADED_TEST(Regress269562) {
 
   v8::Local<v8::Symbol> sym = v8::Symbol::New(context->GetIsolate(), "s1");
   o1->Set(sym, v8_num(3));
-  o1->SetHiddenValue(v8_str("h1"), v8::Integer::New(2013));
+  o1->SetHiddenValue(v8_str("h1"),
+                     v8::Integer::New(context->GetIsolate(), 2013));
 
   // Call the runtime version of GetLocalPropertyNames() on
   // the natively created object through JavaScript.
@@ -10123,7 +10147,7 @@ THREADED_TEST(FunctionReadOnlyPrototype) {
   v8::HandleScope handle_scope(isolate);
 
   Local<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New(isolate);
-  t1->PrototypeTemplate()->Set(v8_str("x"), v8::Integer::New(42));
+  t1->PrototypeTemplate()->Set(v8_str("x"), v8::Integer::New(isolate, 42));
   t1->ReadOnlyPrototype();
   context->Global()->Set(v8_str("func1"), t1->GetFunction());
   // Configured value of ReadOnly flag.
@@ -10137,7 +10161,7 @@ THREADED_TEST(FunctionReadOnlyPrototype) {
            CompileRun("func1.prototype = {}; func1.prototype.x")->Int32Value());
 
   Local<v8::FunctionTemplate> t2 = v8::FunctionTemplate::New(isolate);
-  t2->PrototypeTemplate()->Set(v8_str("x"), v8::Integer::New(42));
+  t2->PrototypeTemplate()->Set(v8_str("x"), v8::Integer::New(isolate, 42));
   context->Global()->Set(v8_str("func2"), t2->GetFunction());
   // Default value of ReadOnly flag.
   CHECK(CompileRun(
@@ -10194,7 +10218,8 @@ THREADED_TEST(FunctionRemovePrototype) {
 
 THREADED_TEST(GetterSetterExceptions) {
   LocalContext context;
-  v8::HandleScope handle_scope(context->GetIsolate());
+  v8::Isolate* isolate = context->GetIsolate();
+  v8::HandleScope handle_scope(isolate);
   CompileRun(
     "function Foo() { };"
     "function Throw() { throw 5; };"
@@ -10204,13 +10229,13 @@ THREADED_TEST(GetterSetterExceptions) {
   Local<v8::Object> x =
       Local<v8::Object>::Cast(context->Global()->Get(v8_str("x")));
   v8::TryCatch try_catch;
-  x->Set(v8_str("set"), v8::Integer::New(8));
+  x->Set(v8_str("set"), v8::Integer::New(isolate, 8));
   x->Get(v8_str("get"));
-  x->Set(v8_str("set"), v8::Integer::New(8));
+  x->Set(v8_str("set"), v8::Integer::New(isolate, 8));
   x->Get(v8_str("get"));
-  x->Set(v8_str("set"), v8::Integer::New(8));
+  x->Set(v8_str("set"), v8::Integer::New(isolate, 8));
   x->Get(v8_str("get"));
-  x->Set(v8_str("set"), v8::Integer::New(8));
+  x->Set(v8_str("set"), v8::Integer::New(isolate, 8));
   x->Get(v8_str("get"));
 }
 
@@ -10238,7 +10263,7 @@ static void ConstructorCallback(
 
   if (args.IsConstructCall()) {
     Local<Object> Holder = args.Holder();
-    This = Object::New();
+    This = Object::New(args.GetIsolate());
     Local<Value> proto = Holder->GetPrototype();
     if (proto->IsObject()) {
       This->SetPrototype(proto);
@@ -10885,7 +10910,7 @@ static int Recurse(int depth, int iterations) {
   v8::HandleScope scope(CcTest::isolate());
   if (depth == 0) return CountHandles();
   for (int i = 0; i < iterations; i++) {
-    Local<v8::Number> n(v8::Integer::New(42));
+    Local<v8::Number> n(v8::Integer::New(CcTest::isolate(), 42));
   }
   return Recurse(depth - 1, iterations);
 }
@@ -10899,7 +10924,7 @@ THREADED_TEST(HandleIteration) {
     v8::HandleScope scope1(CcTest::isolate());
     CHECK_EQ(0, CountHandles());
     for (int i = 0; i < kIterations; i++) {
-      Local<v8::Number> n(v8::Integer::New(42));
+      Local<v8::Number> n(v8::Integer::New(CcTest::isolate(), 42));
       CHECK_EQ(i + 1, CountHandles());
     }
 
@@ -10907,7 +10932,7 @@ THREADED_TEST(HandleIteration) {
     {
       v8::HandleScope scope2(CcTest::isolate());
       for (int j = 0; j < kIterations; j++) {
-        Local<v8::Number> n(v8::Integer::New(42));
+        Local<v8::Number> n(v8::Integer::New(CcTest::isolate(), 42));
         CHECK_EQ(j + 1 + kIterations, CountHandles());
       }
     }
@@ -11013,7 +11038,7 @@ static void InterceptorLoadICGetter(
   CHECK_EQ(isolate, info.GetIsolate());
   CHECK_EQ(v8_str("data"), info.Data());
   CHECK_EQ(v8_str("x"), name);
-  info.GetReturnValue().Set(v8::Integer::New(42));
+  info.GetReturnValue().Set(v8::Integer::New(isolate, 42));
 }
 
 
@@ -11038,7 +11063,7 @@ static void InterceptorLoadXICGetter(
   ApiTestFuzzer::Fuzz();
   info.GetReturnValue().Set(
       v8_str("x")->Equals(name) ?
-          v8::Handle<v8::Value>(v8::Integer::New(42)) :
+          v8::Handle<v8::Value>(v8::Integer::New(info.GetIsolate(), 42)) :
           v8::Handle<v8::Value>());
 }
 
@@ -11390,7 +11415,7 @@ static void InterceptorLoadICGetter0(
     const v8::PropertyCallbackInfo<v8::Value>& info) {
   ApiTestFuzzer::Fuzz();
   CHECK(v8_str("x")->Equals(name));
-  info.GetReturnValue().Set(v8::Integer::New(0));
+  info.GetReturnValue().Set(v8::Integer::New(info.GetIsolate(), 0));
 }
 
 
@@ -12636,13 +12661,13 @@ THREADED_TEST(VariousGetPropertiesAndThrowingCallbacks) {
   LocalContext context;
   HandleScope scope(context->GetIsolate());
 
-  Local<FunctionTemplate> templ = FunctionTemplate::New(CcTest::isolate());
+  Local<FunctionTemplate> templ = FunctionTemplate::New(context->GetIsolate());
   Local<ObjectTemplate> instance_templ = templ->InstanceTemplate();
   instance_templ->SetAccessor(v8_str("f"), ThrowingGetter);
 
   Local<Object> instance = templ->GetFunction()->NewInstance();
 
-  Local<Object> another = Object::New();
+  Local<Object> another = Object::New(context->GetIsolate());
   another->SetPrototype(instance);
 
   Local<Object> with_js_getter = CompileRun(
@@ -13283,7 +13308,7 @@ TEST(CopyablePersistent) {
     CopyableObject handle1;
     {
       v8::HandleScope scope(isolate);
-      handle1.Reset(isolate, v8::Object::New());
+      handle1.Reset(isolate, v8::Object::New(isolate));
     }
     CHECK_EQ(initial_handles + 1, globals->global_handles_count());
     CopyableObject  handle2;
@@ -13316,8 +13341,8 @@ TEST(WeakCallbackApi) {
   int initial_handles = globals->global_handles_count();
   {
     v8::HandleScope scope(isolate);
-    v8::Local<v8::Object> obj = v8::Object::New();
-    obj->Set(v8_str("key"), v8::Integer::New(231, isolate));
+    v8::Local<v8::Object> obj = v8::Object::New(isolate);
+    obj->Set(v8_str("key"), v8::Integer::New(isolate, 231));
     v8::Persistent<v8::Object>* handle =
         new v8::Persistent<v8::Object>(isolate, obj);
     handle->SetWeak<v8::Object, v8::Persistent<v8::Object> >(handle,
@@ -13348,9 +13373,9 @@ THREADED_TEST(NewPersistentHandleFromWeakCallback) {
   v8::Persistent<v8::Object> handle1, handle2;
   {
     v8::HandleScope scope(isolate);
-    some_object.Reset(isolate, v8::Object::New());
-    handle1.Reset(isolate, v8::Object::New());
-    handle2.Reset(isolate, v8::Object::New());
+    some_object.Reset(isolate, v8::Object::New(isolate));
+    handle1.Reset(isolate, v8::Object::New(isolate));
+    handle2.Reset(isolate, v8::Object::New(isolate));
   }
   // Note: order is implementation dependent alas: currently
   // global handle nodes are processed by PostGarbageCollectionProcessing
@@ -13379,8 +13404,8 @@ THREADED_TEST(DoNotUseDeletedNodesInSecondLevelGc) {
   v8::Persistent<v8::Object> handle1, handle2;
   {
     v8::HandleScope scope(isolate);
-    handle1.Reset(isolate, v8::Object::New());
-    handle2.Reset(isolate, v8::Object::New());
+    handle1.Reset(isolate, v8::Object::New(isolate));
+    handle2.Reset(isolate, v8::Object::New(isolate));
   }
   handle1.SetWeak(&handle1, DisposeAndForceGcCallback);
   to_be_disposed.Reset(isolate, handle2);
@@ -13395,7 +13420,8 @@ void DisposingCallback(
 void HandleCreatingCallback(
     const v8::WeakCallbackData<v8::Object, v8::Persistent<v8::Object> >& data) {
   v8::HandleScope scope(data.GetIsolate());
-  v8::Persistent<v8::Object>(data.GetIsolate(), v8::Object::New());
+  v8::Persistent<v8::Object>(data.GetIsolate(),
+                             v8::Object::New(data.GetIsolate()));
   data.GetParameter()->Reset();
 }
 
@@ -13407,9 +13433,9 @@ THREADED_TEST(NoGlobalHandlesOrphaningDueToWeakCallback) {
   v8::Persistent<v8::Object> handle1, handle2, handle3;
   {
     v8::HandleScope scope(isolate);
-    handle3.Reset(isolate, v8::Object::New());
-    handle2.Reset(isolate, v8::Object::New());
-    handle1.Reset(isolate, v8::Object::New());
+    handle3.Reset(isolate, v8::Object::New(isolate));
+    handle2.Reset(isolate, v8::Object::New(isolate));
+    handle1.Reset(isolate, v8::Object::New(isolate));
   }
   handle2.SetWeak(&handle2, DisposingCallback);
   handle3.SetWeak(&handle3, HandleCreatingCallback);
@@ -14156,7 +14182,7 @@ THREADED_TEST(TryCatchSourceInfo) {
   resource_name = "test2.js";
   v8::ScriptOrigin origin2(
       v8::String::NewFromUtf8(context->GetIsolate(), resource_name),
-      v8::Integer::New(7));
+      v8::Integer::New(context->GetIsolate(), 7));
   script = v8::Script::Compile(source, &origin2);
   CheckTryCatchSourceInfo(script, resource_name, 7);
 }
@@ -14213,25 +14239,29 @@ THREADED_TEST(DateAccess) {
 }
 
 
-void CheckProperties(v8::Handle<v8::Value> val, int elmc, const char* elmv[]) {
+void CheckProperties(v8::Isolate* isolate,
+                     v8::Handle<v8::Value> val,
+                     int elmc,
+                     const char* elmv[]) {
   v8::Handle<v8::Object> obj = val.As<v8::Object>();
   v8::Handle<v8::Array> props = obj->GetPropertyNames();
   CHECK_EQ(elmc, props->Length());
   for (int i = 0; i < elmc; i++) {
-    v8::String::Utf8Value elm(props->Get(v8::Integer::New(i)));
+    v8::String::Utf8Value elm(props->Get(v8::Integer::New(isolate, i)));
     CHECK_EQ(elmv[i], *elm);
   }
 }
 
 
-void CheckOwnProperties(v8::Handle<v8::Value> val,
+void CheckOwnProperties(v8::Isolate* isolate,
+                        v8::Handle<v8::Value> val,
                         int elmc,
                         const char* elmv[]) {
   v8::Handle<v8::Object> obj = val.As<v8::Object>();
   v8::Handle<v8::Array> props = obj->GetOwnPropertyNames();
   CHECK_EQ(elmc, props->Length());
   for (int i = 0; i < elmc; i++) {
-    v8::String::Utf8Value elm(props->Get(v8::Integer::New(i)));
+    v8::String::Utf8Value elm(props->Get(v8::Integer::New(isolate, i)));
     CHECK_EQ(elmv[i], *elm);
   }
 }
@@ -14239,7 +14269,8 @@ void CheckOwnProperties(v8::Handle<v8::Value> val,
 
 THREADED_TEST(PropertyEnumeration) {
   LocalContext context;
-  v8::HandleScope scope(context->GetIsolate());
+  v8::Isolate* isolate = context->GetIsolate();
+  v8::HandleScope scope(isolate);
   v8::Handle<v8::Value> obj = v8::Script::Compile(v8::String::NewFromUtf8(
       context->GetIsolate(),
       "var result = [];"
@@ -14254,28 +14285,37 @@ THREADED_TEST(PropertyEnumeration) {
   CHECK_EQ(4, elms->Length());
   int elmc0 = 0;
   const char** elmv0 = NULL;
-  CheckProperties(elms->Get(v8::Integer::New(0)), elmc0, elmv0);
-  CheckOwnProperties(elms->Get(v8::Integer::New(0)), elmc0, elmv0);
+  CheckProperties(
+      isolate, elms->Get(v8::Integer::New(isolate, 0)), elmc0, elmv0);
+  CheckOwnProperties(
+      isolate, elms->Get(v8::Integer::New(isolate, 0)), elmc0, elmv0);
   int elmc1 = 2;
   const char* elmv1[] = {"a", "b"};
-  CheckProperties(elms->Get(v8::Integer::New(1)), elmc1, elmv1);
-  CheckOwnProperties(elms->Get(v8::Integer::New(1)), elmc1, elmv1);
+  CheckProperties(
+      isolate, elms->Get(v8::Integer::New(isolate, 1)), elmc1, elmv1);
+  CheckOwnProperties(
+      isolate, elms->Get(v8::Integer::New(isolate, 1)), elmc1, elmv1);
   int elmc2 = 3;
   const char* elmv2[] = {"0", "1", "2"};
-  CheckProperties(elms->Get(v8::Integer::New(2)), elmc2, elmv2);
-  CheckOwnProperties(elms->Get(v8::Integer::New(2)), elmc2, elmv2);
+  CheckProperties(
+      isolate, elms->Get(v8::Integer::New(isolate, 2)), elmc2, elmv2);
+  CheckOwnProperties(
+      isolate, elms->Get(v8::Integer::New(isolate, 2)), elmc2, elmv2);
   int elmc3 = 4;
   const char* elmv3[] = {"w", "z", "x", "y"};
-  CheckProperties(elms->Get(v8::Integer::New(3)), elmc3, elmv3);
+  CheckProperties(
+      isolate, elms->Get(v8::Integer::New(isolate, 3)), elmc3, elmv3);
   int elmc4 = 2;
   const char* elmv4[] = {"w", "z"};
-  CheckOwnProperties(elms->Get(v8::Integer::New(3)), elmc4, elmv4);
+  CheckOwnProperties(
+      isolate, elms->Get(v8::Integer::New(isolate, 3)), elmc4, elmv4);
 }
 
 
 THREADED_TEST(PropertyEnumeration2) {
   LocalContext context;
-  v8::HandleScope scope(context->GetIsolate());
+  v8::Isolate* isolate = context->GetIsolate();
+  v8::HandleScope scope(isolate);
   v8::Handle<v8::Value> obj = v8::Script::Compile(v8::String::NewFromUtf8(
       context->GetIsolate(),
       "var result = [];"
@@ -14290,9 +14330,10 @@ THREADED_TEST(PropertyEnumeration2) {
   CHECK_EQ(4, elms->Length());
   int elmc0 = 0;
   const char** elmv0 = NULL;
-  CheckProperties(elms->Get(v8::Integer::New(0)), elmc0, elmv0);
+  CheckProperties(isolate,
+                  elms->Get(v8::Integer::New(isolate, 0)), elmc0, elmv0);
 
-  v8::Handle<v8::Value> val = elms->Get(v8::Integer::New(0));
+  v8::Handle<v8::Value> val = elms->Get(v8::Integer::New(isolate, 0));
   v8::Handle<v8::Array> props = val.As<v8::Object>()->GetPropertyNames();
   CHECK_EQ(0, props->Length());
   for (uint32_t i = 0; i < props->Length(); i++) {
@@ -14366,7 +14407,7 @@ THREADED_TEST(AccessChecksReenabledCorrectly) {
       for (char k = '0'; k <= '9'; k++) {
         buf[2] = k;
         buf[3] = 0;
-        templ->Set(v8_str(buf), v8::Number::New(k));
+        templ->Set(v8_str(buf), v8::Number::New(context->GetIsolate(), k));
       }
     }
   }
@@ -14797,7 +14838,8 @@ THREADED_TEST(CrossContextNew) {
 // Verify that we can clone an object
 TEST(ObjectClone) {
   LocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
 
   const char* sample =
     "var rv = {};"      \
@@ -14812,19 +14854,19 @@ TEST(ObjectClone) {
   obj->Set(v8_str("gamma"), v8_str("cloneme"));
 
   CHECK_EQ(v8_str("hello"), obj->Get(v8_str("alpha")));
-  CHECK_EQ(v8::Integer::New(123), obj->Get(v8_str("beta")));
+  CHECK_EQ(v8::Integer::New(isolate, 123), obj->Get(v8_str("beta")));
   CHECK_EQ(v8_str("cloneme"), obj->Get(v8_str("gamma")));
 
   // Clone it.
   Local<v8::Object> clone = obj->Clone();
   CHECK_EQ(v8_str("hello"), clone->Get(v8_str("alpha")));
-  CHECK_EQ(v8::Integer::New(123), clone->Get(v8_str("beta")));
+  CHECK_EQ(v8::Integer::New(isolate, 123), clone->Get(v8_str("beta")));
   CHECK_EQ(v8_str("cloneme"), clone->Get(v8_str("gamma")));
 
   // Set a property on the clone, verify each object.
-  clone->Set(v8_str("beta"), v8::Integer::New(456));
-  CHECK_EQ(v8::Integer::New(123), obj->Get(v8_str("beta")));
-  CHECK_EQ(v8::Integer::New(456), clone->Get(v8_str("beta")));
+  clone->Set(v8_str("beta"), v8::Integer::New(isolate, 456));
+  CHECK_EQ(v8::Integer::New(isolate, 123), obj->Get(v8_str("beta")));
+  CHECK_EQ(v8::Integer::New(isolate, 456), clone->Get(v8_str("beta")));
 }
 
 
@@ -15052,24 +15094,25 @@ TEST(RegExpInterruption) {
 // is a read-only property in the prototype chain.
 TEST(ReadOnlyPropertyInGlobalProto) {
   i::FLAG_es5_readonly = true;
-  v8::HandleScope scope(CcTest::isolate());
+  v8::Isolate* isolate = CcTest::isolate();
+  v8::HandleScope scope(isolate);
   v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New();
   LocalContext context(0, templ);
   v8::Handle<v8::Object> global = context->Global();
   v8::Handle<v8::Object> global_proto =
       v8::Handle<v8::Object>::Cast(global->Get(v8_str("__proto__")));
-  global_proto->Set(v8_str("x"), v8::Integer::New(0), v8::ReadOnly);
-  global_proto->Set(v8_str("y"), v8::Integer::New(0), v8::ReadOnly);
+  global_proto->Set(v8_str("x"), v8::Integer::New(isolate, 0), v8::ReadOnly);
+  global_proto->Set(v8_str("y"), v8::Integer::New(isolate, 0), v8::ReadOnly);
   // Check without 'eval' or 'with'.
   v8::Handle<v8::Value> res =
       CompileRun("function f() { x = 42; return x; }; f()");
-  CHECK_EQ(v8::Integer::New(0), res);
+  CHECK_EQ(v8::Integer::New(isolate, 0), res);
   // Check with 'eval'.
   res = CompileRun("function f() { eval('1'); y = 43; return y; }; f()");
-  CHECK_EQ(v8::Integer::New(0), res);
+  CHECK_EQ(v8::Integer::New(isolate, 0), res);
   // Check with 'with'.
   res = CompileRun("function f() { with (this) { y = 44 }; return y; }; f()");
-  CHECK_EQ(v8::Integer::New(0), res);
+  CHECK_EQ(v8::Integer::New(isolate, 0), res);
 }
 
 static int force_set_set_count = 0;
@@ -15105,24 +15148,25 @@ TEST(ForceSet) {
   force_set_set_count = 0;
   pass_on_get = false;
 
-  v8::HandleScope scope(CcTest::isolate());
+  v8::Isolate* isolate = CcTest::isolate();
+  v8::HandleScope scope(isolate);
   v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New();
   v8::Handle<v8::String> access_property =
-      v8::String::NewFromUtf8(CcTest::isolate(), "a");
+      v8::String::NewFromUtf8(isolate, "a");
   templ->SetAccessor(access_property, ForceSetGetter, ForceSetSetter);
   LocalContext context(NULL, templ);
   v8::Handle<v8::Object> global = context->Global();
 
   // Ordinary properties
   v8::Handle<v8::String> simple_property =
-      v8::String::NewFromUtf8(CcTest::isolate(), "p");
-  global->Set(simple_property, v8::Int32::New(4), v8::ReadOnly);
+      v8::String::NewFromUtf8(isolate, "p");
+  global->Set(simple_property, v8::Int32::New(isolate, 4), v8::ReadOnly);
   CHECK_EQ(4, global->Get(simple_property)->Int32Value());
   // This should fail because the property is read-only
-  global->Set(simple_property, v8::Int32::New(5));
+  global->Set(simple_property, v8::Int32::New(isolate, 5));
   CHECK_EQ(4, global->Get(simple_property)->Int32Value());
   // This should succeed even though the property is read-only
-  global->ForceSet(simple_property, v8::Int32::New(6));
+  global->ForceSet(simple_property, v8::Int32::New(isolate, 6));
   CHECK_EQ(6, global->Get(simple_property)->Int32Value());
 
   // Accessors
@@ -15131,13 +15175,13 @@ TEST(ForceSet) {
   CHECK_EQ(3, global->Get(access_property)->Int32Value());
   // CHECK_EQ the property shouldn't override it, just call the setter
   // which in this case does nothing.
-  global->Set(access_property, v8::Int32::New(7));
+  global->Set(access_property, v8::Int32::New(isolate, 7));
   CHECK_EQ(3, global->Get(access_property)->Int32Value());
   CHECK_EQ(1, force_set_set_count);
   CHECK_EQ(2, force_set_get_count);
   // Forcing the property to be set should override the accessor without
   // calling it
-  global->ForceSet(access_property, v8::Int32::New(8));
+  global->ForceSet(access_property, v8::Int32::New(isolate, 8));
   CHECK_EQ(8, global->Get(access_property)->Int32Value());
   CHECK_EQ(1, force_set_set_count);
   CHECK_EQ(2, force_set_get_count);
@@ -15149,20 +15193,21 @@ TEST(ForceSetWithInterceptor) {
   force_set_set_count = 0;
   pass_on_get = false;
 
-  v8::HandleScope scope(CcTest::isolate());
+  v8::Isolate* isolate = CcTest::isolate();
+  v8::HandleScope scope(isolate);
   v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New();
   templ->SetNamedPropertyHandler(ForceSetGetter, ForceSetInterceptSetter);
   LocalContext context(NULL, templ);
   v8::Handle<v8::Object> global = context->Global();
 
   v8::Handle<v8::String> some_property =
-      v8::String::NewFromUtf8(CcTest::isolate(), "a");
+      v8::String::NewFromUtf8(isolate, "a");
   CHECK_EQ(0, force_set_set_count);
   CHECK_EQ(0, force_set_get_count);
   CHECK_EQ(3, global->Get(some_property)->Int32Value());
   // Setting the property shouldn't override it, just call the setter
   // which in this case does nothing.
-  global->Set(some_property, v8::Int32::New(7));
+  global->Set(some_property, v8::Int32::New(isolate, 7));
   CHECK_EQ(3, global->Get(some_property)->Int32Value());
   CHECK_EQ(1, force_set_set_count);
   CHECK_EQ(2, force_set_get_count);
@@ -15175,7 +15220,7 @@ TEST(ForceSetWithInterceptor) {
   CHECK_EQ(3, force_set_get_count);
   // Forcing the property to be set should cause the value to be
   // set locally without calling the interceptor.
-  global->ForceSet(some_property, v8::Int32::New(8));
+  global->ForceSet(some_property, v8::Int32::New(isolate, 8));
   CHECK_EQ(8, global->Get(some_property)->Int32Value());
   CHECK_EQ(1, force_set_set_count);
   CHECK_EQ(4, force_set_get_count);
@@ -15186,7 +15231,7 @@ TEST(ForceSetWithInterceptor) {
   CHECK_EQ(1, force_set_set_count);
   CHECK_EQ(5, force_set_get_count);
   // The interceptor should also work for other properties
-  CHECK_EQ(3, global->Get(v8::String::NewFromUtf8(CcTest::isolate(), "b"))
+  CHECK_EQ(3, global->Get(v8::String::NewFromUtf8(isolate, "b"))
                   ->Int32Value());
   CHECK_EQ(1, force_set_set_count);
   CHECK_EQ(6, force_set_get_count);
@@ -15194,15 +15239,16 @@ TEST(ForceSetWithInterceptor) {
 
 
 THREADED_TEST(ForceDelete) {
-  v8::HandleScope scope(CcTest::isolate());
+  v8::Isolate* isolate = CcTest::isolate();
+  v8::HandleScope scope(isolate);
   v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New();
   LocalContext context(NULL, templ);
   v8::Handle<v8::Object> global = context->Global();
 
   // Ordinary properties
   v8::Handle<v8::String> simple_property =
-      v8::String::NewFromUtf8(CcTest::isolate(), "p");
-  global->Set(simple_property, v8::Int32::New(4), v8::DontDelete);
+      v8::String::NewFromUtf8(isolate, "p");
+  global->Set(simple_property, v8::Int32::New(isolate, 4), v8::DontDelete);
   CHECK_EQ(4, global->Get(simple_property)->Int32Value());
   // This should fail because the property is dont-delete.
   CHECK(!global->Delete(simple_property));
@@ -15230,15 +15276,16 @@ THREADED_TEST(ForceDeleteWithInterceptor) {
   force_delete_interceptor_count = 0;
   pass_on_delete = false;
 
-  v8::HandleScope scope(CcTest::isolate());
+  v8::Isolate* isolate = CcTest::isolate();
+  v8::HandleScope scope(isolate);
   v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New();
   templ->SetNamedPropertyHandler(0, 0, 0, ForceDeleteDeleter);
   LocalContext context(NULL, templ);
   v8::Handle<v8::Object> global = context->Global();
 
   v8::Handle<v8::String> some_property =
-      v8::String::NewFromUtf8(CcTest::isolate(), "a");
-  global->Set(some_property, v8::Integer::New(42), v8::DontDelete);
+      v8::String::NewFromUtf8(isolate, "a");
+  global->Set(some_property, v8::Integer::New(isolate, 42), v8::DontDelete);
 
   // Deleting a property should get intercepted and nothing should
   // happen.
@@ -15421,7 +15468,7 @@ THREADED_TEST(ReplaceConstantFunction) {
   LocalContext context;
   v8::Isolate* isolate = context->GetIsolate();
   v8::HandleScope scope(isolate);
-  v8::Handle<v8::Object> obj = v8::Object::New();
+  v8::Handle<v8::Object> obj = v8::Object::New(isolate);
   v8::Handle<v8::FunctionTemplate> func_templ =
       v8::FunctionTemplate::New(isolate);
   v8::Handle<v8::String> foo_string =
@@ -15467,13 +15514,13 @@ THREADED_TEST(PixelArray) {
     CHECK_EQ(i % 256, pixel_data[i]);
   }
 
-  v8::Handle<v8::Object> obj = v8::Object::New();
+  v8::Handle<v8::Object> obj = v8::Object::New(context->GetIsolate());
   i::Handle<i::JSObject> jsobj = v8::Utils::OpenHandle(*obj);
   // Set the elements to be the pixels.
   // jsobj->set_elements(*pixels);
   obj->SetIndexedPropertiesToPixelData(pixel_data, kElementCount);
   CheckElementValue(isolate, 1, jsobj, 1);
-  obj->Set(v8_str("field"), v8::Int32::New(1503));
+  obj->Set(v8_str("field"), v8::Int32::New(CcTest::isolate(), 1503));
   context->Global()->Set(v8_str("pixels"), obj);
   v8::Handle<v8::Value> result = CompileRun("pixels.field");
   CHECK_EQ(1503, result->Int32Value());
@@ -15832,7 +15879,7 @@ THREADED_TEST(PixelArrayInfo) {
   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();
+    v8::Handle<v8::Object> obj = v8::Object::New(context->GetIsolate());
     obj->SetIndexedPropertiesToPixelData(pixel_data, size);
     CHECK(obj->HasIndexedPropertiesInPixelData());
     CHECK_EQ(pixel_data, obj->GetIndexedPropertiesPixelData());
@@ -15928,7 +15975,8 @@ static void ObjectWithExternalArrayTestHelper(
     int64_t low, int64_t high) {
   i::Handle<i::JSObject> jsobj = v8::Utils::OpenHandle(*obj);
   i::Isolate* isolate = jsobj->GetIsolate();
-  obj->Set(v8_str("field"), v8::Int32::New(1503));
+  obj->Set(v8_str("field"),
+           v8::Int32::New(reinterpret_cast<v8::Isolate*>(isolate), 1503));
   context->Global()->Set(v8_str("ext_array"), obj);
   v8::Handle<v8::Value> result = CompileRun("ext_array.field");
   CHECK_EQ(1503, result->Int32Value());
@@ -16248,7 +16296,7 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
     CHECK_EQ(static_cast<int64_t>(i), static_cast<int64_t>(array_data[i]));
   }
 
-  v8::Handle<v8::Object> obj = v8::Object::New();
+  v8::Handle<v8::Object> obj = v8::Object::New(context->GetIsolate());
   i::Handle<i::JSObject> jsobj = v8::Utils::OpenHandle(*obj);
   // Set the elements to be the external array.
   obj->SetIndexedPropertiesToExternalArrayData(array_data,
@@ -16273,7 +16321,7 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
     const int kLargeElementCount = kXSize * kYSize * 4;
     ElementType* large_array_data =
         static_cast<ElementType*>(malloc(kLargeElementCount * element_size));
-    v8::Handle<v8::Object> large_obj = v8::Object::New();
+    v8::Handle<v8::Object> large_obj = v8::Object::New(context->GetIsolate());
     // Set the elements to be the external array.
     large_obj->SetIndexedPropertiesToExternalArrayData(large_array_data,
                                                        array_type,
@@ -16346,9 +16394,10 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
 
   // Property "" set after the external array is associated with the object.
   {
-    v8::Handle<v8::Object> obj2 = v8::Object::New();
-    obj2->Set(v8_str("ee_test_field"), v8::Int32::New(256));
-    obj2->Set(v8_str(""), v8::Int32::New(1503));
+    v8::Handle<v8::Object> obj2 = v8::Object::New(context->GetIsolate());
+    obj2->Set(v8_str("ee_test_field"),
+              v8::Int32::New(context->GetIsolate(), 256));
+    obj2->Set(v8_str(""), v8::Int32::New(context->GetIsolate(), 1503));
     // Set the elements to be the external array.
     obj2->SetIndexedPropertiesToExternalArrayData(array_data,
                                                   array_type,
@@ -16360,13 +16409,14 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
 
   // Property "" set after the external array is associated with the object.
   {
-    v8::Handle<v8::Object> obj2 = v8::Object::New();
-    obj2->Set(v8_str("ee_test_field_2"), v8::Int32::New(256));
+    v8::Handle<v8::Object> obj2 = v8::Object::New(context->GetIsolate());
+    obj2->Set(v8_str("ee_test_field_2"),
+              v8::Int32::New(context->GetIsolate(), 256));
     // Set the elements to be the external array.
     obj2->SetIndexedPropertiesToExternalArrayData(array_data,
                                                   array_type,
                                                   kElementCount);
-    obj2->Set(v8_str(""), v8::Int32::New(1503));
+    obj2->Set(v8_str(""), v8::Int32::New(context->GetIsolate(), 1503));
     context->Global()->Set(v8_str("ext_array"), obj2);
     result = CompileRun("ext_array['']");
     CHECK_EQ(1503, result->Int32Value());
@@ -16374,8 +16424,9 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
 
   // Should reuse the map from previous test.
   {
-    v8::Handle<v8::Object> obj2 = v8::Object::New();
-    obj2->Set(v8_str("ee_test_field_2"), v8::Int32::New(256));
+    v8::Handle<v8::Object> obj2 = v8::Object::New(context->GetIsolate());
+    obj2->Set(v8_str("ee_test_field_2"),
+              v8::Int32::New(context->GetIsolate(), 256));
     // Set the elements to be the external array. Should re-use the map
     // from previous test.
     obj2->SetIndexedPropertiesToExternalArrayData(array_data,
@@ -16388,9 +16439,10 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
   // Property "" is a constant function that shouldn't not be interfered with
   // when an external array is set.
   {
-    v8::Handle<v8::Object> obj2 = v8::Object::New();
+    v8::Handle<v8::Object> obj2 = v8::Object::New(context->GetIsolate());
     // Start
-    obj2->Set(v8_str("ee_test_field3"), v8::Int32::New(256));
+    obj2->Set(v8_str("ee_test_field3"),
+              v8::Int32::New(context->GetIsolate(), 256));
 
     // Add a constant function to an object.
     context->Global()->Set(v8_str("ext_array"), obj2);
@@ -16399,8 +16451,9 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
 
     // Add an external array transition to the same map that
     // has the constant transition.
-    v8::Handle<v8::Object> obj3 = v8::Object::New();
-    obj3->Set(v8_str("ee_test_field3"), v8::Int32::New(256));
+    v8::Handle<v8::Object> obj3 = v8::Object::New(context->GetIsolate());
+    obj3->Set(v8_str("ee_test_field3"),
+              v8::Int32::New(context->GetIsolate(), 256));
     obj3->SetIndexedPropertiesToExternalArrayData(array_data,
                                                   array_type,
                                                   kElementCount);
@@ -16411,16 +16464,18 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
   // by a constant function.
   {
     // Add an external array transition.
-    v8::Handle<v8::Object> obj3 = v8::Object::New();
-    obj3->Set(v8_str("ee_test_field4"), v8::Int32::New(256));
+    v8::Handle<v8::Object> obj3 = v8::Object::New(context->GetIsolate());
+    obj3->Set(v8_str("ee_test_field4"),
+              v8::Int32::New(context->GetIsolate(), 256));
     obj3->SetIndexedPropertiesToExternalArrayData(array_data,
                                                   array_type,
                                                   kElementCount);
 
     // Add a constant function to the same map that just got an external array
     // transition.
-    v8::Handle<v8::Object> obj2 = v8::Object::New();
-    obj2->Set(v8_str("ee_test_field4"), v8::Int32::New(256));
+    v8::Handle<v8::Object> obj2 = v8::Object::New(context->GetIsolate());
+    obj2->Set(v8_str("ee_test_field4"),
+              v8::Int32::New(context->GetIsolate(), 256));
     context->Global()->Set(v8_str("ext_array"), obj2);
     result = CompileRun("ext_array[''] = function() {return 1503;};"
                         "ext_array['']();");
@@ -16519,7 +16574,7 @@ void ExternalArrayInfoTestHelper(v8::ExternalArrayType array_type) {
   for (int size = 0; size < 100; size += 10) {
     int element_size = ExternalArrayElementSize(array_type);
     void* external_data = malloc(size * element_size);
-    v8::Handle<v8::Object> obj = v8::Object::New();
+    v8::Handle<v8::Object> obj = v8::Object::New(context->GetIsolate());
     obj->SetIndexedPropertiesToExternalArrayData(
         external_data, array_type, size);
     CHECK(obj->HasIndexedPropertiesInExternalArrayData());
@@ -16544,8 +16599,10 @@ THREADED_TEST(ExternalArrayInfo) {
 }
 
 
-void ExternalArrayLimitTestHelper(v8::ExternalArrayType array_type, int size) {
-  v8::Handle<v8::Object> obj = v8::Object::New();
+void ExtArrayLimitsHelper(v8::Isolate* isolate,
+                          v8::ExternalArrayType array_type,
+                          int size) {
+  v8::Handle<v8::Object> obj = v8::Object::New(isolate);
   v8::V8::SetFatalErrorHandler(StoringErrorCallback);
   last_location = last_message = NULL;
   obj->SetIndexedPropertiesToExternalArrayData(NULL, array_type, size);
@@ -16557,25 +16614,26 @@ void ExternalArrayLimitTestHelper(v8::ExternalArrayType array_type, int size) {
 
 TEST(ExternalArrayLimits) {
   LocalContext context;
-  v8::HandleScope scope(context->GetIsolate());
-  ExternalArrayLimitTestHelper(v8::kExternalByteArray, 0x40000000);
-  ExternalArrayLimitTestHelper(v8::kExternalByteArray, 0xffffffff);
-  ExternalArrayLimitTestHelper(v8::kExternalUnsignedByteArray, 0x40000000);
-  ExternalArrayLimitTestHelper(v8::kExternalUnsignedByteArray, 0xffffffff);
-  ExternalArrayLimitTestHelper(v8::kExternalShortArray, 0x40000000);
-  ExternalArrayLimitTestHelper(v8::kExternalShortArray, 0xffffffff);
-  ExternalArrayLimitTestHelper(v8::kExternalUnsignedShortArray, 0x40000000);
-  ExternalArrayLimitTestHelper(v8::kExternalUnsignedShortArray, 0xffffffff);
-  ExternalArrayLimitTestHelper(v8::kExternalIntArray, 0x40000000);
-  ExternalArrayLimitTestHelper(v8::kExternalIntArray, 0xffffffff);
-  ExternalArrayLimitTestHelper(v8::kExternalUnsignedIntArray, 0x40000000);
-  ExternalArrayLimitTestHelper(v8::kExternalUnsignedIntArray, 0xffffffff);
-  ExternalArrayLimitTestHelper(v8::kExternalFloatArray, 0x40000000);
-  ExternalArrayLimitTestHelper(v8::kExternalFloatArray, 0xffffffff);
-  ExternalArrayLimitTestHelper(v8::kExternalDoubleArray, 0x40000000);
-  ExternalArrayLimitTestHelper(v8::kExternalDoubleArray, 0xffffffff);
-  ExternalArrayLimitTestHelper(v8::kExternalPixelArray, 0x40000000);
-  ExternalArrayLimitTestHelper(v8::kExternalPixelArray, 0xffffffff);
+  v8::Isolate* isolate = context->GetIsolate();
+  v8::HandleScope scope(isolate);
+  ExtArrayLimitsHelper(isolate, v8::kExternalByteArray, 0x40000000);
+  ExtArrayLimitsHelper(isolate, v8::kExternalByteArray, 0xffffffff);
+  ExtArrayLimitsHelper(isolate, v8::kExternalUnsignedByteArray, 0x40000000);
+  ExtArrayLimitsHelper(isolate, v8::kExternalUnsignedByteArray, 0xffffffff);
+  ExtArrayLimitsHelper(isolate, v8::kExternalShortArray, 0x40000000);
+  ExtArrayLimitsHelper(isolate, v8::kExternalShortArray, 0xffffffff);
+  ExtArrayLimitsHelper(isolate, v8::kExternalUnsignedShortArray, 0x40000000);
+  ExtArrayLimitsHelper(isolate, v8::kExternalUnsignedShortArray, 0xffffffff);
+  ExtArrayLimitsHelper(isolate, v8::kExternalIntArray, 0x40000000);
+  ExtArrayLimitsHelper(isolate, v8::kExternalIntArray, 0xffffffff);
+  ExtArrayLimitsHelper(isolate, v8::kExternalUnsignedIntArray, 0x40000000);
+  ExtArrayLimitsHelper(isolate, v8::kExternalUnsignedIntArray, 0xffffffff);
+  ExtArrayLimitsHelper(isolate, v8::kExternalFloatArray, 0x40000000);
+  ExtArrayLimitsHelper(isolate, v8::kExternalFloatArray, 0xffffffff);
+  ExtArrayLimitsHelper(isolate, v8::kExternalDoubleArray, 0x40000000);
+  ExtArrayLimitsHelper(isolate, v8::kExternalDoubleArray, 0xffffffff);
+  ExtArrayLimitsHelper(isolate, v8::kExternalPixelArray, 0x40000000);
+  ExtArrayLimitsHelper(isolate, v8::kExternalPixelArray, 0xffffffff);
 }
 
 
@@ -16727,12 +16785,12 @@ THREADED_TEST(ScriptContextDependence) {
   v8::Handle<v8::Script> indep =
       v8::Script::New(v8::String::NewFromUtf8(c1->GetIsolate(), source));
   c1->Global()->Set(v8::String::NewFromUtf8(c1->GetIsolate(), "foo"),
-                    v8::Integer::New(100));
+                    v8::Integer::New(c1->GetIsolate(), 100));
   CHECK_EQ(dep->Run()->Int32Value(), 100);
   CHECK_EQ(indep->Run()->Int32Value(), 100);
   LocalContext c2;
   c2->Global()->Set(v8::String::NewFromUtf8(c2->GetIsolate(), "foo"),
-                    v8::Integer::New(101));
+                    v8::Integer::New(c2->GetIsolate(), 101));
   CHECK_EQ(dep->Run()->Int32Value(), 100);
   CHECK_EQ(indep->Run()->Int32Value(), 101);
 }
@@ -16870,8 +16928,8 @@ TEST(CaptureStackTrace) {
   v8::Handle<v8::String> detailed_src =
       v8::String::NewFromUtf8(isolate, detailed_source);
   // Make the script using a non-zero line and column offset.
-  v8::Handle<v8::Integer> line_offset = v8::Integer::New(3);
-  v8::Handle<v8::Integer> column_offset = v8::Integer::New(5);
+  v8::Handle<v8::Integer> line_offset = v8::Integer::New(isolate, 3);
+  v8::Handle<v8::Integer> column_offset = v8::Integer::New(isolate, 5);
   v8::ScriptOrigin detailed_origin(origin, line_offset, column_offset);
   v8::Handle<v8::Script> detailed_script(
       v8::Script::New(detailed_src, &detailed_origin));
@@ -17620,7 +17678,8 @@ static double DoubleFromBits(uint32_t high_bits, uint32_t low_bits) {
 
 THREADED_TEST(QuietSignalingNaNs) {
   LocalContext context;
-  v8::HandleScope scope(context->GetIsolate());
+  v8::Isolate* isolate = context->GetIsolate();
+  v8::HandleScope scope(isolate);
   v8::TryCatch try_catch;
 
   // Special double values.
@@ -17664,7 +17723,7 @@ THREADED_TEST(QuietSignalingNaNs) {
     double test_value = test_values[i];
 
     // Check that Number::New preserves non-NaNs and quiets SNaNs.
-    v8::Handle<v8::Value> number = v8::Number::New(test_value);
+    v8::Handle<v8::Value> number = v8::Number::New(isolate, test_value);
     double stored_number = number->NumberValue();
     if (!std::isnan(test_value)) {
       CHECK_EQ(test_value, stored_number);
@@ -17683,7 +17742,7 @@ THREADED_TEST(QuietSignalingNaNs) {
     // Check that Date::New preserves non-NaNs in the date range and
     // quiets SNaNs.
     v8::Handle<v8::Value> date =
-        v8::Date::New(context->GetIsolate(), test_value);
+        v8::Date::New(isolate, test_value);
     double expected_stored_date = DoubleToDateTime(test_value);
     double stored_date = date->NumberValue();
     if (!std::isnan(expected_stored_date)) {
@@ -17955,17 +18014,19 @@ THREADED_TEST(ScriptLineNumber) {
 
 THREADED_TEST(ScriptColumnNumber) {
   LocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
   v8::ScriptOrigin origin =
-      v8::ScriptOrigin(v8::String::NewFromUtf8(env->GetIsolate(), "test"),
-                       v8::Integer::New(3), v8::Integer::New(2));
+      v8::ScriptOrigin(v8::String::NewFromUtf8(isolate, "test"),
+                       v8::Integer::New(isolate, 3),
+                       v8::Integer::New(isolate, 2));
   v8::Handle<v8::String> script = v8::String::NewFromUtf8(
-      env->GetIsolate(), "function foo() {}\n\n     function bar() {}");
+      isolate, "function foo() {}\n\n     function bar() {}");
   v8::Script::Compile(script, &origin)->Run();
   v8::Local<v8::Function> foo = v8::Local<v8::Function>::Cast(
-      env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "foo")));
+      env->Global()->Get(v8::String::NewFromUtf8(isolate, "foo")));
   v8::Local<v8::Function> bar = v8::Local<v8::Function>::Cast(
-      env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "bar")));
+      env->Global()->Get(v8::String::NewFromUtf8(isolate, "bar")));
   CHECK_EQ(14, foo->GetScriptColumnNumber());
   CHECK_EQ(17, bar->GetScriptColumnNumber());
 }
@@ -17973,7 +18034,8 @@ THREADED_TEST(ScriptColumnNumber) {
 
 THREADED_TEST(FunctionIsBuiltin) {
   LocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
   v8::Local<v8::Function> f;
   f = v8::Local<v8::Function>::Cast(CompileRun("Math.floor"));
   CHECK(f->IsBuiltin());
@@ -17990,18 +18052,20 @@ THREADED_TEST(FunctionIsBuiltin) {
 
 THREADED_TEST(FunctionGetScriptId) {
   LocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
   v8::ScriptOrigin origin =
-      v8::ScriptOrigin(v8::String::NewFromUtf8(env->GetIsolate(), "test"),
-                       v8::Integer::New(3), v8::Integer::New(2));
+      v8::ScriptOrigin(v8::String::NewFromUtf8(isolate, "test"),
+                       v8::Integer::New(isolate, 3),
+                       v8::Integer::New(isolate, 2));
   v8::Handle<v8::String> scriptSource = v8::String::NewFromUtf8(
-      env->GetIsolate(), "function foo() {}\n\n     function bar() {}");
+      isolate, "function foo() {}\n\n     function bar() {}");
   v8::Local<v8::Script> script(v8::Script::Compile(scriptSource, &origin));
   script->Run();
   v8::Local<v8::Function> foo = v8::Local<v8::Function>::Cast(
-      env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "foo")));
+      env->Global()->Get(v8::String::NewFromUtf8(isolate, "foo")));
   v8::Local<v8::Function> bar = v8::Local<v8::Function>::Cast(
-      env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "bar")));
+      env->Global()->Get(v8::String::NewFromUtf8(isolate, "bar")));
   CHECK_EQ(script->GetId(), foo->ScriptId());
   CHECK_EQ(script->GetId(), bar->ScriptId());
 }
@@ -18170,7 +18234,7 @@ TEST(Regress618) {
   v8::Local<v8::Script> script;
 
   // Use a simple object as prototype.
-  v8::Local<v8::Object> prototype = v8::Object::New();
+  v8::Local<v8::Object> prototype = v8::Object::New(context->GetIsolate());
   prototype->Set(v8_str("y"), v8_num(42));
   context->Global()->Set(v8_str("P"), prototype);
 
@@ -19234,7 +19298,7 @@ TEST(PersistentHandleVisitor) {
   LocalContext context;
   v8::Isolate* isolate = context->GetIsolate();
   v8::HandleScope scope(isolate);
-  v8::Persistent<v8::Object> object(isolate, v8::Object::New());
+  v8::Persistent<v8::Object> object(isolate, v8::Object::New(isolate));
   CHECK_EQ(0, object.WrapperClassId());
   object.SetWrapperClassId(42);
   CHECK_EQ(42, object.WrapperClassId());
@@ -19251,7 +19315,7 @@ TEST(WrapperClassId) {
   LocalContext context;
   v8::Isolate* isolate = context->GetIsolate();
   v8::HandleScope scope(isolate);
-  v8::Persistent<v8::Object> object(isolate, v8::Object::New());
+  v8::Persistent<v8::Object> object(isolate, v8::Object::New(isolate));
   CHECK_EQ(0, object.WrapperClassId());
   object.SetWrapperClassId(65535);
   CHECK_EQ(65535, object.WrapperClassId());
@@ -19263,14 +19327,14 @@ TEST(PersistentHandleInNewSpaceVisitor) {
   LocalContext context;
   v8::Isolate* isolate = context->GetIsolate();
   v8::HandleScope scope(isolate);
-  v8::Persistent<v8::Object> object1(isolate, v8::Object::New());
+  v8::Persistent<v8::Object> object1(isolate, v8::Object::New(isolate));
   CHECK_EQ(0, object1.WrapperClassId());
   object1.SetWrapperClassId(42);
   CHECK_EQ(42, object1.WrapperClassId());
 
   CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags);
 
-  v8::Persistent<v8::Object> object2(isolate, v8::Object::New());
+  v8::Persistent<v8::Object> object2(isolate, v8::Object::New(isolate));
   CHECK_EQ(0, object2.WrapperClassId());
   object2.SetWrapperClassId(42);
   CHECK_EQ(42, object2.WrapperClassId());
@@ -19341,7 +19405,7 @@ TEST(RegExp) {
   ExpectTrue("re.test('FoobarbaZ')");
 
   // RegExps are objects on which you can set properties.
-  re->Set(v8_str("property"), v8::Integer::New(32));
+  re->Set(v8_str("property"), v8::Integer::New(context->GetIsolate(), 32));
   v8::Handle<v8::Value> value(CompileRun("re.property"));
   CHECK_EQ(32, value->Int32Value());
 
@@ -19420,7 +19484,7 @@ TEST(DefinePropertyPostDetach) {
 static void InstallContextId(v8::Handle<Context> context, int id) {
   Context::Scope scope(context);
   CompileRun("Object.prototype").As<Object>()->
-      Set(v8_str("context_id"), v8::Integer::New(id));
+      Set(v8_str("context_id"), v8::Integer::New(context->GetIsolate(), id));
 }
 
 
@@ -19445,7 +19509,7 @@ THREADED_TEST(CreationContext) {
   Local<Function> func1;
   {
     Context::Scope scope(context1);
-    object1 = Object::New();
+    object1 = Object::New(isolate);
     func1 = tmpl->GetFunction();
   }
 
@@ -19453,7 +19517,7 @@ THREADED_TEST(CreationContext) {
   Local<Function> func2;
   {
     Context::Scope scope(context2);
-    object2 = Object::New();
+    object2 = Object::New(isolate);
     func2 = tmpl->GetFunction();
   }
 
@@ -19864,7 +19928,7 @@ THREADED_TEST(Regress93759) {
   context->Enter();
 
   // Plain object, no security check.
-  Local<Object> simple_object = Object::New();
+  Local<Object> simple_object = Object::New(isolate);
 
   // Object with explicit security check.
   Local<Object> protected_object =
@@ -19882,14 +19946,14 @@ THREADED_TEST(Regress93759) {
   Local<Object> hidden_prototype =
       hidden_proto_template->GetFunction()->NewInstance();
   Local<Object> object_with_hidden =
-    Object::New();
+    Object::New(isolate);
   object_with_hidden->SetPrototype(hidden_prototype);
 
   // Hidden prototype with security check on the hidden prototype.
   Local<Object> protected_hidden_prototype =
       protected_hidden_proto_template->GetFunction()->NewInstance();
   Local<Object> object_with_protected_hidden =
-    Object::New();
+    Object::New(isolate);
   object_with_protected_hidden->SetPrototype(protected_hidden_prototype);
 
   context->Exit();
@@ -20298,7 +20362,6 @@ TEST(StringEmpty) {
   v8::Isolate* isolate = CcTest::isolate();
   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);
 }
 
@@ -20712,7 +20775,7 @@ THREADED_TEST(Regress2746) {
   LocalContext context;
   v8::Isolate* isolate = context->GetIsolate();
   v8::HandleScope scope(isolate);
-  Local<Object> obj = Object::New();
+  Local<Object> obj = Object::New(isolate);
   Local<String> key = String::NewFromUtf8(context->GetIsolate(), "key");
   obj->SetHiddenValue(key, v8::Undefined(isolate));
   Local<Value> value = obj->GetHiddenValue(key);
@@ -21370,12 +21433,12 @@ THREADED_TEST(FunctionNew) {
   LocalContext env;
   v8::Isolate* isolate = env->GetIsolate();
   v8::HandleScope scope(isolate);
-  Local<Object> data = v8::Object::New();
+  Local<Object> data = v8::Object::New(isolate);
   function_new_expected_env = data;
   Local<Function> func = Function::New(isolate, FunctionNewCallback, data);
   env->Global()->Set(v8_str("func"), func);
   Local<Value> result = CompileRun("func();");
-  CHECK_EQ(v8::Integer::New(17, isolate), result);
+  CHECK_EQ(v8::Integer::New(isolate, 17), result);
   // Verify function not cached
   int serial_number =
       i::Smi::cast(v8::Utils::OpenHandle(*func)
@@ -21385,14 +21448,14 @@ THREADED_TEST(FunctionNew) {
       ->GetElementNoExceptionThrown(i_isolate, serial_number);
   CHECK(elm->IsUndefined());
   // Verify that each Function::New creates a new function instance
-  Local<Object> data2 = v8::Object::New();
+  Local<Object> data2 = v8::Object::New(isolate);
   function_new_expected_env = data2;
   Local<Function> func2 = Function::New(isolate, FunctionNewCallback, data2);
   CHECK(!func2->IsNull());
   CHECK_NE(func, func2);
   env->Global()->Set(v8_str("func2"), func2);
   Local<Value> result2 = CompileRun("func2();");
-  CHECK_EQ(v8::Integer::New(17, isolate), result2);
+  CHECK_EQ(v8::Integer::New(isolate, 17), result2);
 }
 
 
index e6abd3d..20eec2e 100644 (file)
@@ -522,7 +522,7 @@ void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) {
 
   F0 f = FUNCTION_CAST<F0>(Code::cast(code)->entry());
   int res = f();
-  args.GetReturnValue().Set(v8::Integer::New(res));
+  args.GetReturnValue().Set(v8::Integer::New(CcTest::isolate(), res));
 }
 
 
index 473c74d..8dad928 100644 (file)
@@ -604,7 +604,7 @@ void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) {
 
   F0 f = FUNCTION_CAST<F0>(code->entry());
   int res = f();
-  args.GetReturnValue().Set(v8::Integer::New(res));
+  args.GetReturnValue().Set(v8::Integer::New(CcTest::isolate(), res));
 }
 
 
index 48de81f..f15ed3c 100644 (file)
@@ -369,7 +369,7 @@ TEST(OptimizedCodeSharing) {
   for (int i = 0; i < 10; i++) {
     LocalContext env;
     env->Global()->Set(v8::String::NewFromUtf8(CcTest::isolate(), "x"),
-                       v8::Integer::New(i));
+                       v8::Integer::New(CcTest::isolate(), i));
     CompileRun("function MakeClosure() {"
                "  return function() { return x; };"
                "}"
index ab4dd70..4c6dabe 100644 (file)
@@ -550,7 +550,9 @@ TEST(CollectCpuProfile) {
       env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "start")));
 
   int32_t profiling_interval_ms = 200;
-  v8::Handle<v8::Value> args[] = { v8::Integer::New(profiling_interval_ms) };
+  v8::Handle<v8::Value> args[] = {
+    v8::Integer::New(env->GetIsolate(), profiling_interval_ms)
+  };
   const v8::CpuProfile* profile =
       RunProfiler(env, function, args, ARRAY_SIZE(args), 200);
   function->Call(env->Global(), ARRAY_SIZE(args), args);
@@ -622,7 +624,9 @@ TEST(SampleWhenFrameIsNotSetup) {
   // Simulators are much slower.
   repeat_count = 1;
 #endif
-  v8::Handle<v8::Value> args[] = { v8::Integer::New(repeat_count) };
+  v8::Handle<v8::Value> args[] = {
+    v8::Integer::New(env->GetIsolate(), repeat_count)
+  };
   const v8::CpuProfile* profile =
       RunProfiler(env, function, args, ARRAY_SIZE(args), 100);
 
@@ -742,7 +746,7 @@ TEST(NativeAccessorUninitializedIC) {
       env->Global()->Get(v8::String::NewFromUtf8(isolate, "start")));
 
   int32_t repeat_count = 1;
-  v8::Handle<v8::Value> args[] = { v8::Integer::New(repeat_count) };
+  v8::Handle<v8::Value> args[] = { v8::Integer::New(isolate, repeat_count) };
   const v8::CpuProfile* profile =
       RunProfiler(env, function, args, ARRAY_SIZE(args), 180);
 
@@ -791,13 +795,15 @@ TEST(NativeAccessorMonomorphicIC) {
     // profiling.
     accessors.set_warming_up(true);
     int32_t warm_up_iterations = 3;
-    v8::Handle<v8::Value> args[] = { v8::Integer::New(warm_up_iterations) };
+    v8::Handle<v8::Value> args[] = {
+      v8::Integer::New(isolate, warm_up_iterations)
+    };
     function->Call(env->Global(), ARRAY_SIZE(args), args);
     accessors.set_warming_up(false);
   }
 
   int32_t repeat_count = 100;
-  v8::Handle<v8::Value> args[] = { v8::Integer::New(repeat_count) };
+  v8::Handle<v8::Value> args[] = { v8::Integer::New(isolate, repeat_count) };
   const v8::CpuProfile* profile =
       RunProfiler(env, function, args, ARRAY_SIZE(args), 200);
 
@@ -851,7 +857,7 @@ TEST(NativeMethodUninitializedIC) {
       env->Global()->Get(v8::String::NewFromUtf8(isolate, "start")));
 
   int32_t repeat_count = 1;
-  v8::Handle<v8::Value> args[] = { v8::Integer::New(repeat_count) };
+  v8::Handle<v8::Value> args[] = { v8::Integer::New(isolate, repeat_count) };
   const v8::CpuProfile* profile =
       RunProfiler(env, function, args, ARRAY_SIZE(args), 100);
 
@@ -900,13 +906,15 @@ TEST(NativeMethodMonomorphicIC) {
     // profiling.
     callbacks.set_warming_up(true);
     int32_t warm_up_iterations = 3;
-    v8::Handle<v8::Value> args[] = { v8::Integer::New(warm_up_iterations) };
+    v8::Handle<v8::Value> args[] = {
+      v8::Integer::New(isolate, warm_up_iterations)
+    };
     function->Call(env->Global(), ARRAY_SIZE(args), args);
     callbacks.set_warming_up(false);
   }
 
   int32_t repeat_count = 100;
-  v8::Handle<v8::Value> args[] = { v8::Integer::New(repeat_count) };
+  v8::Handle<v8::Value> args[] = { v8::Integer::New(isolate, repeat_count) };
   const v8::CpuProfile* profile =
       RunProfiler(env, function, args, ARRAY_SIZE(args), 100);
 
@@ -945,7 +953,9 @@ TEST(BoundFunctionCall) {
       env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "start")));
 
   int32_t duration_ms = 100;
-  v8::Handle<v8::Value> args[] = { v8::Integer::New(duration_ms) };
+  v8::Handle<v8::Value> args[] = {
+    v8::Integer::New(env->GetIsolate(), duration_ms)
+  };
   const v8::CpuProfile* profile =
       RunProfiler(env, function, args, ARRAY_SIZE(args), 100);
 
@@ -1004,7 +1014,9 @@ TEST(FunctionCallSample) {
       env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "start")));
 
   int32_t duration_ms = 100;
-  v8::Handle<v8::Value> args[] = { v8::Integer::New(duration_ms) };
+  v8::Handle<v8::Value> args[] = {
+    v8::Integer::New(env->GetIsolate(), duration_ms)
+  };
   const v8::CpuProfile* profile =
       RunProfiler(env, function, args, ARRAY_SIZE(args), 100);
 
@@ -1084,7 +1096,9 @@ TEST(FunctionApplySample) {
       env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "start")));
 
   int32_t duration_ms = 100;
-  v8::Handle<v8::Value> args[] = { v8::Integer::New(duration_ms) };
+  v8::Handle<v8::Value> args[] = {
+    v8::Integer::New(env->GetIsolate(), duration_ms)
+  };
 
   const v8::CpuProfile* profile =
       RunProfiler(env, function, args, ARRAY_SIZE(args), 100);
@@ -1191,7 +1205,9 @@ TEST(JsNativeJsSample) {
       env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "start")));
 
   int32_t duration_ms = 20;
-  v8::Handle<v8::Value> args[] = { v8::Integer::New(duration_ms) };
+  v8::Handle<v8::Value> args[] = {
+    v8::Integer::New(env->GetIsolate(), duration_ms)
+  };
   const v8::CpuProfile* profile =
       RunProfiler(env, function, args, ARRAY_SIZE(args), 10);
 
@@ -1275,7 +1291,9 @@ TEST(JsNativeJsRuntimeJsSample) {
       env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "start")));
 
   int32_t duration_ms = 20;
-  v8::Handle<v8::Value> args[] = { v8::Integer::New(duration_ms) };
+  v8::Handle<v8::Value> args[] = {
+    v8::Integer::New(env->GetIsolate(), duration_ms)
+  };
   const v8::CpuProfile* profile =
       RunProfiler(env, function, args, ARRAY_SIZE(args), 10);
 
@@ -1368,7 +1386,9 @@ TEST(JsNative1JsNative2JsSample) {
       env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "start")));
 
   int32_t duration_ms = 20;
-  v8::Handle<v8::Value> args[] = { v8::Integer::New(duration_ms) };
+  v8::Handle<v8::Value> args[] = {
+    v8::Integer::New(env->GetIsolate(), duration_ms)
+  };
   const v8::CpuProfile* profile =
       RunProfiler(env, function, args, ARRAY_SIZE(args), 10);
 
index 463fa80..59557b8 100644 (file)
@@ -644,7 +644,9 @@ static void DebugEventBreakPointHitCount(
     if (!frame_function_name.IsEmpty()) {
       // Get the name of the function.
       const int argc = 2;
-      v8::Handle<v8::Value> argv[argc] = { exec_state, v8::Integer::New(0) };
+      v8::Handle<v8::Value> argv[argc] = {
+        exec_state, v8::Integer::New(CcTest::isolate(), 0)
+      };
       v8::Handle<v8::Value> result = frame_function_name->Call(exec_state,
                                                                argc, argv);
       if (result->IsUndefined()) {
@@ -891,7 +893,9 @@ static void DebugEventStepSequence(
     CHECK(break_point_hit_count <
           StrLength(expected_step_sequence));
     const int argc = 2;
-    v8::Handle<v8::Value> argv[argc] = { exec_state, v8::Integer::New(0) };
+    v8::Handle<v8::Value> argv[argc] = {
+      exec_state, v8::Integer::New(CcTest::isolate(), 0)
+    };
     v8::Handle<v8::Value> result = frame_function_name->Call(exec_state,
                                                              argc, argv);
     CHECK(result->IsString());
@@ -2096,7 +2100,7 @@ TEST(ScriptBreakPointLineOffset) {
   // Create script origin both name and line offset.
   v8::ScriptOrigin origin(
       v8::String::NewFromUtf8(env->GetIsolate(), "test.html"),
-      v8::Integer::New(7));
+      v8::Integer::New(env->GetIsolate(), 7));
 
   // Set two script break points before the script is loaded.
   int sbp1 =
@@ -2179,7 +2183,7 @@ TEST(ScriptBreakPointLine) {
   break_point_hit_count = 0;
   v8::ScriptOrigin origin(
       v8::String::NewFromUtf8(env->GetIsolate(), "test.html"),
-      v8::Integer::New(0));
+      v8::Integer::New(env->GetIsolate(), 0));
   v8::Script::Compile(script, &origin)->Run();
   f = v8::Local<v8::Function>::Cast(
       env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "f")));
@@ -2514,7 +2518,7 @@ TEST(DebugEvaluate) {
   checks = checks_uu;
   v8::Handle<v8::Value> argv_bar_1[2] = {
     v8::Undefined(isolate),
-    v8::Number::New(barbar_break_position)
+    v8::Number::New(isolate, barbar_break_position)
   };
   bar->Call(env->Global(), 2, argv_bar_1);
 
@@ -2523,7 +2527,7 @@ TEST(DebugEvaluate) {
   checks = checks_hu;
   v8::Handle<v8::Value> argv_bar_2[2] = {
     v8::String::NewFromUtf8(env->GetIsolate(), "Hello, world!"),
-    v8::Number::New(barbar_break_position)
+    v8::Number::New(env->GetIsolate(), barbar_break_position)
   };
   bar->Call(env->Global(), 2, argv_bar_2);
 
@@ -2532,7 +2536,7 @@ TEST(DebugEvaluate) {
   checks = checks_hh;
   v8::Handle<v8::Value> argv_bar_3[2] = {
     v8::String::NewFromUtf8(env->GetIsolate(), "Hello, world!"),
-    v8::Number::New(barbar_break_position + 1)
+    v8::Number::New(env->GetIsolate(), barbar_break_position + 1)
   };
   bar->Call(env->Global(), 2, argv_bar_3);
 
@@ -2865,7 +2869,8 @@ TEST(DebugStepKeyedLoadLoop) {
   // Create array [0,1,2,3,4,5,6,7,8,9]
   v8::Local<v8::Array> a = v8::Array::New(env->GetIsolate(), 10);
   for (int i = 0; i < 10; i++) {
-    a->Set(v8::Number::New(i), v8::Number::New(i));
+    a->Set(v8::Number::New(env->GetIsolate(), i),
+           v8::Number::New(env->GetIsolate(), i));
   }
 
   // Call function without any break points to ensure inlining is in place.
@@ -2912,7 +2917,8 @@ TEST(DebugStepKeyedStoreLoop) {
   // Create array [0,1,2,3,4,5,6,7,8,9]
   v8::Local<v8::Array> a = v8::Array::New(env->GetIsolate(), 10);
   for (int i = 0; i < 10; i++) {
-    a->Set(v8::Number::New(i), v8::Number::New(i));
+    a->Set(v8::Number::New(env->GetIsolate(), i),
+           v8::Number::New(env->GetIsolate(), i));
   }
 
   // Call function without any break points to ensure inlining is in place.
@@ -3178,7 +3184,8 @@ TEST(DebugStepIf) {
 
 TEST(DebugStepSwitch) {
   DebugLocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
 
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener2(DebugEventStep);
@@ -3208,21 +3215,21 @@ TEST(DebugStepSwitch) {
   // One case with fall-through.
   step_action = StepIn;
   break_point_hit_count = 0;
-  v8::Handle<v8::Value> argv_1[argc] = { v8::Number::New(1) };
+  v8::Handle<v8::Value> argv_1[argc] = { v8::Number::New(isolate, 1) };
   foo->Call(env->Global(), argc, argv_1);
   CHECK_EQ(6, break_point_hit_count);
 
   // Another case.
   step_action = StepIn;
   break_point_hit_count = 0;
-  v8::Handle<v8::Value> argv_2[argc] = { v8::Number::New(2) };
+  v8::Handle<v8::Value> argv_2[argc] = { v8::Number::New(isolate, 2) };
   foo->Call(env->Global(), argc, argv_2);
   CHECK_EQ(5, break_point_hit_count);
 
   // Last case.
   step_action = StepIn;
   break_point_hit_count = 0;
-  v8::Handle<v8::Value> argv_3[argc] = { v8::Number::New(3) };
+  v8::Handle<v8::Value> argv_3[argc] = { v8::Number::New(isolate, 3) };
   foo->Call(env->Global(), argc, argv_3);
   CHECK_EQ(7, break_point_hit_count);
 
@@ -3234,7 +3241,8 @@ TEST(DebugStepSwitch) {
 
 TEST(DebugStepWhile) {
   DebugLocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
 
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener2(DebugEventStep);
@@ -3255,14 +3263,14 @@ TEST(DebugStepWhile) {
   // Looping 10 times.
   step_action = StepIn;
   break_point_hit_count = 0;
-  v8::Handle<v8::Value> argv_10[argc] = { v8::Number::New(10) };
+  v8::Handle<v8::Value> argv_10[argc] = { v8::Number::New(isolate, 10) };
   foo->Call(env->Global(), argc, argv_10);
   CHECK_EQ(22, break_point_hit_count);
 
   // Looping 100 times.
   step_action = StepIn;
   break_point_hit_count = 0;
-  v8::Handle<v8::Value> argv_100[argc] = { v8::Number::New(100) };
+  v8::Handle<v8::Value> argv_100[argc] = { v8::Number::New(isolate, 100) };
   foo->Call(env->Global(), argc, argv_100);
   CHECK_EQ(202, break_point_hit_count);
 
@@ -3274,7 +3282,8 @@ TEST(DebugStepWhile) {
 
 TEST(DebugStepDoWhile) {
   DebugLocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
 
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener2(DebugEventStep);
@@ -3295,14 +3304,14 @@ TEST(DebugStepDoWhile) {
   // Looping 10 times.
   step_action = StepIn;
   break_point_hit_count = 0;
-  v8::Handle<v8::Value> argv_10[argc] = { v8::Number::New(10) };
+  v8::Handle<v8::Value> argv_10[argc] = { v8::Number::New(isolate, 10) };
   foo->Call(env->Global(), argc, argv_10);
   CHECK_EQ(22, break_point_hit_count);
 
   // Looping 100 times.
   step_action = StepIn;
   break_point_hit_count = 0;
-  v8::Handle<v8::Value> argv_100[argc] = { v8::Number::New(100) };
+  v8::Handle<v8::Value> argv_100[argc] = { v8::Number::New(isolate, 100) };
   foo->Call(env->Global(), argc, argv_100);
   CHECK_EQ(202, break_point_hit_count);
 
@@ -3314,7 +3323,8 @@ TEST(DebugStepDoWhile) {
 
 TEST(DebugStepFor) {
   DebugLocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
 
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener2(DebugEventStep);
@@ -3336,14 +3346,14 @@ TEST(DebugStepFor) {
   // Looping 10 times.
   step_action = StepIn;
   break_point_hit_count = 0;
-  v8::Handle<v8::Value> argv_10[argc] = { v8::Number::New(10) };
+  v8::Handle<v8::Value> argv_10[argc] = { v8::Number::New(isolate, 10) };
   foo->Call(env->Global(), argc, argv_10);
   CHECK_EQ(23, break_point_hit_count);
 
   // Looping 100 times.
   step_action = StepIn;
   break_point_hit_count = 0;
-  v8::Handle<v8::Value> argv_100[argc] = { v8::Number::New(100) };
+  v8::Handle<v8::Value> argv_100[argc] = { v8::Number::New(isolate, 100) };
   foo->Call(env->Global(), argc, argv_100);
   CHECK_EQ(203, break_point_hit_count);
 
@@ -3355,7 +3365,8 @@ TEST(DebugStepFor) {
 
 TEST(DebugStepForContinue) {
   DebugLocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
 
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener2(DebugEventStep);
@@ -3385,7 +3396,7 @@ TEST(DebugStepForContinue) {
   // Looping 10 times.
   step_action = StepIn;
   break_point_hit_count = 0;
-  v8::Handle<v8::Value> argv_10[argc] = { v8::Number::New(10) };
+  v8::Handle<v8::Value> argv_10[argc] = { v8::Number::New(isolate, 10) };
   result = foo->Call(env->Global(), argc, argv_10);
   CHECK_EQ(5, result->Int32Value());
   CHECK_EQ(52, break_point_hit_count);
@@ -3393,7 +3404,7 @@ TEST(DebugStepForContinue) {
   // Looping 100 times.
   step_action = StepIn;
   break_point_hit_count = 0;
-  v8::Handle<v8::Value> argv_100[argc] = { v8::Number::New(100) };
+  v8::Handle<v8::Value> argv_100[argc] = { v8::Number::New(isolate, 100) };
   result = foo->Call(env->Global(), argc, argv_100);
   CHECK_EQ(50, result->Int32Value());
   CHECK_EQ(457, break_point_hit_count);
@@ -3406,7 +3417,8 @@ TEST(DebugStepForContinue) {
 
 TEST(DebugStepForBreak) {
   DebugLocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
 
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener2(DebugEventStep);
@@ -3437,7 +3449,7 @@ TEST(DebugStepForBreak) {
   // Looping 10 times.
   step_action = StepIn;
   break_point_hit_count = 0;
-  v8::Handle<v8::Value> argv_10[argc] = { v8::Number::New(10) };
+  v8::Handle<v8::Value> argv_10[argc] = { v8::Number::New(isolate, 10) };
   result = foo->Call(env->Global(), argc, argv_10);
   CHECK_EQ(9, result->Int32Value());
   CHECK_EQ(55, break_point_hit_count);
@@ -3445,7 +3457,7 @@ TEST(DebugStepForBreak) {
   // Looping 100 times.
   step_action = StepIn;
   break_point_hit_count = 0;
-  v8::Handle<v8::Value> argv_100[argc] = { v8::Number::New(100) };
+  v8::Handle<v8::Value> argv_100[argc] = { v8::Number::New(isolate, 100) };
   result = foo->Call(env->Global(), argc, argv_100);
   CHECK_EQ(99, result->Int32Value());
   CHECK_EQ(505, break_point_hit_count);
@@ -3520,7 +3532,7 @@ TEST(DebugStepWith) {
                     "}"
                     "foo()";
   env->Global()->Set(v8::String::NewFromUtf8(env->GetIsolate(), "b"),
-                     v8::Object::New());
+                     v8::Object::New(env->GetIsolate()));
   v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
   v8::Handle<v8::Value> result;
   SetBreakPoint(foo, 8);  // "var a = {};"
@@ -3859,7 +3871,7 @@ TEST(PauseInScript) {
 
   v8::ScriptOrigin origin(
       v8::String::NewFromUtf8(env->GetIsolate(), script_name),
-      v8::Integer::New(0));
+      v8::Integer::New(env->GetIsolate(), 0));
   v8::Handle<v8::Script> script = v8::Script::Compile(
       v8::String::NewFromUtf8(env->GetIsolate(), src), &origin);
   v8::Local<v8::Value> r = script->Run();
@@ -4171,7 +4183,8 @@ TEST(DebugBreak) {
   i::FLAG_verify_heap = true;
 #endif
   DebugLocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
 
   // Register a debug event listener which sets the break flag and counts.
   v8::Debug::SetDebugEventListener2(DebugEventBreak);
@@ -4187,10 +4200,10 @@ TEST(DebugBreak) {
   v8::Local<v8::Function> f3 = CompileFunction(&env, src, "f3");
 
   // Call the function to make sure it is compiled.
-  v8::Handle<v8::Value> argv[] = { v8::Number::New(1),
-                                   v8::Number::New(1),
-                                   v8::Number::New(1),
-                                   v8::Number::New(1) };
+  v8::Handle<v8::Value> argv[] = { v8::Number::New(isolate, 1),
+                                   v8::Number::New(isolate, 1),
+                                   v8::Number::New(isolate, 1),
+                                   v8::Number::New(isolate, 1) };
 
   // Call all functions to make sure that they are compiled.
   f0->Call(env->Global(), 0, NULL);
@@ -4294,20 +4307,21 @@ TEST(NoBreakWhenBootstrapping) {
 
 static void NamedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) {
   v8::Handle<v8::Array> result = v8::Array::New(info.GetIsolate(), 3);
-  result->Set(v8::Integer::New(0),
+  result->Set(v8::Integer::New(info.GetIsolate(), 0),
               v8::String::NewFromUtf8(info.GetIsolate(), "a"));
-  result->Set(v8::Integer::New(1),
+  result->Set(v8::Integer::New(info.GetIsolate(), 1),
               v8::String::NewFromUtf8(info.GetIsolate(), "b"));
-  result->Set(v8::Integer::New(2),
+  result->Set(v8::Integer::New(info.GetIsolate(), 2),
               v8::String::NewFromUtf8(info.GetIsolate(), "c"));
   info.GetReturnValue().Set(result);
 }
 
 
 static void IndexedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) {
-  v8::Handle<v8::Array> result = v8::Array::New(info.GetIsolate(), 2);
-  result->Set(v8::Integer::New(0), v8::Number::New(1));
-  result->Set(v8::Integer::New(1), v8::Number::New(10));
+  v8::Isolate* isolate = info.GetIsolate();
+  v8::Handle<v8::Array> result = v8::Array::New(isolate, 2);
+  result->Set(v8::Integer::New(isolate, 0), v8::Number::New(isolate, 1));
+  result->Set(v8::Integer::New(isolate, 1), v8::Number::New(isolate, 10));
   info.GetReturnValue().Set(result);
 }
 
@@ -4482,18 +4496,18 @@ TEST(HiddenPrototypePropertyMirror) {
 
   v8::Handle<v8::FunctionTemplate> t0 = v8::FunctionTemplate::New(isolate);
   t0->InstanceTemplate()->Set(v8::String::NewFromUtf8(isolate, "x"),
-                              v8::Number::New(0));
+                              v8::Number::New(isolate, 0));
   v8::Handle<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New(isolate);
   t1->SetHiddenPrototype(true);
   t1->InstanceTemplate()->Set(v8::String::NewFromUtf8(isolate, "y"),
-                              v8::Number::New(1));
+                              v8::Number::New(isolate, 1));
   v8::Handle<v8::FunctionTemplate> t2 = v8::FunctionTemplate::New(isolate);
   t2->SetHiddenPrototype(true);
   t2->InstanceTemplate()->Set(v8::String::NewFromUtf8(isolate, "z"),
-                              v8::Number::New(2));
+                              v8::Number::New(isolate, 2));
   v8::Handle<v8::FunctionTemplate> t3 = v8::FunctionTemplate::New(isolate);
   t3->InstanceTemplate()->Set(v8::String::NewFromUtf8(isolate, "u"),
-                              v8::Number::New(3));
+                              v8::Number::New(isolate, 3));
 
   // Create object and set them on the global object.
   v8::Handle<v8::Object> o0 = t0->GetFunction()->NewInstance();
@@ -4671,7 +4685,7 @@ TEST(NoHiddenProperties) {
   // Set a hidden property on the object.
   obj->SetHiddenValue(
       v8::String::NewFromUtf8(isolate, "v8::test-debug::a"),
-      v8::Int32::New(11));
+      v8::Int32::New(isolate, 11));
 
   // Get mirror for the object with property getter.
   CompileRun("var obj_mirror = debug.MakeMirror(obj);");
@@ -4689,24 +4703,24 @@ TEST(NoHiddenProperties) {
   // Object created by t0 will become hidden prototype of object 'obj'.
   v8::Handle<v8::FunctionTemplate> t0 = v8::FunctionTemplate::New(isolate);
   t0->InstanceTemplate()->Set(v8::String::NewFromUtf8(isolate, "b"),
-                              v8::Number::New(2));
+                              v8::Number::New(isolate, 2));
   t0->SetHiddenPrototype(true);
   v8::Handle<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New(isolate);
   t1->InstanceTemplate()->Set(v8::String::NewFromUtf8(isolate, "c"),
-                              v8::Number::New(3));
+                              v8::Number::New(isolate, 3));
 
   // Create proto objects, add hidden properties to them and set them on
   // the global object.
   v8::Handle<v8::Object> protoObj = t0->GetFunction()->NewInstance();
   protoObj->SetHiddenValue(
       v8::String::NewFromUtf8(isolate, "v8::test-debug::b"),
-      v8::Int32::New(12));
+      v8::Int32::New(isolate, 12));
   env->Global()->Set(v8::String::NewFromUtf8(isolate, "protoObj"),
                      protoObj);
   v8::Handle<v8::Object> grandProtoObj = t1->GetFunction()->NewInstance();
   grandProtoObj->SetHiddenValue(
       v8::String::NewFromUtf8(isolate, "v8::test-debug::c"),
-      v8::Int32::New(13));
+      v8::Int32::New(isolate, 13));
   env->Global()->Set(
       v8::String::NewFromUtf8(isolate, "grandProtoObj"),
       grandProtoObj);
@@ -5613,7 +5627,8 @@ TEST(CallFunctionInDebugger) {
 
   // Calling a function through the debugger returns 0 frames if there are
   // no JavaScript frames.
-  CHECK_EQ(v8::Integer::New(0), v8::Debug::Call(frame_count));
+  CHECK_EQ(v8::Integer::New(CcTest::isolate(), 0),
+           v8::Debug::Call(frame_count));
 
   // Test that the number of frames can be retrieved.
   v8::Script::Compile(
@@ -5643,7 +5658,7 @@ TEST(CallFunctionInDebugger) {
 
   // Test that the source line is correct when there is a line offset.
   v8::ScriptOrigin origin(v8::String::NewFromUtf8(CcTest::isolate(), "test"),
-                          v8::Integer::New(7));
+                          v8::Integer::New(CcTest::isolate(), 7));
   v8::Script::Compile(
       v8::String::NewFromUtf8(CcTest::isolate(), "CheckSourceLine(7)"), &origin)
       ->Run();
@@ -6444,7 +6459,9 @@ static void DebugEventDebugBreak(
     if (!frame_function_name.IsEmpty()) {
       // Get the name of the function.
       const int argc = 2;
-      v8::Handle<v8::Value> argv[argc] = { exec_state, v8::Integer::New(0) };
+      v8::Handle<v8::Value> argv[argc] = {
+        exec_state, v8::Integer::New(CcTest::isolate(), 0)
+      };
       v8::Handle<v8::Value> result = frame_function_name->Call(exec_state,
                                                                argc, argv);
       if (result->IsUndefined()) {
@@ -6860,8 +6877,8 @@ TEST(ProvisionalBreakpointOnLineOutOfRange) {
 
   v8::ScriptOrigin origin(
       v8::String::NewFromUtf8(env->GetIsolate(), resource_name),
-      v8::Integer::New(10),
-      v8::Integer::New(1));
+      v8::Integer::New(env->GetIsolate(), 10),
+      v8::Integer::New(env->GetIsolate(), 1));
   // Compile a script whose first line number is greater than the breakpoints'
   // lines.
   v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), script),
@@ -7205,8 +7222,8 @@ static void DebugEventContextChecker(const v8::Debug::EventDetails& details) {
 TEST(DebugEventContext) {
   v8::Isolate* isolate = CcTest::isolate();
   v8::HandleScope scope(isolate);
-  expected_callback_data = v8::Int32::New(2010);
   expected_context = v8::Context::New(isolate);
+  expected_callback_data = v8::Int32::New(isolate, 2010);
   v8::Debug::SetDebugEventListener2(DebugEventContextChecker,
                                     expected_callback_data);
   v8::Context::Scope context_scope(expected_context);
@@ -7303,7 +7320,9 @@ static void DebugEventBreakDeoptimize(
     if (!frame_function_name.IsEmpty()) {
       // Get the name of the function.
       const int argc = 2;
-      v8::Handle<v8::Value> argv[argc] = { exec_state, v8::Integer::New(0) };
+      v8::Handle<v8::Value> argv[argc] = {
+        exec_state, v8::Integer::New(CcTest::isolate(), 0)
+      };
       v8::Handle<v8::Value> result =
           frame_function_name->Call(exec_state, argc, argv);
       if (!result->IsUndefined()) {
@@ -7367,7 +7386,9 @@ static void DebugEventBreakWithOptimizedStack(
     if (!frame_function_name.IsEmpty()) {
       for (int i = 0; i < 2; i++) {
         const int argc = 2;
-        v8::Handle<v8::Value> argv[argc] = { exec_state, v8::Integer::New(i) };
+        v8::Handle<v8::Value> argv[argc] = {
+          exec_state, v8::Integer::New(isolate, i)
+        };
         // Get the name of the function in frame i.
         v8::Handle<v8::Value> result =
             frame_function_name->Call(exec_state, argc, argv);
index 5bc432e..f2169a9 100644 (file)
@@ -147,17 +147,17 @@ static void VerifyRead(v8::Handle<v8::DeclaredAccessorDescriptor> descriptor,
 
 
 static v8::Handle<v8::Value> Convert(int32_t value, v8::Isolate* isolate) {
-  return v8::Integer::New(value, isolate);
+  return v8::Integer::New(isolate, value);
 }
 
 
-static v8::Handle<v8::Value> Convert(float value, v8::Isolate*) {
-  return v8::Number::New(value);
+static v8::Handle<v8::Value> Convert(float value, v8::Isolate* isolate) {
+  return v8::Number::New(isolate, value);
 }
 
 
-static v8::Handle<v8::Value> Convert(double value, v8::Isolate*) {
-  return v8::Number::New(value);
+static v8::Handle<v8::Value> Convert(double value, v8::Isolate* isolate) {
+  return v8::Number::New(isolate, value);
 }
 
 
@@ -277,10 +277,12 @@ TEST(PointerDereferenceRead) {
   AlignedArray* array = helper.array_.get();
   array->As<uintptr_t**>()[first_index] =
       &array->As<uintptr_t*>()[pointed_to_index];
-  VerifyRead(descriptor, internal_field, array, v8::Integer::New(0));
+  VerifyRead(descriptor, internal_field, array,
+             v8::Integer::New(helper.isolate_, 0));
   second_index += pointed_to_index*sizeof(uintptr_t)/sizeof(uint16_t);
   array->As<uint16_t*>()[second_index] = expected;
-  VerifyRead(descriptor, internal_field, array, v8::Integer::New(expected));
+  VerifyRead(descriptor, internal_field, array,
+             v8::Integer::New(helper.isolate_, expected));
 }
 
 
index 6ae23f2..1f22c9f 100644 (file)
@@ -96,6 +96,8 @@ class DeclarationContext {
   static void HandleQuery(Local<String> key,
                           const v8::PropertyCallbackInfo<v8::Integer>& info);
 
+  v8::Isolate* isolate() const { return CcTest::isolate(); }
+
  private:
   bool is_initialized_;
   Persistent<Context> context_;
@@ -244,7 +246,7 @@ TEST(Unknown) {
                   1,  // access
                   2,  // declaration + initialization
                   2,  // declaration + initialization
-                  EXPECT_RESULT, Number::New(0));
+                  EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
   }
 
   { DeclarationContext context;
@@ -278,7 +280,7 @@ TEST(Unknown) {
 class PresentPropertyContext: public DeclarationContext {
  protected:
   virtual v8::Handle<Integer> Query(Local<String> key) {
-    return Integer::New(v8::None);
+    return Integer::New(isolate(), v8::None);
   }
 };
 
@@ -300,7 +302,7 @@ TEST(Present) {
                   1,  // access
                   1,  // initialization
                   2,  // declaration + initialization
-                  EXPECT_RESULT, Number::New(0));
+                  EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
   }
 
   { PresentPropertyContext context;
@@ -324,7 +326,7 @@ TEST(Present) {
                   1,  // access
                   1,  // initialization
                   1,  // (re-)declaration
-                  EXPECT_RESULT, Number::New(0));
+                  EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
   }
 }
 
@@ -356,7 +358,7 @@ TEST(Absent) {
                   1,  // access
                   2,  // declaration + initialization
                   2,  // declaration + initialization
-                  EXPECT_RESULT, Number::New(0));
+                  EXPECT_RESULT, Number::New(isolate, 0));
   }
 
   { AbsentPropertyContext context;
@@ -416,7 +418,7 @@ class AppearingPropertyContext: public DeclarationContext {
         // Return that the property is present so we only get the
         // setter called when initializing with a value.
         state_ = UNKNOWN;
-        return Integer::New(v8::None);
+        return Integer::New(isolate(), v8::None);
       default:
         CHECK(state_ == UNKNOWN);
         break;
@@ -447,7 +449,7 @@ TEST(Appearing) {
                   1,  // access
                   2,  // declaration + initialization
                   2,  // declaration + initialization
-                  EXPECT_RESULT, Number::New(0));
+                  EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
   }
 
   { AppearingPropertyContext context;
@@ -502,7 +504,7 @@ class ReappearingPropertyContext: public DeclarationContext {
         // Ignore the second declaration by returning
         // that the property is already there.
         state_ = INITIALIZE;
-        return Integer::New(v8::None);
+        return Integer::New(isolate(), v8::None);
       case INITIALIZE:
         // Force an initialization by returning that
         // the property is absent. This will make sure
@@ -539,10 +541,12 @@ TEST(Reappearing) {
 
 
 class ExistsInPrototypeContext: public DeclarationContext {
+ public:
+  ExistsInPrototypeContext() { InitializeIfNeeded(); }
  protected:
   virtual v8::Handle<Integer> Query(Local<String> key) {
     // Let it seem that the property exists in the prototype object.
-    return Integer::New(v8::None);
+    return Integer::New(isolate(), v8::None);
   }
 
   // Use the prototype as the holder for the interceptors.
@@ -563,7 +567,7 @@ TEST(ExistsInPrototype) {
                   0,
                   0,
                   0,
-                  EXPECT_RESULT, Number::New(87));
+                  EXPECT_RESULT, Number::New(CcTest::isolate(), 87));
   }
 
   { ExistsInPrototypeContext context;
@@ -579,7 +583,7 @@ TEST(ExistsInPrototype) {
                   0,
                   0,
                   0,
-                  EXPECT_RESULT, Number::New(0));
+                  EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
   }
 
   { ExistsInPrototypeContext context;
@@ -595,7 +599,7 @@ TEST(ExistsInPrototype) {
                   0,
                   0,
                   0,
-                  EXPECT_RESULT, Number::New(0));
+                  EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
   }
 }
 
@@ -641,7 +645,7 @@ class ExistsInHiddenPrototypeContext: public DeclarationContext {
  protected:
   virtual v8::Handle<Integer> Query(Local<String> key) {
     // Let it seem that the property exists in the hidden prototype object.
-    return Integer::New(v8::None);
+    return Integer::New(isolate(), v8::None);
   }
 
   // Install the hidden prototype after the global object has been created.
@@ -680,7 +684,7 @@ TEST(ExistsInHiddenPrototype) {
                   1,  // access
                   1,  // initialization
                   2,  // declaration + initialization
-                  EXPECT_RESULT, Number::New(0));
+                  EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
   }
 
   { ExistsInHiddenPrototypeContext context;
@@ -706,7 +710,7 @@ TEST(ExistsInHiddenPrototype) {
                   0,
                   0,
                   1,  // (re-)declaration
-                  EXPECT_RESULT, Number::New(0));
+                  EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
   }
 }
 
@@ -759,40 +763,41 @@ class SimpleContext {
 
 
 TEST(CrossScriptReferences) {
-  HandleScope scope(CcTest::isolate());
+  v8::Isolate* isolate = CcTest::isolate();
+  HandleScope scope(isolate);
 
   { SimpleContext context;
     context.Check("var x = 1; x",
-                  EXPECT_RESULT, Number::New(1));
+                  EXPECT_RESULT, Number::New(isolate, 1));
     context.Check("var x = 2; x",
-                  EXPECT_RESULT, Number::New(2));
+                  EXPECT_RESULT, Number::New(isolate, 2));
     context.Check("const x = 3; x",
-                  EXPECT_RESULT, Number::New(3));
+                  EXPECT_RESULT, Number::New(isolate, 3));
     context.Check("const x = 4; x",
-                  EXPECT_RESULT, Number::New(4));
+                  EXPECT_RESULT, Number::New(isolate, 4));
     context.Check("x = 5; x",
-                  EXPECT_RESULT, Number::New(5));
+                  EXPECT_RESULT, Number::New(isolate, 5));
     context.Check("var x = 6; x",
-                  EXPECT_RESULT, Number::New(6));
+                  EXPECT_RESULT, Number::New(isolate, 6));
     context.Check("this.x",
-                  EXPECT_RESULT, Number::New(6));
+                  EXPECT_RESULT, Number::New(isolate, 6));
     context.Check("function x() { return 7 }; x()",
-                  EXPECT_RESULT, Number::New(7));
+                  EXPECT_RESULT, Number::New(isolate, 7));
   }
 
   { SimpleContext context;
     context.Check("const x = 1; x",
-                  EXPECT_RESULT, Number::New(1));
+                  EXPECT_RESULT, Number::New(isolate, 1));
     context.Check("var x = 2; x",  // assignment ignored
-                  EXPECT_RESULT, Number::New(1));
+                  EXPECT_RESULT, Number::New(isolate, 1));
     context.Check("const x = 3; x",
-                  EXPECT_RESULT, Number::New(1));
+                  EXPECT_RESULT, Number::New(isolate, 1));
     context.Check("x = 4; x",  // assignment ignored
-                  EXPECT_RESULT, Number::New(1));
+                  EXPECT_RESULT, Number::New(isolate, 1));
     context.Check("var x = 5; x",  // assignment ignored
-                  EXPECT_RESULT, Number::New(1));
+                  EXPECT_RESULT, Number::New(isolate, 1));
     context.Check("this.x",
-                  EXPECT_RESULT, Number::New(1));
+                  EXPECT_RESULT, Number::New(isolate, 1));
     context.Check("function x() { return 7 }; x",
                   EXPECT_EXCEPTION);
   }
@@ -804,7 +809,8 @@ TEST(CrossScriptReferencesHarmony) {
   i::FLAG_harmony_scoping = true;
   i::FLAG_harmony_modules = true;
 
-  HandleScope scope(CcTest::isolate());
+  v8::Isolate* isolate = CcTest::isolate();
+  HandleScope scope(isolate);
 
   const char* decs[] = {
     "var x = 1; x", "x", "this.x",
@@ -817,12 +823,14 @@ TEST(CrossScriptReferencesHarmony) {
 
   for (int i = 0; decs[i] != NULL; i += 3) {
     SimpleContext context;
-    context.Check(decs[i], EXPECT_RESULT, Number::New(1));
-    context.Check(decs[i+1], EXPECT_RESULT, Number::New(1));
+    context.Check(decs[i], EXPECT_RESULT, Number::New(isolate, 1));
+    context.Check(decs[i+1], EXPECT_RESULT, Number::New(isolate, 1));
     // TODO(rossberg): The current ES6 draft spec does not reflect lexical
     // bindings on the global object. However, this will probably change, in
     // which case we reactivate the following test.
-    if (i/3 < 2) context.Check(decs[i+2], EXPECT_RESULT, Number::New(1));
+    if (i/3 < 2) {
+      context.Check(decs[i+2], EXPECT_RESULT, Number::New(isolate, 1));
+    }
   }
 }
 
@@ -854,12 +862,14 @@ TEST(CrossScriptConflicts) {
   for (int i = 0; firsts[i] != NULL; ++i) {
     for (int j = 0; seconds[j] != NULL; ++j) {
       SimpleContext context;
-      context.Check(firsts[i], EXPECT_RESULT, Number::New(1));
+      context.Check(firsts[i], EXPECT_RESULT,
+                    Number::New(CcTest::isolate(), 1));
       // TODO(rossberg): All tests should actually be errors in Harmony,
       // but we currently do not detect the cases where the first declaration
       // is not lexical.
       context.Check(seconds[j],
-                    i < 2 ? EXPECT_RESULT : EXPECT_ERROR, Number::New(2));
+                    i < 2 ? EXPECT_RESULT : EXPECT_ERROR,
+                    Number::New(CcTest::isolate(), 2));
     }
   }
 }
index d0b80d1..2261a5a 100644 (file)
@@ -334,8 +334,8 @@ TEST(EternalHandles) {
   for (int i = 0; i < kArrayLength; i++) {
     indices[i] = -1;
     HandleScope scope(isolate);
-    v8::Local<v8::Object> object = v8::Object::New();
-    object->Set(i, v8::Integer::New(i, v8_isolate));
+    v8::Local<v8::Object> object = v8::Object::New(v8_isolate);
+    object->Set(i, v8::Integer::New(v8_isolate, i));
     // Create with internal api
     eternal_handles->Create(
         isolate, *v8::Utils::OpenHandle(*object), &indices[i]);
@@ -370,7 +370,7 @@ TEST(EternalHandles) {
   // Create an eternal via the constructor
   {
     HandleScope scope(isolate);
-    v8::Local<v8::Object> object = v8::Object::New();
+    v8::Local<v8::Object> object = v8::Object::New(v8_isolate);
     v8::Eternal<v8::Object> eternal(v8_isolate, object);
     CHECK(!eternal.IsEmpty());
     CHECK(object == eternal.Get(v8_isolate));
index 5fe77c2..bbec9df 100644 (file)
@@ -39,7 +39,7 @@ TEST(StrictUndeclaredGlobalVariable) {
   LocalContext context;
   v8::TryCatch try_catch;
   v8::Local<v8::Script> script = v8_compile("\"use strict\"; x = 42;");
-  v8::Handle<v8::Object> proto = v8::Object::New();
+  v8::Handle<v8::Object> proto = v8::Object::New(CcTest::isolate());
   v8::Handle<v8::Object> global =
       context->Global()->GetPrototype().As<v8::Object>();
   proto->Set(var_name, v8_num(100));
index 8943c5d..6189831 100644 (file)
@@ -472,7 +472,7 @@ TEST(HeapSnapshotInternalReferences) {
   v8::Handle<v8::Object> global_proxy = env->Global();
   v8::Handle<v8::Object> global = global_proxy->GetPrototype().As<v8::Object>();
   CHECK_EQ(2, global->InternalFieldCount());
-  v8::Local<v8::Object> obj = v8::Object::New();
+  v8::Local<v8::Object> obj = v8::Object::New(isolate);
   global->SetInternalField(0, v8_num(17));
   global->SetInternalField(1, obj);
   v8::HeapProfiler* heap_profiler = isolate->GetHeapProfiler();
@@ -1354,7 +1354,7 @@ class GraphWithImplicitRefs {
     instance_ = this;
     isolate_ = (*env)->GetIsolate();
     for (int i = 0; i < kObjectsCount; i++) {
-      objects_[i].Reset(isolate_, v8::Object::New());
+      objects_[i].Reset(isolate_, v8::Object::New(isolate_));
     }
     (*env)->Global()->Set(v8_str("root_object"),
                           v8::Local<v8::Value>::New(isolate_, objects_[0]));
@@ -1821,7 +1821,8 @@ TEST(WeakGlobalHandle) {
   CHECK(!HasWeakGlobalHandle());
 
   v8::Persistent<v8::Object>* handle =
-      new v8::Persistent<v8::Object>(env->GetIsolate(), v8::Object::New());
+      new v8::Persistent<v8::Object>(env->GetIsolate(),
+                                     v8::Object::New(env->GetIsolate()));
   handle->SetWeak(handle, PersistentHandleCallback);
 
   CHECK(HasWeakGlobalHandle());
@@ -1995,8 +1996,9 @@ TEST(ManyLocalsInSharedContext) {
 
 TEST(AllocationSitesAreVisible) {
   LocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
-  v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler();
+  v8::Isolate* isolate = env->GetIsolate();
+  v8::HandleScope scope(isolate);
+  v8::HeapProfiler* heap_profiler = isolate->GetHeapProfiler();
   CompileRun(
       "fun = function () { var a = [3, 2, 1]; return a; }\n"
       "fun();");
@@ -2039,9 +2041,12 @@ TEST(AllocationSitesAreVisible) {
   v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(array_val);
   // Verify the array is "a" in the code above.
   CHECK_EQ(3, array->Length());
-  CHECK_EQ(v8::Integer::New(3), array->Get(v8::Integer::New(0)));
-  CHECK_EQ(v8::Integer::New(2), array->Get(v8::Integer::New(1)));
-  CHECK_EQ(v8::Integer::New(1), array->Get(v8::Integer::New(2)));
+  CHECK_EQ(v8::Integer::New(isolate, 3),
+           array->Get(v8::Integer::New(isolate, 0)));
+  CHECK_EQ(v8::Integer::New(isolate, 2),
+           array->Get(v8::Integer::New(isolate, 1)));
+  CHECK_EQ(v8::Integer::New(isolate, 1),
+           array->Get(v8::Integer::New(isolate, 2)));
 }
 
 
index 3b73ba7..79e9ba5 100644 (file)
@@ -1790,7 +1790,7 @@ TEST(LeakNativeContextViaMap) {
         "%OptimizeFunctionOnNextCall(f);"
         "f();");
     CHECK_EQ(42, res->Int32Value());
-    ctx2->Global()->Set(v8_str("o"), v8::Int32::New(0));
+    ctx2->Global()->Set(v8_str("o"), v8::Int32::New(isolate, 0));
     ctx2->Exit();
     v8::Local<v8::Context>::New(isolate, ctx1)->Exit();
     ctx1p.Reset();
@@ -1836,7 +1836,7 @@ TEST(LeakNativeContextViaFunction) {
         "%OptimizeFunctionOnNextCall(f);"
         "f(o);");
     CHECK_EQ(42, res->Int32Value());
-    ctx2->Global()->Set(v8_str("o"), v8::Int32::New(0));
+    ctx2->Global()->Set(v8_str("o"), v8::Int32::New(isolate, 0));
     ctx2->Exit();
     ctx1->Exit();
     ctx1p.Reset();
@@ -1880,7 +1880,7 @@ TEST(LeakNativeContextViaMapKeyed) {
         "%OptimizeFunctionOnNextCall(f);"
         "f();");
     CHECK_EQ(42, res->Int32Value());
-    ctx2->Global()->Set(v8_str("o"), v8::Int32::New(0));
+    ctx2->Global()->Set(v8_str("o"), v8::Int32::New(isolate, 0));
     ctx2->Exit();
     ctx1->Exit();
     ctx1p.Reset();
@@ -1928,7 +1928,7 @@ TEST(LeakNativeContextViaMapProto) {
         "%OptimizeFunctionOnNextCall(f);"
         "f();");
     CHECK_EQ(42, res->Int32Value());
-    ctx2->Global()->Set(v8_str("o"), v8::Int32::New(0));
+    ctx2->Global()->Set(v8_str("o"), v8::Int32::New(isolate, 0));
     ctx2->Exit();
     ctx1->Exit();
     ctx1p.Reset();
@@ -2768,7 +2768,7 @@ TEST(Regress2211) {
 
   for (int i = 0; i < 2; i++) {
     // Store identity hash first and common hidden property second.
-    v8::Handle<v8::Object> obj = v8::Object::New();
+    v8::Handle<v8::Object> obj = v8::Object::New(CcTest::isolate());
     Handle<JSObject> internal_obj = v8::Utils::OpenHandle(*obj);
     CHECK(internal_obj->HasFastProperties());
 
@@ -3337,7 +3337,7 @@ TEST(Regress169928) {
       v8_str("fastliteralcase(mote, 2.5);");
 
   v8::Local<v8::String> array_name = v8_str("mote");
-  CcTest::global()->Set(array_name, v8::Int32::New(0));
+  CcTest::global()->Set(array_name, v8::Int32::New(CcTest::isolate(), 0));
 
   // First make sure we flip spaces
   CcTest::heap()->CollectGarbage(NEW_SPACE);
index 26afa51..8e927b0 100644 (file)
@@ -332,27 +332,30 @@ static void ExpectRecords(v8::Isolate* isolate,
 
 TEST(APITestBasicMutation) {
   HarmonyIsolate isolate;
-  HandleScope scope(isolate.GetIsolate());
-  LocalContext context(isolate.GetIsolate());
+  v8::Isolate* v8_isolate = isolate.GetIsolate();
+  HandleScope scope(v8_isolate);
+  LocalContext context(v8_isolate);
   Handle<Object> obj = Handle<Object>::Cast(CompileRun(
       "var records = [];"
       "var obj = {};"
       "function observer(r) { [].push.apply(records, r); };"
       "Object.observe(obj, observer);"
       "obj"));
-  obj->Set(String::NewFromUtf8(isolate.GetIsolate(), "foo"), Number::New(7));
-  obj->Set(1, Number::New(2));
+  obj->Set(String::NewFromUtf8(v8_isolate, "foo"),
+           Number::New(v8_isolate, 7));
+  obj->Set(1, Number::New(v8_isolate, 2));
   // ForceSet should work just as well as Set
-  obj->ForceSet(String::NewFromUtf8(isolate.GetIsolate(), "foo"),
-                Number::New(3));
-  obj->ForceSet(Number::New(1), Number::New(4));
+  obj->ForceSet(String::NewFromUtf8(v8_isolate, "foo"),
+                Number::New(v8_isolate, 3));
+  obj->ForceSet(Number::New(v8_isolate, 1), Number::New(v8_isolate, 4));
   // Setting an indexed element via the property setting method
-  obj->Set(Number::New(1), Number::New(5));
+  obj->Set(Number::New(v8_isolate, 1), Number::New(v8_isolate, 5));
   // Setting with a non-String, non-uint32 key
-  obj->Set(Number::New(1.1), Number::New(6), DontDelete);
-  obj->Delete(String::NewFromUtf8(isolate.GetIsolate(), "foo"));
+  obj->Set(Number::New(v8_isolate, 1.1),
+           Number::New(v8_isolate, 6), DontDelete);
+  obj->Delete(String::NewFromUtf8(v8_isolate, "foo"));
   obj->Delete(1);
-  obj->ForceDelete(Number::New(1.1));
+  obj->ForceDelete(Number::New(v8_isolate, 1.1));
 
   // Force delivery
   // TODO(adamk): Should the above set methods trigger delivery themselves?
@@ -363,13 +366,13 @@ TEST(APITestBasicMutation) {
     { obj, "add", "1", Handle<Value>() },
     // Note: use 7 not 1 below, as the latter triggers a nifty VS10 compiler bug
     // where instead of 1.0, a garbage value would be passed into Number::New.
-    { obj, "update", "foo", Number::New(7) },
-    { obj, "update", "1", Number::New(2) },
-    { obj, "update", "1", Number::New(4) },
+    { obj, "update", "foo", Number::New(v8_isolate, 7) },
+    { obj, "update", "1", Number::New(v8_isolate, 2) },
+    { obj, "update", "1", Number::New(v8_isolate, 4) },
     { obj, "add", "1.1", Handle<Value>() },
-    { obj, "delete", "foo", Number::New(3) },
-    { obj, "delete", "1", Number::New(5) },
-    { obj, "delete", "1.1", Number::New(6) }
+    { obj, "delete", "foo", Number::New(v8_isolate, 3) },
+    { obj, "delete", "1", Number::New(v8_isolate, 5) },
+    { obj, "delete", "1.1", Number::New(v8_isolate, 6) }
   };
   EXPECT_RECORDS(CompileRun("records"), expected_records);
 }
@@ -377,17 +380,18 @@ TEST(APITestBasicMutation) {
 
 TEST(HiddenPrototypeObservation) {
   HarmonyIsolate isolate;
-  HandleScope scope(isolate.GetIsolate());
-  LocalContext context(isolate.GetIsolate());
-  Handle<FunctionTemplate> tmpl = FunctionTemplate::New(isolate.GetIsolate());
+  v8::Isolate* v8_isolate = isolate.GetIsolate();
+  HandleScope scope(v8_isolate);
+  LocalContext context(v8_isolate);
+  Handle<FunctionTemplate> tmpl = FunctionTemplate::New(v8_isolate);
   tmpl->SetHiddenPrototype(true);
   tmpl->InstanceTemplate()->Set(
-      String::NewFromUtf8(isolate.GetIsolate(), "foo"), Number::New(75));
+      String::NewFromUtf8(v8_isolate, "foo"), Number::New(v8_isolate, 75));
   Handle<Object> proto = tmpl->GetFunction()->NewInstance();
-  Handle<Object> obj = Object::New();
+  Handle<Object> obj = Object::New(v8_isolate);
   obj->SetPrototype(proto);
-  context->Global()->Set(String::NewFromUtf8(isolate.GetIsolate(), "obj"), obj);
-  context->Global()->Set(String::NewFromUtf8(isolate.GetIsolate(), "proto"),
+  context->Global()->Set(String::NewFromUtf8(v8_isolate, "obj"), obj);
+  context->Global()->Set(String::NewFromUtf8(v8_isolate, "proto"),
                          proto);
   CompileRun(
       "var records;"
@@ -396,10 +400,10 @@ TEST(HiddenPrototypeObservation) {
       "obj.foo = 41;"  // triggers a notification
       "proto.foo = 42;");  // does not trigger a notification
   const RecordExpectation expected_records[] = {
-    { obj, "update", "foo", Number::New(75) }
+    { obj, "update", "foo", Number::New(v8_isolate, 75) }
   };
   EXPECT_RECORDS(CompileRun("records"), expected_records);
-  obj->SetPrototype(Null(isolate.GetIsolate()));
+  obj->SetPrototype(Null(v8_isolate));
   CompileRun("obj.foo = 43");
   const RecordExpectation expected_records2[] = {
     { obj, "add", "foo", Handle<Value>() }
@@ -561,7 +565,8 @@ TEST(NamedAccessCheck) {
         { instance, "add", "foo", Handle<Value>() },
         { instance, "update", "foo",
           String::NewFromUtf8(isolate.GetIsolate(), "bar") },
-        { instance, "reconfigure", "foo", Number::New(5) },
+        { instance, "reconfigure", "foo",
+          Number::New(isolate.GetIsolate(), 5) },
         { instance, "add", "bar", Handle<Value>() },
         { obj_no_check, "add", "baz", Handle<Value>() },
       };
@@ -585,7 +590,7 @@ TEST(IndexedAccessCheck) {
     g_access_block_type = types[i];
     Handle<Object> instance = CreateAccessCheckedObject(
         isolate.GetIsolate(), NamedAccessAlwaysAllowed,
-        IndexedAccessAllowUnlessBlocked, Number::New(7));
+        IndexedAccessAllowUnlessBlocked, Number::New(isolate.GetIsolate(), 7));
     CompileRun("var records = null;"
                "var objNoCheck = {};"
                "var observer = function(r) { records = r };"
@@ -612,7 +617,7 @@ TEST(IndexedAccessCheck) {
         { instance, "add", "7", Handle<Value>() },
         { instance, "update", "7",
           String::NewFromUtf8(isolate.GetIsolate(), "foo") },
-        { instance, "reconfigure", "7", Number::New(5) },
+        { instance, "reconfigure", "7", Number::New(isolate.GetIsolate(), 5) },
         { instance, "add", "8", Handle<Value>() },
         { obj_no_check, "add", "42", Handle<Value>() }
       };
@@ -634,7 +639,7 @@ TEST(SpliceAccessCheck) {
   g_access_block_type = ACCESS_GET;
   Handle<Object> instance = CreateAccessCheckedObject(
       isolate.GetIsolate(), NamedAccessAlwaysAllowed,
-      IndexedAccessAllowUnlessBlocked, Number::New(1));
+      IndexedAccessAllowUnlessBlocked, Number::New(isolate.GetIsolate(), 1));
   CompileRun("var records = null;"
              "obj[1] = 'foo';"
              "obj.length = 2;"
index 45a6a1b..f4d9472 100644 (file)
@@ -960,7 +960,8 @@ TEST(ExternalShortStringAdd) {
     v8::Local<v8::String> ascii_external_string =
         v8::String::NewExternal(CcTest::isolate(), ascii_resource);
 
-    ascii_external_strings->Set(v8::Integer::New(i), ascii_external_string);
+    ascii_external_strings->Set(v8::Integer::New(CcTest::isolate(), i),
+                                ascii_external_string);
     uc16* non_ascii = zone.NewArray<uc16>(i + 1);
     for (int j = 0; j < i; j++) {
       non_ascii[j] = 0x1234;
@@ -970,7 +971,7 @@ TEST(ExternalShortStringAdd) {
     Resource* resource = new(&zone) Resource(Vector<const uc16>(non_ascii, i));
     v8::Local<v8::String> non_ascii_external_string =
       v8::String::NewExternal(CcTest::isolate(), resource);
-    non_ascii_external_strings->Set(v8::Integer::New(i),
+    non_ascii_external_strings->Set(v8::Integer::New(CcTest::isolate(), i),
                                     non_ascii_external_string);
   }
 
@@ -978,7 +979,8 @@ TEST(ExternalShortStringAdd) {
   v8::Handle<v8::Object> global = context->Global();
   global->Set(v8_str("external_ascii"), ascii_external_strings);
   global->Set(v8_str("external_non_ascii"), non_ascii_external_strings);
-  global->Set(v8_str("max_length"), v8::Integer::New(kMaxLength));
+  global->Set(v8_str("max_length"),
+              v8::Integer::New(CcTest::isolate(), kMaxLength));
 
   // Add short external ascii and non-ascii strings checking the result.
   static const char* source =
index 8e26032..07c1171 100644 (file)
@@ -208,9 +208,9 @@ void TerminateOrReturnObject(const v8::FunctionCallbackInfo<v8::Value>& args) {
     v8::V8::TerminateExecution(args.GetIsolate());
     return;
   }
-  v8::Local<v8::Object> result = v8::Object::New();
+  v8::Local<v8::Object> result = v8::Object::New(args.GetIsolate());
   result->Set(v8::String::NewFromUtf8(args.GetIsolate(), "x"),
-              v8::Integer::New(42));
+              v8::Integer::New(args.GetIsolate(), 42));
   args.GetReturnValue().Set(result);
 }