[V8] Pass Isolate to toV8() (Part1)
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Apr 2012 18:18:20 +0000 (18:18 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Apr 2012 18:18:20 +0000 (18:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=84250

Reviewed by Nate Chapin.

The final objective is to pass Isolate around in V8 bindings.
This patch makes a change in CodeGeneratorV8.pm so that the
generated code passes Isolate to toV8().

No tests. No change in behavior.

* bindings/scripts/CodeGeneratorV8.pm: Modified as described above.
(GenerateNormalAttrGetter):
(GenerateNamedConstructorCallback):
(GenerateCallbackImplementation):
(GenerateFunctionCallString):
(NativeToJSValue):

* bindings/scripts/test/V8/V8Float64Array.cpp: Updated run-bindings-tests results.
(WebCore::Float64ArrayV8Internal::fooCallback):
* bindings/scripts/test/V8/V8TestCallback.cpp:
(WebCore::V8TestCallback::callbackWithClass1Param):
(WebCore::V8TestCallback::callbackWithClass2Param):
(WebCore::V8TestCallback::callbackWithStringList):
(WebCore::V8TestCallback::callbackRequiresThisToPass):
* bindings/scripts/test/V8/V8TestInterface.cpp:
(WebCore::TestInterfaceV8Internal::supplementalMethod2Callback):
* bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
(WebCore::V8TestNamedConstructorConstructorCallback):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjV8Internal::readOnlyTestObjAttrAttrGetter):
(WebCore::TestObjV8Internal::testObjAttrAttrGetter):
(WebCore::TestObjV8Internal::XMLObjAttrAttrGetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAttributeAttrGetter):
(WebCore::TestObjV8Internal::withScriptStateAttributeRaisesAttrGetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAttributeRaisesAttrGetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeAttrGetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrGetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrGetter):
(WebCore::TestObjV8Internal::withScriptArgumentsAndCallStackAttributeAttrGetter):
(WebCore::TestObjV8Internal::cachedAttribute1AttrGetter):
(WebCore::TestObjV8Internal::cachedAttribute2AttrGetter):
(WebCore::TestObjV8Internal::mutablePointAttrGetter):
(WebCore::TestObjV8Internal::immutablePointAttrGetter):
(WebCore::TestObjV8Internal::objMethodCallback):
(WebCore::TestObjV8Internal::objMethodWithArgsCallback):
(WebCore::TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback):
(WebCore::TestObjV8Internal::withScriptStateObjCallback):
(WebCore::TestObjV8Internal::withScriptStateObjExceptionCallback):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateObjExceptionCallback):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesCallback):
(WebCore::TestObjV8Internal::mutablePointFunctionCallback):
(WebCore::TestObjV8Internal::immutablePointFunctionCallback):
(WebCore::TestObjV8Internal::strictFunctionCallback):
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
(WebCore::TestSerializedScriptValueInterfaceV8Internal::portsAttrGetter):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114920 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp

index 41aa208..995ee7e 100644 (file)
@@ -1,5 +1,64 @@
 2012-04-23  Kentaro Hara  <haraken@chromium.org>
 
+        [V8] Pass Isolate to toV8() (Part1)
+        https://bugs.webkit.org/show_bug.cgi?id=84250
+
+        Reviewed by Nate Chapin.
+
+        The final objective is to pass Isolate around in V8 bindings.
+        This patch makes a change in CodeGeneratorV8.pm so that the
+        generated code passes Isolate to toV8().
+
+        No tests. No change in behavior.
+
+        * bindings/scripts/CodeGeneratorV8.pm: Modified as described above.
+        (GenerateNormalAttrGetter):
+        (GenerateNamedConstructorCallback):
+        (GenerateCallbackImplementation):
+        (GenerateFunctionCallString):
+        (NativeToJSValue):
+
+        * bindings/scripts/test/V8/V8Float64Array.cpp: Updated run-bindings-tests results.
+        (WebCore::Float64ArrayV8Internal::fooCallback):
+        * bindings/scripts/test/V8/V8TestCallback.cpp:
+        (WebCore::V8TestCallback::callbackWithClass1Param):
+        (WebCore::V8TestCallback::callbackWithClass2Param):
+        (WebCore::V8TestCallback::callbackWithStringList):
+        (WebCore::V8TestCallback::callbackRequiresThisToPass):
+        * bindings/scripts/test/V8/V8TestInterface.cpp:
+        (WebCore::TestInterfaceV8Internal::supplementalMethod2Callback):
+        * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
+        (WebCore::V8TestNamedConstructorConstructorCallback):
+        * bindings/scripts/test/V8/V8TestObj.cpp:
+        (WebCore::TestObjV8Internal::readOnlyTestObjAttrAttrGetter):
+        (WebCore::TestObjV8Internal::testObjAttrAttrGetter):
+        (WebCore::TestObjV8Internal::XMLObjAttrAttrGetter):
+        (WebCore::TestObjV8Internal::withScriptExecutionContextAttributeAttrGetter):
+        (WebCore::TestObjV8Internal::withScriptStateAttributeRaisesAttrGetter):
+        (WebCore::TestObjV8Internal::withScriptExecutionContextAttributeRaisesAttrGetter):
+        (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeAttrGetter):
+        (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrGetter):
+        (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrGetter):
+        (WebCore::TestObjV8Internal::withScriptArgumentsAndCallStackAttributeAttrGetter):
+        (WebCore::TestObjV8Internal::cachedAttribute1AttrGetter):
+        (WebCore::TestObjV8Internal::cachedAttribute2AttrGetter):
+        (WebCore::TestObjV8Internal::mutablePointAttrGetter):
+        (WebCore::TestObjV8Internal::immutablePointAttrGetter):
+        (WebCore::TestObjV8Internal::objMethodCallback):
+        (WebCore::TestObjV8Internal::objMethodWithArgsCallback):
+        (WebCore::TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback):
+        (WebCore::TestObjV8Internal::withScriptStateObjCallback):
+        (WebCore::TestObjV8Internal::withScriptStateObjExceptionCallback):
+        (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateObjExceptionCallback):
+        (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesCallback):
+        (WebCore::TestObjV8Internal::mutablePointFunctionCallback):
+        (WebCore::TestObjV8Internal::immutablePointFunctionCallback):
+        (WebCore::TestObjV8Internal::strictFunctionCallback):
+        * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
+        (WebCore::TestSerializedScriptValueInterfaceV8Internal::portsAttrGetter):
+
+2012-04-23  Kentaro Hara  <haraken@chromium.org>
+
         [V8] Add an optional Isolate argument to setDOMException() and throwError()
         https://bugs.webkit.org/show_bug.cgi?id=84310
 
index b121e99..68bd2a7 100644 (file)
@@ -931,7 +931,7 @@ END
         my $domMapFunction = GetDomMapFunction($dataNode, $interfaceName);
         push(@implContentDecls, "    v8::Handle<v8::Value> wrapper = result.get() ? ${domMapFunction}.get(result.get()) : v8::Handle<v8::Object>();\n");
         push(@implContentDecls, "    if (wrapper.IsEmpty()) {\n");
-        push(@implContentDecls, "        wrapper = toV8(result.get());\n");
+        push(@implContentDecls, "        wrapper = toV8(result.get(), info.GetIsolate());\n");
         push(@implContentDecls, "        if (!wrapper.IsEmpty())\n");
         if ($dataNode->name eq "DOMWindow") {
             push(@implContentDecls, "            V8DOMWrapper::setNamedHiddenWindowReference(imp->frame(), \"${attrName}\", wrapper);\n");
@@ -949,7 +949,7 @@ END
         AddToImplIncludes("V8$attrType.h");
         my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType);
         # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked.
-        push(@implContentDecls, "    return toV8(static_cast<$svgNativeType*>($result));\n");
+        push(@implContentDecls, "    return toV8(static_cast<$svgNativeType*>($result), info.GetIsolate());\n");
     } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($attrType) and not $implClassName =~ /List$/) {
         AddToImplIncludes("V8$attrType.h");
         AddToImplIncludes("SVGPropertyTearOff.h");
@@ -972,19 +972,19 @@ END
                     $result =~ s/matrix/svgMatrix/;
                 }
 
-                push(@implContentDecls, "    return toV8(WTF::getPtr(${tearOffType}::create(wrapper, $result, $updateMethod)));\n");
+                push(@implContentDecls, "    return toV8(WTF::getPtr(${tearOffType}::create(wrapper, $result, $updateMethod)), info.GetIsolate());\n");
             } else {
                 AddToImplIncludes("SVGStaticPropertyTearOff.h");
                 $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$implClassName, /;
 
-                push(@implContentDecls, "    return toV8(WTF::getPtr(${tearOffType}::create(imp, $result, $updateMethod)));\n");
+                push(@implContentDecls, "    return toV8(WTF::getPtr(${tearOffType}::create(imp, $result, $updateMethod)), info.GetIsolate());\n");
             }
         } elsif ($tearOffType =~ /SVGStaticListPropertyTearOff/) {
-            push(@implContentDecls, "    return toV8(WTF::getPtr(${tearOffType}::create(imp, $result)));\n");
+            push(@implContentDecls, "    return toV8(WTF::getPtr(${tearOffType}::create(imp, $result)), info.GetIsolate());\n");
         } elsif ($tearOffType =~ /SVG(Point|PathSeg)List/) {
-            push(@implContentDecls, "    return toV8(WTF::getPtr($result));\n");
+            push(@implContentDecls, "    return toV8(WTF::getPtr($result), info.GetIsolate());\n");
         } else {
-            push(@implContentDecls, "    return toV8(WTF::getPtr(${tearOffType}::create($result)));\n");
+            push(@implContentDecls, "    return toV8(WTF::getPtr(${tearOffType}::create($result)), info.GetIsolate());\n");
         }
     } elsif ($attribute->signature->type eq "MessagePortArray") {
         AddToImplIncludes("V8Array.h");
@@ -997,7 +997,7 @@ END
     MessagePortArray portsCopy(*ports);
     v8::Local<v8::Array> portArray = v8::Array::New(portsCopy.size());
     for (size_t i = 0; i < portsCopy.size(); ++i)
-        portArray->Set(v8::Integer::New(i), toV8(portsCopy[i].get()));
+        portArray->Set(v8::Integer::New(i), toV8(portsCopy[i].get(), info.GetIsolate()));
     return portArray;
 END
     } else {
@@ -1899,7 +1899,7 @@ static v8::Handle<v8::Value> V8${implClassName}ConstructorCallback(const v8::Arg
 
     // Make sure the document is added to the DOM Node map. Otherwise, the ${implClassName} instance
     // may end up being the only node in the map and get garbage-collected prematurely.
-    toV8(document);
+    toV8(document, args.GetIsolate());
 
 END
 
@@ -3063,7 +3063,7 @@ END
             @args = ();
             foreach my $param (@params) {
                 my $paramName = $param->name;
-                push(@implContent, "    v8::Handle<v8::Value> ${paramName}Handle = " . NativeToJSValue($param, $paramName) . ";\n");
+                push(@implContent, "    v8::Handle<v8::Value> ${paramName}Handle = " . NativeToJSValue($param, $paramName, "0") . ";\n");
                 push(@implContent, "    if (${paramName}Handle.IsEmpty()) {\n");
                 push(@implContent, "        if (!isScriptControllerTerminating())\n");
                 push(@implContent, "            CRASH();\n");
@@ -3333,7 +3333,7 @@ sub GenerateFunctionCallString()
         AddToImplIncludes("V8$returnType.h");
         AddToImplIncludes("SVGPropertyTearOff.h");
         my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($returnType);
-        $result .= $indent . "return toV8(WTF::getPtr(${svgNativeType}::create($return)));\n";
+        $result .= $indent . "return toV8(WTF::getPtr(${svgNativeType}::create($return)), args.GetIsolate());\n";
         return $result;
     }
 
@@ -3791,15 +3791,14 @@ sub NativeToJSValue
 
     if ($codeGenerator->IsStringType($type)) {
         my $conv = $signature->extendedAttributes->{"TreatReturnedNullStringAs"};
-        my $getIsolateArgument = $getIsolate ? ", $getIsolate" : "";
         if (defined $conv) {
-            return "v8StringOrNull($value$getIsolateArgument)" if $conv eq "Null";
-            return "v8StringOrUndefined($value$getIsolateArgument)" if $conv eq "Undefined";
-            return "v8StringOrFalse($value$getIsolateArgument)" if $conv eq "False";
+            return "v8StringOrNull($value, $getIsolate)" if $conv eq "Null";
+            return "v8StringOrUndefined($value, $getIsolate)" if $conv eq "Undefined";
+            return "v8StringOrFalse($value, $getIsolate)" if $conv eq "False";
 
             die "Unknown value for TreatReturnedNullStringAs extended attribute";
         }
-        return "v8String($value$getIsolateArgument)";
+        return "v8String($value, $getIsolate)";
     }
 
     my $arrayType = $codeGenerator->GetArrayType($type);
@@ -3815,7 +3814,7 @@ sub NativeToJSValue
 
     # special case for non-DOM node interfaces
     if (IsDOMNodeType($type)) {
-        return "toV8(${value}" . ($signature->extendedAttributes->{"ReturnNewObject"} ? ", 0, true)" : ")");
+        return "toV8(${value}" . ($signature->extendedAttributes->{"ReturnNewObject"} ? ", $getIsolate, true)" : ")");
     }
 
     if ($type eq "EventTarget") {
@@ -3836,7 +3835,7 @@ sub NativeToJSValue
     AddToImplIncludes("wtf/RefPtr.h");
     AddToImplIncludes("wtf/GetPtr.h");
 
-    return "toV8($value)";
+    return "toV8($value, $getIsolate)";
 }
 
 sub ReturnNativeToJSValue
index 0e6028d..252cc3c 100644 (file)
@@ -55,7 +55,7 @@ static v8::Handle<v8::Value> fooCallback(const v8::Arguments& args)
         return throwError("Not enough arguments", V8Proxy::TypeError);
     Float64Array* imp = V8Float64Array::toNative(args.Holder());
     EXCEPTION_BLOCK(Float32Array*, array, V8Float32Array::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8Float32Array::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
-    return toV8(imp->foo(array));
+    return toV8(imp->foo(array), args.GetIsolate());
 }
 
 } // namespace Float64ArrayV8Internal
index 6afa830..628d5a8 100644 (file)
@@ -87,7 +87,7 @@ bool V8TestCallback::callbackWithClass1Param(Class1* class1Param)
 
     v8::Context::Scope scope(v8Context);
 
-    v8::Handle<v8::Value> class1ParamHandle = toV8(class1Param);
+    v8::Handle<v8::Value> class1ParamHandle = toV8(class1Param, 0);
     if (class1ParamHandle.IsEmpty()) {
         if (!isScriptControllerTerminating())
             CRASH();
@@ -115,13 +115,13 @@ bool V8TestCallback::callbackWithClass2Param(Class2* class2Param, const String&
 
     v8::Context::Scope scope(v8Context);
 
-    v8::Handle<v8::Value> class2ParamHandle = toV8(class2Param);
+    v8::Handle<v8::Value> class2ParamHandle = toV8(class2Param, 0);
     if (class2ParamHandle.IsEmpty()) {
         if (!isScriptControllerTerminating())
             CRASH();
         return true;
     }
-    v8::Handle<v8::Value> strArgHandle = v8String(strArg);
+    v8::Handle<v8::Value> strArgHandle = v8String(strArg, 0);
     if (strArgHandle.IsEmpty()) {
         if (!isScriptControllerTerminating())
             CRASH();
@@ -150,7 +150,7 @@ bool V8TestCallback::callbackWithStringList(RefPtr<DOMStringList> listParam)
 
     v8::Context::Scope scope(v8Context);
 
-    v8::Handle<v8::Value> listParamHandle = toV8(listParam);
+    v8::Handle<v8::Value> listParamHandle = toV8(listParam, 0);
     if (listParamHandle.IsEmpty()) {
         if (!isScriptControllerTerminating())
             CRASH();
@@ -208,13 +208,13 @@ bool V8TestCallback::callbackRequiresThisToPass(Class8* class8Param, ThisClass*
 
     v8::Context::Scope scope(v8Context);
 
-    v8::Handle<v8::Value> class8ParamHandle = toV8(class8Param);
+    v8::Handle<v8::Value> class8ParamHandle = toV8(class8Param, 0);
     if (class8ParamHandle.IsEmpty()) {
         if (!isScriptControllerTerminating())
             CRASH();
         return true;
     }
-    v8::Handle<v8::Value> thisClassParamHandle = toV8(thisClassParam);
+    v8::Handle<v8::Value> thisClassParamHandle = toV8(thisClassParam, 0);
     if (thisClassParamHandle.IsEmpty()) {
         if (!isScriptControllerTerminating())
             CRASH();
index c4182c7..1b0bf83 100644 (file)
@@ -136,7 +136,7 @@ static v8::Handle<v8::Value> supplementalMethod2Callback(const v8::Arguments& ar
     RefPtr<TestObj> result = TestSupplemental::supplementalMethod2(imp, scriptContext, strArg, objArg, ec);
     if (UNLIKELY(ec))
         goto fail;
-    return toV8(result.release());
+    return toV8(result.release(), args.GetIsolate());
     }
     fail:
     V8Proxy::setDOMException(ec);
index 8e578a0..2694707 100644 (file)
@@ -61,7 +61,7 @@ static v8::Handle<v8::Value> V8TestNamedConstructorConstructorCallback(const v8:
 
     // Make sure the document is added to the DOM Node map. Otherwise, the TestNamedConstructor instance
     // may end up being the only node in the map and get garbage-collected prematurely.
-    toV8(document);
+    toV8(document, args.GetIsolate());
 
     if (args.Length() < 1)
         return throwError("Not enough arguments", V8Proxy::TypeError);
index f919d4f..fa3caee 100644 (file)
@@ -100,7 +100,7 @@ static v8::Handle<v8::Value> readOnlyTestObjAttrAttrGetter(v8::Local<v8::String>
     RefPtr<TestObj> result = imp->readOnlyTestObjAttr();
     v8::Handle<v8::Value> wrapper = result.get() ? getDOMObjectMap().get(result.get()) : v8::Handle<v8::Object>();
     if (wrapper.IsEmpty()) {
-        wrapper = toV8(result.get());
+        wrapper = toV8(result.get(), info.GetIsolate());
         if (!wrapper.IsEmpty())
             V8DOMWrapper::setNamedHiddenReference(info.Holder(), "readOnlyTestObjAttr", wrapper);
     }
@@ -207,7 +207,7 @@ static v8::Handle<v8::Value> testObjAttrAttrGetter(v8::Local<v8::String> name, c
 {
     INC_STATS("DOM.TestObj.testObjAttr._get");
     TestObj* imp = V8TestObj::toNative(info.Holder());
-    return toV8(imp->testObjAttr());
+    return toV8(imp->testObjAttr(), info.GetIsolate());
 }
 
 static void testObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
@@ -447,7 +447,7 @@ static v8::Handle<v8::Value> XMLObjAttrAttrGetter(v8::Local<v8::String> name, co
 {
     INC_STATS("DOM.TestObj.XMLObjAttr._get");
     TestObj* imp = V8TestObj::toNative(info.Holder());
-    return toV8(imp->xmlObjAttr());
+    return toV8(imp->xmlObjAttr(), info.GetIsolate());
 }
 
 static void XMLObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
@@ -738,7 +738,7 @@ static v8::Handle<v8::Value> withScriptExecutionContextAttributeAttrGetter(v8::L
     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
     if (!scriptContext)
         return v8::Undefined();
-    return toV8(imp->withScriptExecutionContextAttribute(scriptContext));
+    return toV8(imp->withScriptExecutionContextAttribute(scriptContext), info.GetIsolate());
 }
 
 static void withScriptExecutionContextAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
@@ -768,7 +768,7 @@ static v8::Handle<v8::Value> withScriptStateAttributeRaisesAttrGetter(v8::Local<
     }
     if (state.hadException())
         return throwError(state.exception());
-    return toV8(v.release());
+    return toV8(v.release(), info.GetIsolate());
 }
 
 static void withScriptStateAttributeRaisesAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
@@ -801,7 +801,7 @@ static v8::Handle<v8::Value> withScriptExecutionContextAttributeRaisesAttrGetter
         V8Proxy::setDOMException(ec);
         return v8::Handle<v8::Value>();
     }
-    return toV8(v.release());
+    return toV8(v.release(), info.GetIsolate());
 }
 
 static void withScriptExecutionContextAttributeRaisesAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
@@ -829,7 +829,7 @@ static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeAt
     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
     if (!scriptContext)
         return v8::Undefined();
-    return toV8(imp->withScriptExecutionContextAndScriptStateAttribute(state, scriptContext));
+    return toV8(imp->withScriptExecutionContextAndScriptStateAttribute(state, scriptContext), info.GetIsolate());
 }
 
 static void withScriptExecutionContextAndScriptStateAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
@@ -867,7 +867,7 @@ static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeRa
     }
     if (state.hadException())
         return throwError(state.exception());
-    return toV8(v.release());
+    return toV8(v.release(), info.GetIsolate());
 }
 
 static void withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
@@ -900,7 +900,7 @@ static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesA
     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
     if (!scriptContext)
         return v8::Undefined();
-    return toV8(imp->withScriptExecutionContextAndScriptStateWithSpacesAttribute(state, scriptContext));
+    return toV8(imp->withScriptExecutionContextAndScriptStateWithSpacesAttribute(state, scriptContext), info.GetIsolate());
 }
 
 static void withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
@@ -927,7 +927,7 @@ static v8::Handle<v8::Value> withScriptArgumentsAndCallStackAttributeAttrGetter(
     RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector());
     if (!callStack)
         return v8::Undefined();
-    return toV8(imp->withScriptArgumentsAndCallStackAttribute(callStack));
+    return toV8(imp->withScriptArgumentsAndCallStackAttribute(callStack), info.GetIsolate());
 }
 
 static void withScriptArgumentsAndCallStackAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
@@ -1021,7 +1021,7 @@ static v8::Handle<v8::Value> cachedAttribute1AttrGetter(v8::Local<v8::String> na
     RefPtr<any> result = imp->cachedAttribute1();
     v8::Handle<v8::Value> wrapper = result.get() ? getDOMObjectMap().get(result.get()) : v8::Handle<v8::Object>();
     if (wrapper.IsEmpty()) {
-        wrapper = toV8(result.get());
+        wrapper = toV8(result.get(), info.GetIsolate());
         if (!wrapper.IsEmpty())
             V8DOMWrapper::setNamedHiddenReference(info.Holder(), "cachedAttribute1", wrapper);
     }
@@ -1035,7 +1035,7 @@ static v8::Handle<v8::Value> cachedAttribute2AttrGetter(v8::Local<v8::String> na
     RefPtr<any> result = imp->cachedAttribute2();
     v8::Handle<v8::Value> wrapper = result.get() ? getDOMObjectMap().get(result.get()) : v8::Handle<v8::Object>();
     if (wrapper.IsEmpty()) {
-        wrapper = toV8(result.get());
+        wrapper = toV8(result.get(), info.GetIsolate());
         if (!wrapper.IsEmpty())
             V8DOMWrapper::setNamedHiddenReference(info.Holder(), "cachedAttribute2", wrapper);
     }
@@ -1120,7 +1120,7 @@ static v8::Handle<v8::Value> mutablePointAttrGetter(v8::Local<v8::String> name,
 {
     INC_STATS("DOM.TestObj.mutablePoint._get");
     TestObj* imp = V8TestObj::toNative(info.Holder());
-    return toV8(WTF::getPtr(SVGStaticPropertyTearOff<TestObj, FloatPoint>::create(imp, imp->mutablePoint(), &TestObj::updateMutablePoint)));
+    return toV8(WTF::getPtr(SVGStaticPropertyTearOff<TestObj, FloatPoint>::create(imp, imp->mutablePoint(), &TestObj::updateMutablePoint)), info.GetIsolate());
 }
 
 static void mutablePointAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
@@ -1136,7 +1136,7 @@ static v8::Handle<v8::Value> immutablePointAttrGetter(v8::Local<v8::String> name
 {
     INC_STATS("DOM.TestObj.immutablePoint._get");
     TestObj* imp = V8TestObj::toNative(info.Holder());
-    return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immutablePoint())));
+    return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immutablePoint())), info.GetIsolate());
 }
 
 static void immutablePointAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
@@ -1262,7 +1262,7 @@ static v8::Handle<v8::Value> objMethodCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.TestObj.objMethod");
     TestObj* imp = V8TestObj::toNative(args.Holder());
-    return toV8(imp->objMethod());
+    return toV8(imp->objMethod(), args.GetIsolate());
 }
 
 static v8::Handle<v8::Value> objMethodWithArgsCallback(const v8::Arguments& args)
@@ -1274,7 +1274,7 @@ static v8::Handle<v8::Value> objMethodWithArgsCallback(const v8::Arguments& args
     EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
     EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined)) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined))) : 0);
-    return toV8(imp->objMethodWithArgs(intArg, strArg, objArg));
+    return toV8(imp->objMethodWithArgs(intArg, strArg, objArg), args.GetIsolate());
 }
 
 static v8::Handle<v8::Value> methodWithSequenceArgCallback(const v8::Arguments& args)
@@ -1311,7 +1311,7 @@ static v8::Handle<v8::Value> methodThatRequiresAllArgsAndThrowsCallback(const v8
     RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, objArg, ec);
     if (UNLIKELY(ec))
         goto fail;
-    return toV8(result.release());
+    return toV8(result.release(), args.GetIsolate());
     }
     fail:
     V8Proxy::setDOMException(ec);
@@ -1422,7 +1422,7 @@ static v8::Handle<v8::Value> withScriptStateObjCallback(const v8::Arguments& arg
     RefPtr<TestObj> result = imp->withScriptStateObj(&state);
     if (state.hadException())
         return throwError(state.exception());
-    return toV8(result.release());
+    return toV8(result.release(), args.GetIsolate());
 }
 
 static v8::Handle<v8::Value> withScriptStateVoidExceptionCallback(const v8::Arguments& args)
@@ -1456,7 +1456,7 @@ static v8::Handle<v8::Value> withScriptStateObjExceptionCallback(const v8::Argum
         goto fail;
     if (state.hadException())
         return throwError(state.exception());
-    return toV8(result.release());
+    return toV8(result.release(), args.GetIsolate());
     }
     fail:
     V8Proxy::setDOMException(ec);
@@ -1503,7 +1503,7 @@ static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateObjExceptio
         goto fail;
     if (state.hadException())
         return throwError(state.exception());
-    return toV8(result.release());
+    return toV8(result.release(), args.GetIsolate());
     }
     fail:
     V8Proxy::setDOMException(ec);
@@ -1521,7 +1521,7 @@ static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesC
     RefPtr<TestObj> result = imp->withScriptExecutionContextAndScriptStateWithSpaces(&state, scriptContext);
     if (state.hadException())
         return throwError(state.exception());
-    return toV8(result.release());
+    return toV8(result.release(), args.GetIsolate());
 }
 
 static v8::Handle<v8::Value> withScriptArgumentsAndCallStackCallback(const v8::Arguments& args)
@@ -1958,14 +1958,14 @@ static v8::Handle<v8::Value> mutablePointFunctionCallback(const v8::Arguments& a
 {
     INC_STATS("DOM.TestObj.mutablePointFunction");
     TestObj* imp = V8TestObj::toNative(args.Holder());
-    return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->mutablePointFunction())));
+    return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->mutablePointFunction())), args.GetIsolate());
 }
 
 static v8::Handle<v8::Value> immutablePointFunctionCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.TestObj.immutablePointFunction");
     TestObj* imp = V8TestObj::toNative(args.Holder());
-    return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immutablePointFunction())));
+    return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immutablePointFunction())), args.GetIsolate());
 }
 
 static v8::Handle<v8::Value> orangeCallback(const v8::Arguments& args)
@@ -1990,7 +1990,7 @@ static v8::Handle<v8::Value> strictFunctionCallback(const v8::Arguments& args)
     RefPtr<bool> result = imp->strictFunction(str, a, b, ec);
     if (UNLIKELY(ec))
         goto fail;
-    return toV8(result.release());
+    return toV8(result.release(), args.GetIsolate());
     }
     fail:
     V8Proxy::setDOMException(ec);
index bbd939d..f1f3b48 100644 (file)
@@ -102,7 +102,7 @@ static v8::Handle<v8::Value> portsAttrGetter(v8::Local<v8::String> name, const v
     MessagePortArray portsCopy(*ports);
     v8::Local<v8::Array> portArray = v8::Array::New(portsCopy.size());
     for (size_t i = 0; i < portsCopy.size(); ++i)
-        portArray->Set(v8::Integer::New(i), toV8(portsCopy[i].get()));
+        portArray->Set(v8::Integer::New(i), toV8(portsCopy[i].get(), info.GetIsolate()));
     return portArray;
 }