Mark deprecated APIs with relatively little use as deprecated
authorjochen@chromium.org <jochen@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 28 Nov 2013 08:21:26 +0000 (08:21 +0000)
committerjochen@chromium.org <jochen@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 28 Nov 2013 08:21:26 +0000 (08:21 +0000)
BUG=none
R=svenpanne@chromium.org
LOG=n

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

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

28 files changed:
include/v8.h
src/bootstrapper.cc
src/d8-posix.cc
src/d8.cc
src/extensions/externalize-string-extension.cc
src/extensions/externalize-string-extension.h
src/extensions/free-buffer-extension.cc
src/extensions/free-buffer-extension.h
src/extensions/gc-extension.cc
src/extensions/gc-extension.h
src/extensions/statistics-extension.cc
src/extensions/statistics-extension.h
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-heap-profiler.cc
test/cctest/test-heap.cc
test/cctest/test-log-stack-tracer.cc
test/cctest/test-log.cc
test/cctest/test-object-observe.cc
test/cctest/test-parsing.cc
test/cctest/test-profile-generator.cc
test/cctest/test-strings.cc
test/cctest/test-weaktypedarrays.cc

index 2d02562084572c729eb454870bbb120ab1d1aa06..28b65672221bffb12a8133938868b350e07ae03e 100644 (file)
@@ -1240,8 +1240,8 @@ class V8_EXPORT Message {
 
   // TODO(1245381): Print to a string instead of on a FILE.
   static void PrintCurrentStackTrace(Isolate* isolate, FILE* out);
-  // Will be deprecated soon.
-  static void PrintCurrentStackTrace(FILE* out);
+  V8_DEPRECATED("Will be removed",
+                static void PrintCurrentStackTrace(FILE* out));
 
   static const int kNoLineNumberInfo = 0;
   static const int kNoColumnInfo = 0;
@@ -1299,10 +1299,9 @@ class V8_EXPORT StackTrace {
       Isolate* isolate,
       int frame_limit,
       StackTraceOptions options = kOverview);
-  // Will be deprecated soon.
-  static Local<StackTrace> CurrentStackTrace(
-      int frame_limit,
-      StackTraceOptions options = kOverview);
+  V8_DEPRECATED("Will be removed",
+                static Local<StackTrace> CurrentStackTrace(
+                    int frame_limit, StackTraceOptions options = kOverview));
 };
 
 
@@ -1634,8 +1633,8 @@ class V8_EXPORT Boolean : public Primitive {
  public:
   bool Value() const;
   V8_INLINE static Handle<Boolean> New(Isolate* isolate, bool value);
-  // Will be deprecated soon.
-  V8_INLINE static Handle<Boolean> New(bool value);
+  V8_DEPRECATED("Will be removed",
+                V8_INLINE static Handle<Boolean> New(bool value));
 };
 
 
@@ -1905,8 +1904,8 @@ class V8_EXPORT String : public Primitive {
    */
   static Local<String> NewExternal(Isolate* isolate,
                                    ExternalStringResource* resource);
-  // Will be deprecated soon.
-  static Local<String> NewExternal(ExternalStringResource* resource);
+  V8_DEPRECATED("Will be removed", static Local<String> NewExternal(
+                                        ExternalStringResource* resource));
 
   /**
    * Associate an external string resource with this string by transforming it
@@ -1929,8 +1928,8 @@ class V8_EXPORT String : public Primitive {
    */
   static Local<String> NewExternal(Isolate* isolate,
                                    ExternalAsciiStringResource* resource);
-  // Will be deprecated soon.
-  static Local<String> NewExternal(ExternalAsciiStringResource* resource);
+  V8_DEPRECATED("Will be removed", static Local<String> NewExternal(
+                                        ExternalAsciiStringResource* resource));
 
   /**
    * Associate an external string resource with this string by transforming it
@@ -2488,8 +2487,7 @@ class V8_EXPORT Array : public Object {
    * is negative the returned array will have length 0.
    */
   static Local<Array> New(Isolate* isolate, int length = 0);
-  // Will be deprecated soon.
-  static Local<Array> New(int length = 0);
+  V8_DEPRECATED("Will be removed", static Local<Array> New(int length = 0));
 
   V8_INLINE static Array* Cast(Value* obj);
  private:
@@ -2753,8 +2751,8 @@ class V8_EXPORT ArrayBuffer : public Object {
    * unless the object is externalized.
    */
   static Local<ArrayBuffer> New(Isolate* isolate, size_t byte_length);
-  // Will be deprecated soon.
-  static Local<ArrayBuffer> New(size_t byte_length);
+  V8_DEPRECATED("Will be removed",
+                static Local<ArrayBuffer> New(size_t byte_length));
 
   /**
    * Create a new ArrayBuffer over an existing memory block.
@@ -2764,8 +2762,8 @@ class V8_EXPORT ArrayBuffer : public Object {
    */
   static Local<ArrayBuffer> New(Isolate* isolate, void* data,
                                 size_t byte_length);
-  // Will be deprecated soon.
-  static Local<ArrayBuffer> New(void* data, size_t byte_length);
+  V8_DEPRECATED("Will be removed",
+                static Local<ArrayBuffer> New(void* data, size_t byte_length));
 
   /**
    * Returns true if ArrayBuffer is extrenalized, that is, does not
@@ -3026,8 +3024,7 @@ class V8_EXPORT DataView : public ArrayBufferView {
 class V8_EXPORT Date : public Object {
  public:
   static Local<Value> New(Isolate* isolate, double time);
-  // Will be deprecated soon.
-  static Local<Value> New(double time);
+  V8_DEPRECATED("Will be removed", static Local<Value> New(double time));
 
   V8_DEPRECATED(
       "Use ValueOf instead",
@@ -3054,8 +3051,8 @@ class V8_EXPORT Date : public Object {
    * negatively impact the performance of date operations.
    */
   static void DateTimeConfigurationChangeNotification(Isolate* isolate);
-  // Will be deprecated soon.
-  static void DateTimeConfigurationChangeNotification();
+  V8_DEPRECATED("Will be removed",
+                static void DateTimeConfigurationChangeNotification());
 
  private:
   static void CheckCast(v8::Value* obj);
@@ -3068,8 +3065,7 @@ class V8_EXPORT Date : public Object {
 class V8_EXPORT NumberObject : public Object {
  public:
   static Local<Value> New(Isolate* isolate, double value);
-  // Will be deprecated soon.
-  static Local<Value> New(double value);
+  V8_DEPRECATED("Will be removed", static Local<Value> New(double value));
 
   V8_DEPRECATED(
       "Use ValueOf instead",
@@ -3231,8 +3227,8 @@ class V8_EXPORT Template : public Data {
   void Set(Handle<String> name, Handle<Data> value,
            PropertyAttribute attributes = None);
   V8_INLINE void Set(Isolate* isolate, const char* name, Handle<Data> value);
-  // Will be deprecated soon.
-  V8_INLINE void Set(const char* name, Handle<Data> value);
+  V8_DEPRECATED("Will be removed",
+                V8_INLINE void Set(const char* name, Handle<Data> value));
 
   void SetAccessorProperty(
      Local<String> name,
@@ -3768,11 +3764,13 @@ class V8_EXPORT Signature : public Data {
                                   Handle<FunctionTemplate>(),
                               int argc = 0,
                               Handle<FunctionTemplate> argv[] = 0);
-  // Will be deprecated soon.
-  static Local<Signature> New(Handle<FunctionTemplate> receiver =
-                                  Handle<FunctionTemplate>(),
-                              int argc = 0,
-                              Handle<FunctionTemplate> argv[] = 0);
+  V8_DEPRECATED("Will be removed",
+                static Local<Signature> New(Handle<FunctionTemplate> receiver =
+                                                Handle<FunctionTemplate>(),
+                                            int argc = 0,
+                                            Handle<FunctionTemplate> argv[] =
+                                                0));
+
  private:
   Signature();
 };
@@ -3787,9 +3785,9 @@ class V8_EXPORT AccessorSignature : public Data {
   static Local<AccessorSignature> New(Isolate* isolate,
                                       Handle<FunctionTemplate> receiver =
                                           Handle<FunctionTemplate>());
-  // Will be deprecated soon.
-  static Local<AccessorSignature> New(Handle<FunctionTemplate> receiver =
-                                          Handle<FunctionTemplate>());
+  V8_DEPRECATED("Will be removed", static Local<AccessorSignature> New(
+                                       Handle<FunctionTemplate> receiver =
+                                           Handle<FunctionTemplate>()));
 
  private:
   AccessorSignature();
@@ -3896,11 +3894,16 @@ class V8_EXPORT Extension {  // NOLINT
   virtual ~Extension() { }
   virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
       v8::Isolate* isolate, v8::Handle<v8::String> name) {
+#if defined(V8_DEPRECATION_WARNINGS)
+    return v8::Handle<v8::FunctionTemplate>();
+#else
     return GetNativeFunction(name);
+#endif
   }
-  // Will be deprecated soon.
-  virtual v8::Handle<v8::FunctionTemplate>
-      GetNativeFunction(v8::Handle<v8::String> name) {
+
+  V8_DEPRECATED("Will be removed",
+                virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+                    v8::Handle<v8::String> name)) {
     return v8::Handle<v8::FunctionTemplate>();
   }
 
@@ -3948,11 +3951,10 @@ V8_INLINE Handle<Primitive> Null(Isolate* isolate);
 V8_INLINE Handle<Boolean> True(Isolate* isolate);
 V8_INLINE Handle<Boolean> False(Isolate* isolate);
 
-// Will be removed soon.
-Handle<Primitive> V8_EXPORT Undefined();
-Handle<Primitive> V8_EXPORT Null();
-Handle<Boolean> V8_EXPORT True();
-Handle<Boolean> V8_EXPORT False();
+V8_DEPRECATED("Will be removed", Handle<Primitive> V8_EXPORT Undefined());
+V8_DEPRECATED("Will be removed", Handle<Primitive> V8_EXPORT Null());
+V8_DEPRECATED("Will be removed", Handle<Boolean> V8_EXPORT True());
+V8_DEPRECATED("Will be removed", Handle<Boolean> V8_EXPORT False());
 
 
 /**
index b9f796e43ecb3eaf485da0d8cc347d2b1368849a..4d69f8407f4fb4e9bff20bd174b8cb848d824fe6 100644 (file)
@@ -2627,7 +2627,8 @@ Genesis::Genesis(Isolate* isolate,
       isolate->random_number_generator()->NextBytes(state, num_bytes);
     } while (state[0] == 0 || state[1] == 0);
 
-    v8::Local<v8::ArrayBuffer> buffer = v8::ArrayBuffer::New(state, num_bytes);
+    v8::Local<v8::ArrayBuffer> buffer = v8::ArrayBuffer::New(
+        reinterpret_cast<v8::Isolate*>(isolate), state, num_bytes);
     Utils::OpenHandle(*buffer)->set_should_be_freed(true);
     v8::Local<v8::Uint32Array> ta = v8::Uint32Array::New(buffer, 0, num_elems);
     Handle<JSBuiltinsObject> builtins(native_context()->builtins());
@@ -2640,8 +2641,10 @@ Genesis::Genesis(Isolate* isolate,
     // Initialize trigonometric lookup tables and constants.
     const int table_num_bytes = TrigonometricLookupTable::table_num_bytes();
     v8::Local<v8::ArrayBuffer> sin_buffer = v8::ArrayBuffer::New(
+        reinterpret_cast<v8::Isolate*>(isolate),
         TrigonometricLookupTable::sin_table(), table_num_bytes);
     v8::Local<v8::ArrayBuffer> cos_buffer = v8::ArrayBuffer::New(
+        reinterpret_cast<v8::Isolate*>(isolate),
         TrigonometricLookupTable::cos_x_interval_table(), table_num_bytes);
     v8::Local<v8::Float64Array> sin_table = v8::Float64Array::New(
         sin_buffer, 0, TrigonometricLookupTable::table_size());
index dc60d0cc749d8a8766bbfc4450e1b1f4b45b7e9c..25f79a4be6b10323b7cce075c0a24317a6228fac 100644 (file)
@@ -470,7 +470,7 @@ void Shell::System(const v8::FunctionCallbackInfo<v8::Value>& args) {
     }
     command_args = Handle<Array>::Cast(args[1]);
   } else {
-    command_args = Array::New(0);
+    command_args = Array::New(args.GetIsolate(), 0);
   }
   if (command_args->Length() > ExecArgs::kMaxArgs) {
     args.GetIsolate()->ThrowException(String::NewFromUtf8(
index d0ca5504c3297d903b62c0ec641f17a9ed670244..7c5df463d334564347bc6e0fd273982a48f09efd 100644 (file)
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -1126,7 +1126,7 @@ void Shell::ReadBuffer(const v8::FunctionCallbackInfo<v8::Value>& args) {
     Throw(args.GetIsolate(), "Error reading file");
     return;
   }
-  Handle<v8::ArrayBuffer> buffer = ArrayBuffer::New(data, length);
+  Handle<v8::ArrayBuffer> buffer = ArrayBuffer::New(isolate, data, length);
   v8::Persistent<v8::ArrayBuffer> weak_handle(isolate, buffer);
   weak_handle.MakeWeak(data, ReadBufferWeakCallback);
   weak_handle.MarkIndependent();
index a86ec66bf4eca49ddddbf1e5b703ca76b25f4934..edc7dd8052ccb99eaff1cce626c99518dc573ef1 100644 (file)
@@ -60,9 +60,9 @@ const char* const ExternalizeStringExtension::kSource =
     "native function externalizeString();"
     "native function isAsciiString();";
 
-
-v8::Handle<v8::FunctionTemplate> ExternalizeStringExtension::GetNativeFunction(
-    v8::Handle<v8::String> str) {
+v8::Handle<v8::FunctionTemplate>
+ExternalizeStringExtension::GetNativeFunctionTemplate(
+    v8::Isolate* isolate, v8::Handle<v8::String> str) {
   if (strcmp(*v8::String::Utf8Value(str), "externalizeString") == 0) {
     return v8::FunctionTemplate::New(ExternalizeStringExtension::Externalize);
   } else {
index ecbc1cf447c47ac5c99262371c0950b7eae35267..3d1e438f7f2617b806ccf25ee96f4b6eb0729284 100644 (file)
@@ -36,7 +36,8 @@ namespace internal {
 class ExternalizeStringExtension : public v8::Extension {
  public:
   ExternalizeStringExtension() : v8::Extension("v8/externalize", kSource) {}
-  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
+      v8::Isolate* isolate,
       v8::Handle<v8::String> name);
   static void Externalize(const v8::FunctionCallbackInfo<v8::Value>& args);
   static void IsAscii(const v8::FunctionCallbackInfo<v8::Value>& args);
index 4040c90bffe4b2ac6f7088c267758cb5b81ca677..5cf2b68146c9d325096b6f94172bca55d498c2fa 100644 (file)
@@ -33,7 +33,8 @@ namespace v8 {
 namespace internal {
 
 
-v8::Handle<v8::FunctionTemplate> FreeBufferExtension::GetNativeFunction(
+v8::Handle<v8::FunctionTemplate> FreeBufferExtension::GetNativeFunctionTemplate(
+    v8::Isolate* isolate,
     v8::Handle<v8::String> str) {
   return v8::FunctionTemplate::New(FreeBufferExtension::FreeBuffer);
 }
index 29ffbc014ecd8c073adb783cfe8d1888e88ab921..22d466f61e02b4e8367dfc9d06f00095aa5efe02 100644 (file)
@@ -37,7 +37,8 @@ class FreeBufferExtension : public v8::Extension {
  public:
   explicit FreeBufferExtension(const char* source)
       : v8::Extension("v8/free-buffer", source) {}
-  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
+      v8::Isolate* isolate,
       v8::Handle<v8::String> name);
   static void FreeBuffer(const v8::FunctionCallbackInfo<v8::Value>& args);
   static void Register();
index 308879115fce62a8c0395f9de151a00078588880..b8442c1bf85bfe6c4482a2333ec4ec0608fa55f6 100644 (file)
@@ -32,7 +32,8 @@ namespace v8 {
 namespace internal {
 
 
-v8::Handle<v8::FunctionTemplate> GCExtension::GetNativeFunction(
+v8::Handle<v8::FunctionTemplate> GCExtension::GetNativeFunctionTemplate(
+    v8::Isolate* isolate,
     v8::Handle<v8::String> str) {
   return v8::FunctionTemplate::New(GCExtension::GC);
 }
index e412b92a4d997aad87160ddd789b85419bdf3037..8c25e7d84d5e286b763d22873ca1d7962d1a9cce 100644 (file)
@@ -36,7 +36,8 @@ namespace internal {
 class GCExtension : public v8::Extension {
  public:
   explicit GCExtension(const char* source) : v8::Extension("v8/gc", source) {}
-  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
+      v8::Isolate* isolate,
       v8::Handle<v8::String> name);
   static void GC(const v8::FunctionCallbackInfo<v8::Value>& args);
   static void Register();
index 431a1563857dcf7b4cc0b2f0da7d781a35518e92..92d152d0de7f4ab1d14b43223ffdc85f4eb6db70 100644 (file)
@@ -34,7 +34,8 @@ const char* const StatisticsExtension::kSource =
     "native function getV8Statistics();";
 
 
-v8::Handle<v8::FunctionTemplate> StatisticsExtension::GetNativeFunction(
+v8::Handle<v8::FunctionTemplate> StatisticsExtension::GetNativeFunctionTemplate(
+    v8::Isolate* isolate,
     v8::Handle<v8::String> str) {
   ASSERT(strcmp(*v8::String::Utf8Value(str), "getV8Statistics") == 0);
   return v8::FunctionTemplate::New(StatisticsExtension::GetCounters);
index bfd9c4134e298a097c8c202b894a904cdd56f32b..f05e7689e737ed92fc59a5bfa90e2bc85c5a74ac 100644 (file)
@@ -36,7 +36,8 @@ namespace internal {
 class StatisticsExtension : public v8::Extension {
  public:
   StatisticsExtension() : v8::Extension("v8/statistics", kSource) {}
-  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
+      v8::Isolate* isolate,
       v8::Handle<v8::String> name);
   static void GetCounters(const v8::FunctionCallbackInfo<v8::Value>& args);
   static void Register();
index 0dbac3fa63cc9297fa6e4abc7bf532da0bcf5a31..142687b30bee94c1a2fc0c64e3e1979a770ce1a1 100644 (file)
@@ -460,7 +460,7 @@ THREADED_TEST(Regress1054726) {
 static void AllocGetter(Local<String> name,
                         const v8::PropertyCallbackInfo<v8::Value>& info) {
   ApiTestFuzzer::Fuzz();
-  info.GetReturnValue().Set(v8::Array::New(1000));
+  info.GetReturnValue().Set(v8::Array::New(info.GetIsolate(), 1000));
 }
 
 
@@ -543,7 +543,7 @@ THREADED_TEST(HandleScopeSegment) {
 
 
 void JSONStringifyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info) {
-  v8::Handle<v8::Array> array = v8::Array::New(1);
+  v8::Handle<v8::Array> array = v8::Array::New(info.GetIsolate(), 1);
   array->Set(0, v8_str("regress"));
   info.GetReturnValue().Set(array);
 }
index 94b397f246a37418ce6d76effa908a6eb49e004b..2e457d0e8e5cb8006be69d735fc068730a3aa2d4 100644 (file)
@@ -150,7 +150,8 @@ static void IncrementingSignatureCallback(
   signature_callback_count++;
   CHECK_EQ(signature_expected_receiver, args.Holder());
   CHECK_EQ(signature_expected_receiver, args.This());
-  v8::Handle<v8::Array> result = v8::Array::New(args.Length());
+  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]);
   args.GetReturnValue().Set(result);
@@ -160,7 +161,8 @@ static void IncrementingSignatureCallback(
 static void SignatureCallback(
     const v8::FunctionCallbackInfo<v8::Value>& args) {
   ApiTestFuzzer::Fuzz();
-  v8::Handle<v8::Array> result = v8::Array::New(args.Length());
+  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]);
   }
@@ -253,7 +255,7 @@ THREADED_TEST(ReceiverSignature) {
   v8::HandleScope scope(env->GetIsolate());
   // Setup templates.
   v8::Handle<v8::FunctionTemplate> fun = v8::FunctionTemplate::New();
-  v8::Handle<v8::Signature> sig = v8::Signature::New(fun);
+  v8::Handle<v8::Signature> sig = v8::Signature::New(env->GetIsolate(), fun);
   v8::Handle<v8::FunctionTemplate> callback_sig =
       v8::FunctionTemplate::New(
           IncrementingSignatureCallback, Local<Value>(), sig);
@@ -326,8 +328,8 @@ THREADED_TEST(ArgumentSignature) {
   v8::HandleScope scope(env->GetIsolate());
   v8::Handle<v8::FunctionTemplate> cons = v8::FunctionTemplate::New();
   cons->SetClassName(v8_str("Cons"));
-  v8::Handle<v8::Signature> sig =
-      v8::Signature::New(v8::Handle<v8::FunctionTemplate>(), 1, &cons);
+  v8::Handle<v8::Signature> sig = v8::Signature::New(
+      env->GetIsolate(), v8::Handle<v8::FunctionTemplate>(), 1, &cons);
   v8::Handle<v8::FunctionTemplate> fun =
       v8::FunctionTemplate::New(SignatureCallback, v8::Handle<Value>(), sig);
   env->Global()->Set(v8_str("Cons"), cons->GetFunction());
@@ -350,8 +352,8 @@ THREADED_TEST(ArgumentSignature) {
   cons3->SetClassName(v8_str("Cons3"));
 
   v8::Handle<v8::FunctionTemplate> args[3] = { cons1, cons2, cons3 };
-  v8::Handle<v8::Signature> wsig =
-      v8::Signature::New(v8::Handle<v8::FunctionTemplate>(), 3, args);
+  v8::Handle<v8::Signature> wsig = v8::Signature::New(
+      env->GetIsolate(), v8::Handle<v8::FunctionTemplate>(), 3, args);
   v8::Handle<v8::FunctionTemplate> fun2 =
       v8::FunctionTemplate::New(SignatureCallback, v8::Handle<Value>(), wsig);
 
@@ -507,7 +509,7 @@ THREADED_TEST(ScriptUsingStringResource) {
     LocalContext env;
     v8::HandleScope scope(env->GetIsolate());
     TestResource* resource = new TestResource(two_byte_source, &dispose_count);
-    Local<String> source = String::NewExternal(resource);
+    Local<String> source = String::NewExternal(env->GetIsolate(), resource);
     Local<Script> script = Script::Compile(source);
     Local<Value> value = script->Run();
     CHECK(value->IsNumber());
@@ -536,7 +538,7 @@ THREADED_TEST(ScriptUsingAsciiStringResource) {
     v8::HandleScope scope(env->GetIsolate());
     TestAsciiResource* resource = new TestAsciiResource(i::StrDup(c_source),
                                                         &dispose_count);
-    Local<String> source = String::NewExternal(resource);
+    Local<String> source = String::NewExternal(env->GetIsolate(), resource);
     CHECK(source->IsExternalAscii());
     CHECK_EQ(static_cast<const String::ExternalStringResourceBase*>(resource),
              source->GetExternalAsciiStringResource());
@@ -740,8 +742,8 @@ THREADED_TEST(UsingExternalString) {
   {
     v8::HandleScope scope(CcTest::isolate());
     uint16_t* two_byte_string = AsciiToTwoByteString("test string");
-    Local<String> string =
-        String::NewExternal(new TestResource(two_byte_string));
+    Local<String> string = String::NewExternal(
+        CcTest::isolate(), new TestResource(two_byte_string));
     i::Handle<i::String> istring = v8::Utils::OpenHandle(*string);
     // Trigger GCs so that the newly allocated string moves to old gen.
     CcTest::heap()->CollectGarbage(i::NEW_SPACE);  // in survivor space now
@@ -761,7 +763,7 @@ THREADED_TEST(UsingExternalAsciiString) {
     v8::HandleScope scope(CcTest::isolate());
     const char* one_byte_string = "test string";
     Local<String> string = String::NewExternal(
-        new TestAsciiResource(i::StrDup(one_byte_string)));
+        CcTest::isolate(), new TestAsciiResource(i::StrDup(one_byte_string)));
     i::Handle<i::String> istring = v8::Utils::OpenHandle(*string);
     // Trigger GCs so that the newly allocated string moves to old gen.
     CcTest::heap()->CollectGarbage(i::NEW_SPACE);  // in survivor space now
@@ -783,9 +785,8 @@ THREADED_TEST(ScavengeExternalString) {
   {
     v8::HandleScope scope(CcTest::isolate());
     uint16_t* two_byte_string = AsciiToTwoByteString("test string");
-    Local<String> string =
-      String::NewExternal(new TestResource(two_byte_string,
-                                           &dispose_count));
+    Local<String> string = String::NewExternal(
+        CcTest::isolate(), new TestResource(two_byte_string, &dispose_count));
     i::Handle<i::String> istring = v8::Utils::OpenHandle(*string);
     CcTest::heap()->CollectGarbage(i::NEW_SPACE);
     in_new_space = CcTest::heap()->InNewSpace(*istring);
@@ -807,6 +808,7 @@ THREADED_TEST(ScavengeExternalAsciiString) {
     v8::HandleScope scope(CcTest::isolate());
     const char* one_byte_string = "test string";
     Local<String> string = String::NewExternal(
+        CcTest::isolate(),
         new TestAsciiResource(i::StrDup(one_byte_string), &dispose_count));
     i::Handle<i::String> istring = v8::Utils::OpenHandle(*string);
     CcTest::heap()->CollectGarbage(i::NEW_SPACE);
@@ -853,7 +855,7 @@ TEST(ExternalStringWithDisposeHandling) {
   {
     LocalContext env;
     v8::HandleScope scope(env->GetIsolate());
-    Local<String> source =  String::NewExternal(&res_stack);
+    Local<String> source =  String::NewExternal(env->GetIsolate(), &res_stack);
     Local<Script> script = Script::Compile(source);
     Local<Value> value = script->Run();
     CHECK(value->IsNumber());
@@ -874,7 +876,7 @@ TEST(ExternalStringWithDisposeHandling) {
   {
     LocalContext env;
     v8::HandleScope scope(env->GetIsolate());
-    Local<String> source =  String::NewExternal(res_heap);
+    Local<String> source =  String::NewExternal(env->GetIsolate(), res_heap);
     Local<Script> script = Script::Compile(source);
     Local<Value> value = script->Run();
     CHECK(value->IsNumber());
@@ -909,9 +911,10 @@ THREADED_TEST(StringConcat) {
 
     Local<String> source = String::Concat(left, right);
     right = String::NewExternal(
-        new TestAsciiResource(i::StrDup(one_byte_extern_1)));
+        env->GetIsolate(), new TestAsciiResource(i::StrDup(one_byte_extern_1)));
     source = String::Concat(source, right);
     right = String::NewExternal(
+        env->GetIsolate(),
         new TestResource(AsciiToTwoByteString(two_byte_extern_1)));
     source = String::Concat(source, right);
     right = v8_str(one_byte_string_2);
@@ -923,6 +926,7 @@ THREADED_TEST(StringConcat) {
 
     source = String::Concat(source, right);
     right = String::NewExternal(
+        env->GetIsolate(),
         new TestResource(AsciiToTwoByteString(two_byte_extern_2)));
     source = String::Concat(source, right);
     Local<Script> script = Script::Compile(source);
@@ -1091,7 +1095,8 @@ static void TestSimpleCallback(Callback callback) {
   v8::HandleScope scope(env->GetIsolate());
 
   v8::Handle<v8::ObjectTemplate> object_template = v8::ObjectTemplate::New();
-  object_template->Set("callback", v8::FunctionTemplate::New(callback));
+  object_template->Set(env->GetIsolate(), "callback",
+                       v8::FunctionTemplate::New(callback));
   v8::Local<v8::Object> object = object_template->NewInstance();
   (*env)->Global()->Set(v8_str("callback_object"), object);
   v8::Handle<v8::Script> script;
@@ -1193,7 +1198,8 @@ Handle<Value> TestFastReturnValues() {
   v8::HandleScope scope(env->GetIsolate());
   v8::Handle<v8::ObjectTemplate> object_template = v8::ObjectTemplate::New();
   v8::FunctionCallback callback = &FastReturnValueCallback<T>;
-  object_template->Set("callback", v8::FunctionTemplate::New(callback));
+  object_template->Set(env->GetIsolate(), "callback",
+                       v8::FunctionTemplate::New(callback));
   v8::Local<v8::Object> object = object_template->NewInstance();
   (*env)->Global()->Set(v8_str("callback_object"), object);
   return scope.Close(CompileRun("callback_object.callback()"));
@@ -1594,7 +1600,8 @@ THREADED_TEST(NumberObject) {
   CHECK(!as_boxed.IsEmpty());
   double the_number = as_boxed->ValueOf();
   CHECK_EQ(42.0, the_number);
-  v8::Handle<v8::Value> new_boxed_number = v8::NumberObject::New(43);
+  v8::Handle<v8::Value> new_boxed_number =
+      v8::NumberObject::New(env->GetIsolate(), 43);
   CHECK(new_boxed_number->IsNumberObject());
   as_boxed = new_boxed_number.As<v8::NumberObject>();
   the_number = as_boxed->ValueOf();
@@ -1705,7 +1712,7 @@ THREADED_TEST(Date) {
   LocalContext env;
   v8::HandleScope scope(env->GetIsolate());
   double PI = 3.1415926;
-  Local<Value> date = v8::Date::New(PI);
+  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));
   CHECK_EQ(42, date.As<v8::Date>()->Get(v8_str("property"))->Int32Value());
@@ -1752,10 +1759,9 @@ THREADED_TEST(GlobalPrototype) {
   v8::HandleScope scope(CcTest::isolate());
   v8::Handle<v8::FunctionTemplate> func_templ = v8::FunctionTemplate::New();
   func_templ->PrototypeTemplate()->Set(
-      "dummy",
-      v8::FunctionTemplate::New(DummyCallHandler));
+      CcTest::isolate(), "dummy", v8::FunctionTemplate::New(DummyCallHandler));
   v8::Handle<ObjectTemplate> templ = func_templ->InstanceTemplate();
-  templ->Set("x", v8_num(200));
+  templ->Set(CcTest::isolate(), "x", v8_num(200));
   templ->SetAccessor(v8_str("m"), GetM);
   LocalContext env(0, templ);
   v8::Handle<Script> script(v8_compile("dummy()"));
@@ -1769,18 +1775,18 @@ THREADED_TEST(GlobalPrototype) {
 THREADED_TEST(ObjectTemplate) {
   v8::HandleScope scope(CcTest::isolate());
   Local<ObjectTemplate> templ1 = ObjectTemplate::New();
-  templ1->Set("x", v8_num(10));
-  templ1->Set("y", v8_num(13));
+  templ1->Set(CcTest::isolate(), "x", v8_num(10));
+  templ1->Set(CcTest::isolate(), "y", v8_num(13));
   LocalContext env;
   Local<v8::Object> instance1 = templ1->NewInstance();
   env->Global()->Set(v8_str("p"), instance1);
   CHECK(v8_compile("(p.x == 10)")->Run()->BooleanValue());
   CHECK(v8_compile("(p.y == 13)")->Run()->BooleanValue());
   Local<v8::FunctionTemplate> fun = v8::FunctionTemplate::New();
-  fun->PrototypeTemplate()->Set("nirk", v8_num(123));
+  fun->PrototypeTemplate()->Set(CcTest::isolate(), "nirk", v8_num(123));
   Local<ObjectTemplate> templ2 = fun->InstanceTemplate();
-  templ2->Set("a", v8_num(12));
-  templ2->Set("b", templ1);
+  templ2->Set(CcTest::isolate(), "a", v8_num(12));
+  templ2->Set(CcTest::isolate(), "b", templ1);
   Local<v8::Object> instance2 = templ2->NewInstance();
   env->Global()->Set(v8_str("q"), instance2);
   CHECK(v8_compile("(q.nirk == 123)")->Run()->BooleanValue());
@@ -1806,19 +1812,19 @@ static void GetKnurd(Local<String> property,
 THREADED_TEST(DescriptorInheritance) {
   v8::HandleScope scope(CcTest::isolate());
   v8::Handle<v8::FunctionTemplate> super = v8::FunctionTemplate::New();
-  super->PrototypeTemplate()->Set("flabby",
+  super->PrototypeTemplate()->Set(CcTest::isolate(), "flabby",
                                   v8::FunctionTemplate::New(GetFlabby));
-  super->PrototypeTemplate()->Set("PI", v8_num(3.14));
+  super->PrototypeTemplate()->Set(CcTest::isolate(), "PI", v8_num(3.14));
 
   super->InstanceTemplate()->SetAccessor(v8_str("knurd"), GetKnurd);
 
   v8::Handle<v8::FunctionTemplate> base1 = v8::FunctionTemplate::New();
   base1->Inherit(super);
-  base1->PrototypeTemplate()->Set("v1", v8_num(20.1));
+  base1->PrototypeTemplate()->Set(CcTest::isolate(), "v1", v8_num(20.1));
 
   v8::Handle<v8::FunctionTemplate> base2 = v8::FunctionTemplate::New();
   base2->Inherit(super);
-  base2->PrototypeTemplate()->Set("v2", v8_num(10.1));
+  base2->PrototypeTemplate()->Set(CcTest::isolate(), "v2", v8_num(10.1));
 
   LocalContext env;
 
@@ -2847,7 +2853,7 @@ THREADED_TEST(ArrayBuffer_ApiInternalToExternal) {
   v8::Isolate* isolate = env->GetIsolate();
   v8::HandleScope handle_scope(isolate);
 
-  Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(1024);
+  Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(isolate, 1024);
   CheckInternalFieldsAreZero(ab);
   CHECK_EQ(1024, static_cast<int>(ab->ByteLength()));
   CHECK(!ab->IsExternal());
@@ -2927,7 +2933,8 @@ THREADED_TEST(ArrayBuffer_External) {
 
   i::ScopedVector<uint8_t> my_data(100);
   memset(my_data.start(), 0, 100);
-  Local<v8::ArrayBuffer> ab3 = v8::ArrayBuffer::New(my_data.start(), 100);
+  Local<v8::ArrayBuffer> ab3 =
+      v8::ArrayBuffer::New(isolate, my_data.start(), 100);
   CheckInternalFieldsAreZero(ab3);
   CHECK_EQ(100, static_cast<int>(ab3->ByteLength()));
   CHECK(ab3->IsExternal());
@@ -2994,7 +3001,7 @@ THREADED_TEST(ArrayBuffer_NeuteringApi) {
   v8::Isolate* isolate = env->GetIsolate();
   v8::HandleScope handle_scope(isolate);
 
-  v8::Handle<v8::ArrayBuffer> buffer = v8::ArrayBuffer::New(1024);
+  v8::Handle<v8::ArrayBuffer> buffer = v8::ArrayBuffer::New(isolate, 1024);
 
   v8::Handle<v8::Uint8Array> u8a =
     CreateAndCheck<v8::Uint8Array, 1>(buffer, 1, 1023);
@@ -4141,7 +4148,7 @@ THREADED_TEST(PropertyAttributes) {
 THREADED_TEST(Array) {
   LocalContext context;
   v8::HandleScope scope(context->GetIsolate());
-  Local<v8::Array> array = v8::Array::New();
+  Local<v8::Array> array = v8::Array::New(context->GetIsolate());
   CHECK_EQ(0, array->Length());
   CHECK(array->Get(0)->IsUndefined());
   CHECK(!array->Has(0));
@@ -4159,9 +4166,9 @@ THREADED_TEST(Array) {
   CHECK_EQ(1, arr->Get(0)->Int32Value());
   CHECK_EQ(2, arr->Get(1)->Int32Value());
   CHECK_EQ(3, arr->Get(2)->Int32Value());
-  array = v8::Array::New(27);
+  array = v8::Array::New(context->GetIsolate(), 27);
   CHECK_EQ(27, array->Length());
-  array = v8::Array::New(-27);
+  array = v8::Array::New(context->GetIsolate(), -27);
   CHECK_EQ(0, array->Length());
 }
 
@@ -4169,7 +4176,7 @@ THREADED_TEST(Array) {
 void HandleF(const v8::FunctionCallbackInfo<v8::Value>& args) {
   v8::HandleScope scope(args.GetIsolate());
   ApiTestFuzzer::Fuzz();
-  Local<v8::Array> result = v8::Array::New(args.Length());
+  Local<v8::Array> result = v8::Array::New(args.GetIsolate(), args.Length());
   for (int i = 0; i < args.Length(); i++)
     result->Set(i, args[i]);
   args.GetReturnValue().Set(scope.Close(result));
@@ -6689,7 +6696,8 @@ class NativeFunctionExtension : public Extension {
       : Extension(name, source),
         function_(fun) { }
 
-  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
+      v8::Isolate* isolate,
       v8::Handle<v8::String> name) {
     return v8::FunctionTemplate::New(function_);
   }
@@ -6810,14 +6818,15 @@ static void CallFun(const v8::FunctionCallbackInfo<v8::Value>& args) {
 class FunctionExtension : public Extension {
  public:
   FunctionExtension() : Extension("functiontest", kExtensionTestScript) { }
-  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
+      v8::Isolate* isolate,
       v8::Handle<String> name);
 };
 
 
 static int lookup_count = 0;
-v8::Handle<v8::FunctionTemplate> FunctionExtension::GetNativeFunction(
-      v8::Handle<String> name) {
+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(CallFun, v8::Integer::New(8));
@@ -7255,7 +7264,7 @@ 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(3);
+  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"));
@@ -7265,7 +7274,7 @@ 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(2);
+  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"));
   info.GetReturnValue().Set(result);
@@ -9087,7 +9096,7 @@ THREADED_TEST(AccessControlGetOwnPropertyNames) {
 
 static void IndexedPropertyEnumerator(
     const v8::PropertyCallbackInfo<v8::Array>& info) {
-  v8::Handle<v8::Array> result = v8::Array::New(2);
+  v8::Handle<v8::Array> result = v8::Array::New(info.GetIsolate(), 2);
   result->Set(0, v8::Integer::New(7));
   result->Set(1, v8::Object::New());
   info.GetReturnValue().Set(result);
@@ -9096,7 +9105,7 @@ static void IndexedPropertyEnumerator(
 
 static void NamedPropertyEnumerator(
     const v8::PropertyCallbackInfo<v8::Array>& info) {
-  v8::Handle<v8::Array> result = v8::Array::New(2);
+  v8::Handle<v8::Array> result = v8::Array::New(info.GetIsolate(), 2);
   result->Set(0, v8_str("x"));
   result->Set(1, v8::Object::New());
   info.GetReturnValue().Set(result);
@@ -11594,7 +11603,7 @@ THREADED_TEST(CallICFastApi_DirectCall_GCMoveStub) {
   LocalContext context;
   v8::HandleScope scope(context->GetIsolate());
   v8::Handle<v8::ObjectTemplate> nativeobject_templ = v8::ObjectTemplate::New();
-  nativeobject_templ->Set("callback",
+  nativeobject_templ->Set(context->GetIsolate(), "callback",
                           v8::FunctionTemplate::New(DirectApiCallback));
   v8::Local<v8::Object> nativeobject_obj = nativeobject_templ->NewInstance();
   context->Global()->Set(v8_str("nativeobject"), nativeobject_obj);
@@ -11619,7 +11628,7 @@ THREADED_TEST(CallICFastApi_DirectCall_Throw) {
   LocalContext context;
   v8::HandleScope scope(context->GetIsolate());
   v8::Handle<v8::ObjectTemplate> nativeobject_templ = v8::ObjectTemplate::New();
-  nativeobject_templ->Set("callback",
+  nativeobject_templ->Set(context->GetIsolate(), "callback",
                           v8::FunctionTemplate::New(ThrowingDirectApiCallback));
   v8::Local<v8::Object> nativeobject_obj = nativeobject_templ->NewInstance();
   context->Global()->Set(v8_str("nativeobject"), nativeobject_obj);
@@ -11731,10 +11740,9 @@ THREADED_PROFILED_TEST(InterceptorCallICFastApi_SimpleSignature) {
   int interceptor_call_count = 0;
   v8::HandleScope scope(CcTest::isolate());
   v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New();
-  v8::Handle<v8::FunctionTemplate> method_templ =
-      v8::FunctionTemplate::New(FastApiCallback_SimpleSignature,
-                                v8_str("method_data"),
-                                v8::Signature::New(fun_templ));
+  v8::Handle<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New(
+      FastApiCallback_SimpleSignature, v8_str("method_data"),
+      v8::Signature::New(CcTest::isolate(), fun_templ));
   v8::Handle<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate();
   proto_templ->Set(v8_str("method"), method_templ);
   fun_templ->SetHiddenPrototype(true);
@@ -11763,10 +11771,9 @@ THREADED_PROFILED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss1) {
   int interceptor_call_count = 0;
   v8::HandleScope scope(CcTest::isolate());
   v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New();
-  v8::Handle<v8::FunctionTemplate> method_templ =
-      v8::FunctionTemplate::New(FastApiCallback_SimpleSignature,
-                                v8_str("method_data"),
-                                v8::Signature::New(fun_templ));
+  v8::Handle<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New(
+      FastApiCallback_SimpleSignature, v8_str("method_data"),
+      v8::Signature::New(CcTest::isolate(), fun_templ));
   v8::Handle<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate();
   proto_templ->Set(v8_str("method"), method_templ);
   fun_templ->SetHiddenPrototype(true);
@@ -11801,10 +11808,9 @@ THREADED_PROFILED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss2) {
   int interceptor_call_count = 0;
   v8::HandleScope scope(CcTest::isolate());
   v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New();
-  v8::Handle<v8::FunctionTemplate> method_templ =
-      v8::FunctionTemplate::New(FastApiCallback_SimpleSignature,
-                                v8_str("method_data"),
-                                v8::Signature::New(fun_templ));
+  v8::Handle<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New(
+      FastApiCallback_SimpleSignature, v8_str("method_data"),
+      v8::Signature::New(CcTest::isolate(), fun_templ));
   v8::Handle<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate();
   proto_templ->Set(v8_str("method"), method_templ);
   fun_templ->SetHiddenPrototype(true);
@@ -11839,10 +11845,9 @@ THREADED_PROFILED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss3) {
   int interceptor_call_count = 0;
   v8::HandleScope scope(CcTest::isolate());
   v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New();
-  v8::Handle<v8::FunctionTemplate> method_templ =
-      v8::FunctionTemplate::New(FastApiCallback_SimpleSignature,
-                                v8_str("method_data"),
-                                v8::Signature::New(fun_templ));
+  v8::Handle<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New(
+      FastApiCallback_SimpleSignature, v8_str("method_data"),
+      v8::Signature::New(CcTest::isolate(), fun_templ));
   v8::Handle<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate();
   proto_templ->Set(v8_str("method"), method_templ);
   fun_templ->SetHiddenPrototype(true);
@@ -11880,10 +11885,9 @@ THREADED_PROFILED_TEST(InterceptorCallICFastApi_SimpleSignature_TypeError) {
   int interceptor_call_count = 0;
   v8::HandleScope scope(CcTest::isolate());
   v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New();
-  v8::Handle<v8::FunctionTemplate> method_templ =
-      v8::FunctionTemplate::New(FastApiCallback_SimpleSignature,
-                                v8_str("method_data"),
-                                v8::Signature::New(fun_templ));
+  v8::Handle<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New(
+      FastApiCallback_SimpleSignature, v8_str("method_data"),
+      v8::Signature::New(CcTest::isolate(), fun_templ));
   v8::Handle<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate();
   proto_templ->Set(v8_str("method"), method_templ);
   fun_templ->SetHiddenPrototype(true);
@@ -11945,10 +11949,9 @@ THREADED_PROFILED_TEST(CallICFastApi_TrivialSignature) {
 THREADED_PROFILED_TEST(CallICFastApi_SimpleSignature) {
   v8::HandleScope scope(CcTest::isolate());
   v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New();
-  v8::Handle<v8::FunctionTemplate> method_templ =
-      v8::FunctionTemplate::New(FastApiCallback_SimpleSignature,
-                                v8_str("method_data"),
-                                v8::Signature::New(fun_templ));
+  v8::Handle<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New(
+      FastApiCallback_SimpleSignature, v8_str("method_data"),
+      v8::Signature::New(CcTest::isolate(), fun_templ));
   v8::Handle<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate();
   proto_templ->Set(v8_str("method"), method_templ);
   fun_templ->SetHiddenPrototype(true);
@@ -11974,10 +11977,9 @@ THREADED_PROFILED_TEST(CallICFastApi_SimpleSignature) {
 THREADED_PROFILED_TEST(CallICFastApi_SimpleSignature_Miss1) {
   v8::HandleScope scope(CcTest::isolate());
   v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New();
-  v8::Handle<v8::FunctionTemplate> method_templ =
-      v8::FunctionTemplate::New(FastApiCallback_SimpleSignature,
-                                v8_str("method_data"),
-                                v8::Signature::New(fun_templ));
+  v8::Handle<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New(
+      FastApiCallback_SimpleSignature, v8_str("method_data"),
+      v8::Signature::New(CcTest::isolate(), fun_templ));
   v8::Handle<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate();
   proto_templ->Set(v8_str("method"), method_templ);
   fun_templ->SetHiddenPrototype(true);
@@ -12008,10 +12010,9 @@ THREADED_PROFILED_TEST(CallICFastApi_SimpleSignature_Miss1) {
 THREADED_PROFILED_TEST(CallICFastApi_SimpleSignature_Miss2) {
   v8::HandleScope scope(CcTest::isolate());
   v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New();
-  v8::Handle<v8::FunctionTemplate> method_templ =
-      v8::FunctionTemplate::New(FastApiCallback_SimpleSignature,
-                                v8_str("method_data"),
-                                v8::Signature::New(fun_templ));
+  v8::Handle<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New(
+      FastApiCallback_SimpleSignature, v8_str("method_data"),
+      v8::Signature::New(CcTest::isolate(), fun_templ));
   v8::Handle<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate();
   proto_templ->Set(v8_str("method"), method_templ);
   fun_templ->SetHiddenPrototype(true);
@@ -12045,10 +12046,9 @@ THREADED_PROFILED_TEST(CallICFastApi_SimpleSignature_Miss2) {
 THREADED_PROFILED_TEST(CallICFastApi_SimpleSignature_TypeError) {
   v8::HandleScope scope(CcTest::isolate());
   v8::Handle<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New();
-  v8::Handle<v8::FunctionTemplate> method_templ =
-      v8::FunctionTemplate::New(FastApiCallback_SimpleSignature,
-                                v8_str("method_data"),
-                                v8::Signature::New(fun_templ));
+  v8::Handle<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New(
+      FastApiCallback_SimpleSignature, v8_str("method_data"),
+      v8::Signature::New(CcTest::isolate(), fun_templ));
   v8::Handle<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate();
   proto_templ->Set(v8_str("method"), method_templ);
   fun_templ->SetHiddenPrototype(true);
@@ -12367,7 +12367,7 @@ THREADED_TEST(NullNamedInterceptor) {
   templ->SetNamedPropertyHandler(
       static_cast<v8::NamedPropertyGetterCallback>(0));
   LocalContext context;
-  templ->Set("x", v8_num(42));
+  templ->Set(CcTest::isolate(), "x", v8_num(42));
   v8::Handle<v8::Object> obj = templ->NewInstance();
   context->Global()->Set(v8_str("obj"), obj);
   v8::Handle<Value> value = CompileRun("obj.x");
@@ -12383,7 +12383,7 @@ THREADED_TEST(NullIndexedInterceptor) {
   templ->SetIndexedPropertyHandler(
       static_cast<v8::IndexedPropertyGetterCallback>(0));
   LocalContext context;
-  templ->Set("42", v8_num(42));
+  templ->Set(CcTest::isolate(), "42", v8_num(42));
   v8::Handle<v8::Object> obj = templ->NewInstance();
   context->Global()->Set(v8_str("obj"), obj);
   v8::Handle<Value> value = CompileRun("obj[42]");
@@ -13981,7 +13981,8 @@ THREADED_TEST(CallbackFunctionName) {
 THREADED_TEST(DateAccess) {
   LocalContext context;
   v8::HandleScope scope(context->GetIsolate());
-  v8::Handle<v8::Value> date = v8::Date::New(1224744689038.0);
+  v8::Handle<v8::Value> date =
+      v8::Date::New(context->GetIsolate(), 1224744689038.0);
   CHECK(date->IsDate());
   CHECK_EQ(1224744689038.0, date.As<v8::Date>()->ValueOf());
 }
@@ -14488,7 +14489,7 @@ TEST(PreCompileAPIVariationsAreSame) {
 
   TestAsciiResource* resource = new TestAsciiResource(cstring);
   v8::ScriptData* sd_from_external_string = v8::ScriptData::PreCompile(
-      v8::String::NewExternal(resource));
+      v8::String::NewExternal(isolate, resource));
 
   v8::ScriptData* sd_from_string = v8::ScriptData::PreCompile(
       v8::String::NewFromUtf8(isolate, cstring));
@@ -14736,7 +14737,8 @@ TEST(CompileExternalTwoByteSource) {
     UC16VectorResource uc16_resource(
         i::Vector<const uint16_t>(two_byte_string,
                                   i::StrLength(ascii_sources[i])));
-    v8::Local<v8::String> source = v8::String::NewExternal(&uc16_resource);
+    v8::Local<v8::String> source =
+        v8::String::NewExternal(context->GetIsolate(), &uc16_resource);
     v8::Script::Compile(source);
     i::DeleteArray(two_byte_string);
   }
@@ -16375,8 +16377,9 @@ void TypedArrayTestHelper(v8::ExternalArrayType array_type,
   v8::Isolate* isolate = env->GetIsolate();
   v8::HandleScope handle_scope(isolate);
 
-  Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(
-      backing_store.start(), (kElementCount+2)*sizeof(ElementType));
+  Local<v8::ArrayBuffer> ab =
+      v8::ArrayBuffer::New(isolate, backing_store.start(),
+                           (kElementCount + 2) * sizeof(ElementType));
   Local<TypedArray> ta =
       TypedArray::New(ab, 2*sizeof(ElementType), kElementCount);
   CheckInternalFieldsAreZero<v8::ArrayBufferView>(ta);
@@ -16461,8 +16464,8 @@ THREADED_TEST(DataView) {
   v8::Isolate* isolate = env->GetIsolate();
   v8::HandleScope handle_scope(isolate);
 
-  Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(
-      backing_store.start(), 2 + kSize);
+  Local<v8::ArrayBuffer> ab =
+      v8::ArrayBuffer::New(isolate, backing_store.start(), 2 + kSize);
   Local<v8::DataView> dv =
       v8::DataView::New(ab, 2, kSize);
   CheckInternalFieldsAreZero<v8::ArrayBufferView>(dv);
@@ -16569,8 +16572,8 @@ void AnalyzeStackInNativeCode(const v8::FunctionCallbackInfo<v8::Value>& args) {
 
   int testGroup = args[0]->Int32Value();
   if (testGroup == kOverviewTest) {
-    v8::Handle<v8::StackTrace> stackTrace =
-        v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kOverview);
+    v8::Handle<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(
+        args.GetIsolate(), 10, v8::StackTrace::kOverview);
     CHECK_EQ(4, stackTrace->GetFrameCount());
     checkStackFrame(origin, "bar", 2, 10, false, false,
                     stackTrace->GetFrame(0));
@@ -16585,8 +16588,8 @@ void AnalyzeStackInNativeCode(const v8::FunctionCallbackInfo<v8::Value>& args) {
 
     CHECK(stackTrace->AsArray()->IsArray());
   } else if (testGroup == kDetailedTest) {
-    v8::Handle<v8::StackTrace> stackTrace =
-        v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed);
+    v8::Handle<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(
+        args.GetIsolate(), 10, v8::StackTrace::kDetailed);
     CHECK_EQ(4, stackTrace->GetFrameCount());
     checkStackFrame(origin, "bat", 4, 22, false, false,
                     stackTrace->GetFrame(0));
@@ -16852,8 +16855,8 @@ TEST(RethrowBogusErrorStackTrace) {
 void AnalyzeStackOfEvalWithSourceURL(
     const v8::FunctionCallbackInfo<v8::Value>& args) {
   v8::HandleScope scope(args.GetIsolate());
-  v8::Handle<v8::StackTrace> stackTrace =
-      v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed);
+  v8::Handle<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(
+      args.GetIsolate(), 10, v8::StackTrace::kDetailed);
   CHECK_EQ(5, stackTrace->GetFrameCount());
   v8::Handle<v8::String> url = v8_str("eval_url");
   for (int i = 0; i < 3; i++) {
@@ -16898,8 +16901,8 @@ static int scriptIdInStack[2];
 void AnalyzeScriptIdInStack(
     const v8::FunctionCallbackInfo<v8::Value>& args) {
   v8::HandleScope scope(args.GetIsolate());
-  v8::Handle<v8::StackTrace> stackTrace =
-      v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kScriptId);
+  v8::Handle<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(
+      args.GetIsolate(), 10, v8::StackTrace::kScriptId);
   CHECK_EQ(2, stackTrace->GetFrameCount());
   for (int i = 0; i < 2; i++) {
     scriptIdInStack[i] = stackTrace->GetFrame(i)->GetScriptId();
@@ -16934,8 +16937,8 @@ TEST(ScriptIdInStackTrace) {
 void AnalyzeStackOfInlineScriptWithSourceURL(
     const v8::FunctionCallbackInfo<v8::Value>& args) {
   v8::HandleScope scope(args.GetIsolate());
-  v8::Handle<v8::StackTrace> stackTrace =
-      v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed);
+  v8::Handle<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(
+      args.GetIsolate(), 10, v8::StackTrace::kDetailed);
   CHECK_EQ(4, stackTrace->GetFrameCount());
   v8::Handle<v8::String> url = v8_str("url");
   for (int i = 0; i < 3; i++) {
@@ -16979,8 +16982,8 @@ TEST(InlineScriptWithSourceURLInStackTrace) {
 void AnalyzeStackOfDynamicScriptWithSourceURL(
     const v8::FunctionCallbackInfo<v8::Value>& args) {
   v8::HandleScope scope(args.GetIsolate());
-  v8::Handle<v8::StackTrace> stackTrace =
-      v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed);
+  v8::Handle<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(
+      args.GetIsolate(), 10, v8::StackTrace::kDetailed);
   CHECK_EQ(4, stackTrace->GetFrameCount());
   v8::Handle<v8::String> url = v8_str("source_url");
   for (int i = 0; i < 3; i++) {
@@ -17264,9 +17267,11 @@ TEST(VisitExternalStrings) {
   uint16_t* two_byte_string = AsciiToTwoByteString(string);
   TestResource* resource[4];
   resource[0] = new TestResource(two_byte_string);
-  v8::Local<v8::String> string0 = v8::String::NewExternal(resource[0]);
+  v8::Local<v8::String> string0 =
+      v8::String::NewExternal(env->GetIsolate(), resource[0]);
   resource[1] = new TestResource(two_byte_string);
-  v8::Local<v8::String> string1 = v8::String::NewExternal(resource[1]);
+  v8::Local<v8::String> string1 =
+      v8::String::NewExternal(env->GetIsolate(), resource[1]);
 
   // Externalized symbol.
   resource[2] = new TestResource(two_byte_string);
@@ -17276,7 +17281,8 @@ TEST(VisitExternalStrings) {
 
   // Symbolized External.
   resource[3] = new TestResource(AsciiToTwoByteString("Some other string"));
-  v8::Local<v8::String> string3 = v8::String::NewExternal(resource[3]);
+  v8::Local<v8::String> string3 =
+      v8::String::NewExternal(env->GetIsolate(), resource[3]);
   CcTest::heap()->CollectAllAvailableGarbage();  // Tenure string.
   // Turn into a symbol.
   i::Handle<i::String> string3_i = v8::Utils::OpenHandle(*string3);
@@ -17303,7 +17309,7 @@ TEST(ExternalStringCollectedAtTearDown) {
     const char* s = "One string to test them all, one string to find them.";
     TestAsciiResource* inscription =
         new TestAsciiResource(i::StrDup(s), &destroyed);
-    v8::Local<v8::String> ring = v8::String::NewExternal(inscription);
+    v8::Local<v8::String> ring = v8::String::NewExternal(isolate, inscription);
     // Ring is still alive.  Orcs are roaming freely across our lands.
     CHECK_EQ(0, destroyed);
     USE(ring);
@@ -17409,7 +17415,8 @@ 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(test_value);
+    v8::Handle<v8::Value> date =
+        v8::Date::New(context->GetIsolate(), test_value);
     double expected_stored_date = DoubleToDateTime(test_value);
     double stored_date = date->NumberValue();
     if (!std::isnan(expected_stored_date)) {
@@ -18259,7 +18266,7 @@ TEST(ContainsOnlyOneByte) {
   string_contents[length-1] = 0;
   // Simple case.
   Handle<String> string;
-  string = String::NewExternal(new TestResource(string_contents));
+  string = String::NewExternal(isolate, new TestResource(string_contents));
   CHECK(!string->IsOneByte() && string->ContainsOnlyOneByte());
   // Counter example.
   string = String::NewFromTwoByte(isolate, string_contents);
@@ -18276,7 +18283,7 @@ TEST(ContainsOnlyOneByte) {
   balanced = String::Concat(balanced, right);
   Handle<String> cons_strings[] = {left, balanced, right};
   Handle<String> two_byte =
-      String::NewExternal(new TestResource(string_contents));
+      String::NewExternal(isolate, new TestResource(string_contents));
   for (size_t i = 0; i < ARRAY_SIZE(cons_strings); i++) {
     // Base assumptions.
     string = cons_strings[i];
@@ -18296,8 +18303,8 @@ TEST(ContainsOnlyOneByte) {
       for (int i = 0; i < size; i++) {
         int shift = 8 + (i % 7);
         string_contents[alignment + i] = 1 << shift;
-        string =
-            String::NewExternal(new TestResource(string_contents + alignment));
+        string = String::NewExternal(
+            isolate, new TestResource(string_contents + alignment));
         CHECK_EQ(size, string->Length());
         CHECK(!string->ContainsOnlyOneByte());
         string_contents[alignment + i] = 0x41;
@@ -19079,7 +19086,7 @@ static void Getter(v8::Local<v8::String> property,
 
 
 static void Enumerator(const v8::PropertyCallbackInfo<v8::Array>& info) {
-  v8::Handle<v8::Array> result = v8::Array::New();
+  v8::Handle<v8::Array> result = v8::Array::New(info.GetIsolate());
   result->Set(0, v8_str("universalAnswer"));
   info.GetReturnValue().Set(result);
 }
@@ -20090,7 +20097,7 @@ THREADED_TEST(InstanceCheckOnInstanceAccessor) {
                     Handle<Value>(),
                     v8::DEFAULT,
                     v8::None,
-                    v8::AccessorSignature::New(templ));
+                    v8::AccessorSignature::New(context->GetIsolate(), templ));
   context->Global()->Set(v8_str("f"), templ->GetFunction());
 
   printf("Testing positive ...\n");
@@ -20119,7 +20126,7 @@ THREADED_TEST(InstanceCheckOnInstanceAccessorWithInterceptor) {
                     Handle<Value>(),
                     v8::DEFAULT,
                     v8::None,
-                    v8::AccessorSignature::New(templ));
+                    v8::AccessorSignature::New(context->GetIsolate(), templ));
   context->Global()->Set(v8_str("f"), templ->GetFunction());
 
   printf("Testing positive ...\n");
@@ -20147,7 +20154,7 @@ THREADED_TEST(InstanceCheckOnPrototypeAccessor) {
                      Handle<Value>(),
                      v8::DEFAULT,
                      v8::None,
-                     v8::AccessorSignature::New(templ));
+                     v8::AccessorSignature::New(context->GetIsolate(), templ));
   context->Global()->Set(v8_str("f"), templ->GetFunction());
 
   printf("Testing positive ...\n");
@@ -20566,7 +20573,7 @@ TEST(JSONStringifyAccessCheck) {
     ExpectString("JSON.stringify([other, 'b', 'c'])",
                  "[{},\"b\",\"c\"]");
 
-    v8::Handle<v8::Array> array = v8::Array::New(2);
+    v8::Handle<v8::Array> array = v8::Array::New(CcTest::isolate(), 2);
     array->Set(0, v8_str("a"));
     array->Set(1, v8_str("b"));
     context1->Global()->Set(v8_str("array"), array);
index ca788a9ebdd2c717ef025502f0b9273db4ff7f7f..9c3e6fb4ed2d892a9261ea4948e1d03c5517e556 100644 (file)
@@ -548,7 +548,7 @@ TEST(StackAlignmentForSSE2) {
       v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo")));
 
   int32_t vec[ELEMENT_COUNT] = { -1, 1, 1, 1 };
-  v8::Local<v8::Array> v8_vec = v8::Array::New(ELEMENT_COUNT);
+  v8::Local<v8::Array> v8_vec = v8::Array::New(isolate, ELEMENT_COUNT);
   for (int i = 0; i < ELEMENT_COUNT; i++) {
       v8_vec->Set(i, v8_num(vec[i]));
   }
index 4372d8a3ecff8392e5e64a8bcd31211ec092feaf..d33da34a12812e36f0335ee2c475a4a345ef8526 100644 (file)
@@ -628,7 +628,7 @@ TEST(StackAlignmentForSSE2) {
       v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo")));
 
   int32_t vec[ELEMENT_COUNT] = { -1, 1, 1, 1 };
-  v8::Local<v8::Array> v8_vec = v8::Array::New(ELEMENT_COUNT);
+  v8::Local<v8::Array> v8_vec = v8::Array::New(isolate, ELEMENT_COUNT);
   for (int i = 0; i < ELEMENT_COUNT; i++) {
     v8_vec->Set(i, v8_num(vec[i]));
   }
index b2a0199353612ea5fa6879fef0472d665deb2370..a0836c342641370306dd0acce543ca4f23687b6d 100644 (file)
@@ -45,7 +45,8 @@ using namespace v8::internal;
 class PrintExtension : public v8::Extension {
  public:
   PrintExtension() : v8::Extension("v8/print", kSource) { }
-  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
+      v8::Isolate* isolate,
       v8::Handle<v8::String> name);
   static void Print(const v8::FunctionCallbackInfo<v8::Value>& args);
  private:
@@ -56,7 +57,8 @@ class PrintExtension : public v8::Extension {
 const char* PrintExtension::kSource = "native function print();";
 
 
-v8::Handle<v8::FunctionTemplate> PrintExtension::GetNativeFunction(
+v8::Handle<v8::FunctionTemplate> PrintExtension::GetNativeFunctionTemplate(
+    v8::Isolate* isolate,
     v8::Handle<v8::String> str) {
   return v8::FunctionTemplate::New(PrintExtension::Print);
 }
index c847afcc2708a0f4dec257759b35483edb464968..9627277aa4dcbe5ab17ae6655c987621ad32d2b4 100644 (file)
@@ -843,7 +843,8 @@ TEST(NativeMethodUninitializedIC) {
       v8::String::NewFromUtf8(env->GetIsolate(), "Test_InstanceCostructor"));
   v8::Local<v8::ObjectTemplate> proto_template =
       func_template->PrototypeTemplate();
-  v8::Local<v8::Signature> signature = v8::Signature::New(func_template);
+  v8::Local<v8::Signature> signature =
+      v8::Signature::New(env->GetIsolate(), func_template);
   proto_template->Set(v8::String::NewFromUtf8(env->GetIsolate(), "fooMethod"),
                       v8::FunctionTemplate::New(&TestApiCallbacks::Callback,
                                                 data, signature, 0));
@@ -886,7 +887,8 @@ TEST(NativeMethodMonomorphicIC) {
       v8::String::NewFromUtf8(env->GetIsolate(), "Test_InstanceCostructor"));
   v8::Local<v8::ObjectTemplate> proto_template =
       func_template->PrototypeTemplate();
-  v8::Local<v8::Signature> signature = v8::Signature::New(func_template);
+  v8::Local<v8::Signature> signature =
+      v8::Signature::New(env->GetIsolate(), func_template);
   proto_template->Set(v8::String::NewFromUtf8(env->GetIsolate(), "fooMethod"),
                       v8::FunctionTemplate::New(&TestApiCallbacks::Callback,
                                                 data, signature, 0));
index 00e40203c7f568bcb349ebc7d00c23ba4876d961..ff802e3ddcdb52a0e2257d895d1bd3fa84e67aa9 100644 (file)
@@ -2922,7 +2922,7 @@ TEST(DebugStepKeyedLoadLoop) {
       "foo");
 
   // Create array [0,1,2,3,4,5,6,7,8,9]
-  v8::Local<v8::Array> a = v8::Array::New(10);
+  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));
   }
@@ -2969,7 +2969,7 @@ TEST(DebugStepKeyedStoreLoop) {
       "foo");
 
   // Create array [0,1,2,3,4,5,6,7,8,9]
-  v8::Local<v8::Array> a = v8::Array::New(10);
+  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));
   }
@@ -4356,7 +4356,7 @@ TEST(NoBreakWhenBootstrapping) {
 
 
 static void NamedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) {
-  v8::Handle<v8::Array> result = v8::Array::New(3);
+  v8::Handle<v8::Array> result = v8::Array::New(info.GetIsolate(), 3);
   result->Set(v8::Integer::New(0),
               v8::String::NewFromUtf8(info.GetIsolate(), "a"));
   result->Set(v8::Integer::New(1),
@@ -4368,7 +4368,7 @@ static void NamedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) {
 
 
 static void IndexedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) {
-  v8::Handle<v8::Array> result = v8::Array::New(2);
+  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));
   info.GetReturnValue().Set(result);
@@ -6251,7 +6251,8 @@ TEST(DebugGetLoadedScripts) {
   env.ExposeDebug();
 
   EmptyExternalStringResource source_ext_str;
-  v8::Local<v8::String> source = v8::String::NewExternal(&source_ext_str);
+  v8::Local<v8::String> source =
+      v8::String::NewExternal(env->GetIsolate(), &source_ext_str);
   v8::Handle<v8::Script> evil_script(v8::Script::Compile(source));
   // "use" evil_script to make the compiler happy.
   (void) evil_script;
index 458493b6d5d32237f5ffad9371a22f90f99d9967..e496673776ca9915f6cab21df9848c4183ff5603 100644 (file)
@@ -736,7 +736,8 @@ TEST(HeapSnapshotJSONSerialization) {
 
   // Verify that snapshot string is valid JSON.
   AsciiResource json_res(json);
-  v8::Local<v8::String> json_string = v8::String::NewExternal(&json_res);
+  v8::Local<v8::String> json_string =
+      v8::String::NewExternal(env->GetIsolate(), &json_res);
   env->Global()->Set(v8_str("json_snapshot"), json_string);
   v8::Local<v8::Value> snapshot_parse_result = CompileRun(
       "var parsed = JSON.parse(json_snapshot); true;");
@@ -1004,7 +1005,7 @@ TEST(HeapSnapshotObjectsStats) {
     CHECK_EQ(2, stats_update.first_interval_index());
   }
 
-  v8::Local<v8::Array> array = v8::Array::New();
+  v8::Local<v8::Array> array = v8::Array::New(env->GetIsolate());
   CHECK_EQ(0, array->Length());
   // Force array's buffer allocation.
   array->Set(2, v8_num(7));
@@ -2021,7 +2022,8 @@ class HeapProfilerExtension : public v8::Extension {
  public:
   static const char* kName;
   HeapProfilerExtension() : v8::Extension(kName, kSource) { }
-  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
+      v8::Isolate* isolate,
       v8::Handle<v8::String> name);
   static void FindUntrackedObjects(
       const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -2036,10 +2038,10 @@ const char* HeapProfilerExtension::kSource =
     "native function findUntrackedObjects();";
 
 
-v8::Handle<v8::FunctionTemplate> HeapProfilerExtension::GetNativeFunction(
-    v8::Handle<v8::String> name) {
-  if (name->Equals(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(),
-                                           "findUntrackedObjects"))) {
+v8::Handle<v8::FunctionTemplate>
+HeapProfilerExtension::GetNativeFunctionTemplate(v8::Isolate* isolate,
+                                                 v8::Handle<v8::String> name) {
+  if (name->Equals(v8::String::NewFromUtf8(isolate, "findUntrackedObjects"))) {
     return v8::FunctionTemplate::New(
         HeapProfilerExtension::FindUntrackedObjects);
   } else {
index d6405b1741ded1a45bd1cd25c32f219f4d805e6a..77395b534980ef5e8086c6142f1c313a72e4d98b 100644 (file)
@@ -2977,7 +2977,8 @@ void ReleaseStackTraceDataTest(const char* source, const char* accessor) {
   SourceResource* resource = new SourceResource(i::StrDup(source));
   {
     v8::HandleScope scope(CcTest::isolate());
-    v8::Handle<v8::String> source_string = v8::String::NewExternal(resource);
+    v8::Handle<v8::String> source_string =
+        v8::String::NewExternal(CcTest::isolate(), resource);
     CcTest::heap()->CollectAllAvailableGarbage();
     v8::Script::Compile(source_string)->Run();
     CHECK(!resource->IsDisposed());
index 85fdf459924b387b4e06082b82aaedbbb3dbd8ba..7d60c2a3979285672b7c9106e15d5b8a4f3113ca 100644 (file)
@@ -93,7 +93,8 @@ static void DoTraceHideCEntryFPAddress(Address fp) {
 class TraceExtension : public v8::Extension {
  public:
   TraceExtension() : v8::Extension("v8/trace", kSource) { }
-  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
+      v8::Isolate* isolate,
       v8::Handle<String> name);
   static void Trace(const v8::FunctionCallbackInfo<v8::Value>& args);
   static void JSTrace(const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -111,18 +112,16 @@ const char* TraceExtension::kSource =
     "native function js_entry_sp();"
     "native function js_entry_sp_level2();";
 
-v8::Handle<v8::FunctionTemplate> TraceExtension::GetNativeFunction(
-    v8::Handle<String> name) {
-  if (name->Equals(String::NewFromUtf8(v8::Isolate::GetCurrent(), "trace"))) {
+v8::Handle<v8::FunctionTemplate> TraceExtension::GetNativeFunctionTemplate(
+    v8::Isolate* isolate, v8::Handle<String> name) {
+  if (name->Equals(String::NewFromUtf8(isolate, "trace"))) {
     return v8::FunctionTemplate::New(TraceExtension::Trace);
   } else if (name->Equals(
-                 String::NewFromUtf8(v8::Isolate::GetCurrent(), "js_trace"))) {
+                 String::NewFromUtf8(isolate, "js_trace"))) {
     return v8::FunctionTemplate::New(TraceExtension::JSTrace);
-  } else if (name->Equals(String::NewFromUtf8(v8::Isolate::GetCurrent(),
-                                              "js_entry_sp"))) {
+  } else if (name->Equals(String::NewFromUtf8(isolate, "js_entry_sp"))) {
     return v8::FunctionTemplate::New(TraceExtension::JSEntrySP);
-  } else if (name->Equals(String::NewFromUtf8(v8::Isolate::GetCurrent(),
-                                              "js_entry_sp_level2"))) {
+  } else if (name->Equals(String::NewFromUtf8(isolate, "js_entry_sp_level2"))) {
     return v8::FunctionTemplate::New(TraceExtension::JSEntrySPLevel2);
   } else {
     CHECK(false);
index b838fda5fedb97fbecc60bfdca2b7b2c09428e3c..6c91f72ec8ee70516e751ce5bd3bce96a7b8b256 100644 (file)
@@ -305,7 +305,8 @@ TEST(Issue23768) {
   env->Enter();
 
   SimpleExternalString source_ext_str("(function ext() {})();");
-  v8::Local<v8::String> source = v8::String::NewExternal(&source_ext_str);
+  v8::Local<v8::String> source =
+      v8::String::NewExternal(CcTest::isolate(), &source_ext_str);
   // Script needs to have a name in order to trigger InitLineEnds execution.
   v8::Handle<v8::String> origin =
       v8::String::NewFromUtf8(CcTest::isolate(), "issue-23768-test");
@@ -336,7 +337,8 @@ TEST(LogCallbacks) {
                                            v8::FunctionTemplate::New());
   obj->SetClassName(v8_str("Obj"));
   v8::Handle<v8::ObjectTemplate> proto = obj->PrototypeTemplate();
-  v8::Local<v8::Signature> signature = v8::Signature::New(obj);
+  v8::Local<v8::Signature> signature =
+      v8::Signature::New(CcTest::isolate(), obj);
   proto->Set(v8_str("method1"),
              v8::FunctionTemplate::New(ObjMethod1,
                                        v8::Handle<v8::Value>(),
index ce5611183c71b463293d53eb634b418c6d036fc7..4c32d44dcb3fa5d4c624068327b593b76c840e77 100644 (file)
@@ -526,7 +526,7 @@ static Handle<Object> CreateAccessCheckedObject(
   Handle<Object> instance = tmpl->NewInstance();
   Handle<Object> global = instance->CreationContext()->Global();
   global->Set(String::NewFromUtf8(isolate, "obj"), instance);
-  global->Set(kBlockedContextIndex, v8::True());
+  global->Set(kBlockedContextIndex, v8::True(isolate));
   return instance;
 }
 
@@ -761,8 +761,9 @@ TEST(HiddenPropertiesLeakage) {
              "Object.observe(obj, observer);");
   Handle<Value> obj =
       context->Global()->Get(String::NewFromUtf8(isolate.GetIsolate(), "obj"));
-  Handle<Object>::Cast(obj)->SetHiddenValue(
-      String::NewFromUtf8(isolate.GetIsolate(), "foo"), Null());
+  Handle<Object>::Cast(obj)
+      ->SetHiddenValue(String::NewFromUtf8(isolate.GetIsolate(), "foo"),
+                       Null(isolate.GetIsolate()));
   CompileRun("");  // trigger delivery
   CHECK(CompileRun("records")->IsNull());
 }
index e484dd93047b7a996255bb240658440d165ff7b8..89a1e5b086c58a22833e4a4c13f532bd8e1453f1 100644 (file)
@@ -206,7 +206,8 @@ TEST(Preparsing) {
   {
     i::FLAG_lazy = true;
     ScriptResource* resource = new ScriptResource(source, source_length);
-    v8::Local<v8::String> script_source = v8::String::NewExternal(resource);
+    v8::Local<v8::String> script_source =
+        v8::String::NewExternal(isolate, resource);
     v8::Script::Compile(script_source, NULL, preparse);
   }
 
@@ -214,7 +215,8 @@ TEST(Preparsing) {
     i::FLAG_lazy = false;
 
     ScriptResource* resource = new ScriptResource(source, source_length);
-    v8::Local<v8::String> script_source = v8::String::NewExternal(resource);
+    v8::Local<v8::String> script_source =
+        v8::String::NewExternal(isolate, resource);
     v8::Script::New(script_source, NULL, preparse, v8::Local<v8::String>());
   }
   delete preparse;
index fd223c6e0994f3787c3f52cdd2c5e86c3fe326e5..54791e247a0dfddc354a5581b604c509ed694871 100644 (file)
@@ -541,7 +541,8 @@ TEST(NoSamples) {
 class ProfilerExtension : public v8::Extension {
  public:
   ProfilerExtension() : v8::Extension("v8/profiler", kSource) { }
-  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
+      v8::Isolate* isolate,
       v8::Handle<v8::String> name);
   static void StartProfiling(const v8::FunctionCallbackInfo<v8::Value>& args);
   static void StopProfiling(const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -554,13 +555,11 @@ const char* ProfilerExtension::kSource =
     "native function startProfiling();"
     "native function stopProfiling();";
 
-v8::Handle<v8::FunctionTemplate> ProfilerExtension::GetNativeFunction(
-    v8::Handle<v8::String> name) {
-  if (name->Equals(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(),
-                                           "startProfiling"))) {
+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);
-  } else if (name->Equals(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(),
-                                                  "stopProfiling"))) {
+  } else if (name->Equals(v8::String::NewFromUtf8(isolate, "stopProfiling"))) {
     return v8::FunctionTemplate::New(ProfilerExtension::StopProfiling);
   } else {
     CHECK(false);
index d0eabe30188729cdc574edd76c7a8212ec91c3d2..6f036338e880ac0125d5634ddc0e1fde9eacacb6 100644 (file)
@@ -943,9 +943,9 @@ TEST(ExternalShortStringAdd) {
 
   // Allocate two JavaScript arrays for holding short strings.
   v8::Handle<v8::Array> ascii_external_strings =
-      v8::Array::New(kMaxLength + 1);
+      v8::Array::New(CcTest::isolate(), kMaxLength + 1);
   v8::Handle<v8::Array> non_ascii_external_strings =
-      v8::Array::New(kMaxLength + 1);
+      v8::Array::New(CcTest::isolate(), kMaxLength + 1);
 
   // Generate short ascii and non-ascii external strings.
   for (int i = 0; i <= kMaxLength; i++) {
@@ -958,7 +958,7 @@ TEST(ExternalShortStringAdd) {
     AsciiResource* ascii_resource =
         new(&zone) AsciiResource(Vector<const char>(ascii, i));
     v8::Local<v8::String> ascii_external_string =
-        v8::String::NewExternal(ascii_resource);
+        v8::String::NewExternal(CcTest::isolate(), ascii_resource);
 
     ascii_external_strings->Set(v8::Integer::New(i), ascii_external_string);
     uc16* non_ascii = zone.NewArray<uc16>(i + 1);
@@ -969,7 +969,7 @@ TEST(ExternalShortStringAdd) {
     // string data.
     Resource* resource = new(&zone) Resource(Vector<const uc16>(non_ascii, i));
     v8::Local<v8::String> non_ascii_external_string =
-      v8::String::NewExternal(resource);
+      v8::String::NewExternal(CcTest::isolate(), resource);
     non_ascii_external_strings->Set(v8::Integer::New(i),
                                     non_ascii_external_string);
   }
index dc7dc75ece6a6e4137529d22e1a609110e40c542..daf07eed02e69e2fedcc238851de79ce6b0990be 100644 (file)
@@ -92,10 +92,12 @@ TEST(WeakArrayBuffersFromApi) {
   int start = CountArrayBuffersInWeakList(isolate->heap());
   {
     v8::HandleScope s1(context->GetIsolate());
-    v8::Handle<v8::ArrayBuffer> ab1 = v8::ArrayBuffer::New(256);
+    v8::Handle<v8::ArrayBuffer> ab1 =
+        v8::ArrayBuffer::New(context->GetIsolate(), 256);
     {
       v8::HandleScope s2(context->GetIsolate());
-      v8::Handle<v8::ArrayBuffer> ab2 = v8::ArrayBuffer::New(128);
+      v8::Handle<v8::ArrayBuffer> ab2 =
+          v8::ArrayBuffer::New(context->GetIsolate(), 128);
 
       Handle<JSArrayBuffer> iab1 = v8::Utils::OpenHandle(*ab1);
       Handle<JSArrayBuffer> iab2 = v8::Utils::OpenHandle(*ab2);
@@ -186,7 +188,8 @@ void TestViewFromApi() {
   Isolate* isolate = GetIsolateFrom(&context);
 
   v8::HandleScope s1(context->GetIsolate());
-  v8::Handle<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(2048);
+  v8::Handle<v8::ArrayBuffer> ab =
+      v8::ArrayBuffer::New(context->GetIsolate(), 2048);
   Handle<JSArrayBuffer> iab = v8::Utils::OpenHandle(*ab);
   {
     v8::HandleScope s2(context->GetIsolate());