Changeset 126348 in webkit
- Timestamp:
- Aug 22, 2012 2:14:11 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r126346 r126348 1 2012-08-22 Kentaro Hara <haraken@chromium.org> 2 3 [V8] Replace v8::String::NewSymbol() in CodeGeneratorV8.pm with v8String() 4 https://bugs.webkit.org/show_bug.cgi?id=94588 5 6 Reviewed by Eric Seidel. 7 8 v8String() is faster than String::NewSymbol(). 9 This patch implements v8String(char*, Isolate*) and 10 replaces String::NewSymbol(char*) in CodeGeneratorV8.pm 11 with v8String(char*, Isolate*). 12 13 Performance result: 14 15 // 272 nano sec 16 static v8::Handle<v8::Value> attr3AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) 17 { 18 v8::Handle<v8::Value> v1 = v8String(String("foo")); 19 v8::Handle<v8::Value> v2 = v8String(String("bar")); 20 if (!v1.IsEmpty() && !v2.IsEmpty()) 21 return v8Undefined(); 22 return v8::Null(); // Never reach. 23 } 24 25 // 377 nano sec 26 static v8::Handle<v8::Value> attr4AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) 27 { 28 v8::Handle<v8::Value> v1 = v8::String::NewSymbol("foo"); 29 v8::Handle<v8::Value> v2 = v8::String::NewSymbol("bar"); 30 if (!v1.IsEmpty() && !v2.IsEmpty()) 31 return v8Undefined(); 32 return v8::Null(); // Never reach. 33 } 34 35 No tests. No change in behavior. 36 37 * bindings/scripts/CodeGeneratorV8.pm: 38 (GenerateNormalAttrGetter): 39 (GenerateNormalAttrSetter): 40 (GenerateNamedConstructorCallback): 41 (GenerateNonStandardFunction): 42 (GenerateImplementation): 43 * bindings/scripts/test/V8/V8Float64Array.cpp: 44 (WebCore::ConfigureV8Float64ArrayTemplate): 45 * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: 46 (WebCore::ConfigureV8TestActiveDOMObjectTemplate): 47 * bindings/scripts/test/V8/V8TestEventTarget.cpp: 48 (WebCore::ConfigureV8TestEventTargetTemplate): 49 * bindings/scripts/test/V8/V8TestInterface.cpp: 50 (WebCore::ConfigureV8TestInterfaceTemplate): 51 * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: 52 (WebCore::V8TestNamedConstructorConstructor::GetTemplate): 53 * bindings/scripts/test/V8/V8TestObj.cpp: 54 (WebCore::ConfigureV8TestObjTemplate): 55 (WebCore::V8TestObj::installPerContextProperties): 56 * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: 57 (WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedValueAttrGetter): 58 (WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedValueAttrSetter): 59 (WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedReadonlyValueAttrGetter): 60 * bindings/v8/V8Binding.h: 61 (WebCore): 62 (WebCore::v8String): 63 * html/HTMLDivElement.idl: 64 1 65 2012-08-22 Pratik Solanki <psolanki@apple.com> 2 66 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r126237 r126348 905 905 if ($attribute->signature->type eq "SerializedScriptValue" && $attrExt->{"CachedAttribute"}) { 906 906 push(@implContentDecls, <<END); 907 v8::Handle<v8::String> propertyName = v8 ::String::NewSymbol("${attrName}");907 v8::Handle<v8::String> propertyName = v8String("${attrName}", info.GetIsolate()); 908 908 v8::Handle<v8::Value> value = info.Holder()->GetHiddenValue(propertyName); 909 909 if (!value.IsEmpty()) … … 1293 1293 if ($attribute->signature->type eq "SerializedScriptValue" && $attribute->signature->extendedAttributes->{"CachedAttribute"}) { 1294 1294 push(@implContentDecls, <<END); 1295 info.Holder()->DeleteHiddenValue(v8 ::String::NewSymbol("${attrName}")); // Invalidate the cached value.1295 info.Holder()->DeleteHiddenValue(v8String("${attrName}", info.GetIsolate())); // Invalidate the cached value. 1296 1296 END 1297 1297 } … … 2099 2099 v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate(); 2100 2100 instance->SetInternalFieldCount(V8${implClassName}::internalFieldCount); 2101 result->SetClassName(v8 ::String::NewSymbol("${implClassName}"));2101 result->SetClassName(v8String("${implClassName}")); 2102 2102 result->Inherit(V8${implClassName}::GetTemplate()); 2103 2103 … … 2299 2299 2300 2300 // $commentInfo 2301 ${conditional}$template->SetAccessor(v8 ::String::NewSymbol("$name"), ${interfaceName}V8Internal::${name}AttrGetter, ${interfaceName}V8Internal::${interfaceName}DomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes));2301 ${conditional}$template->SetAccessor(v8String("$name"), ${interfaceName}V8Internal::${name}AttrGetter, ${interfaceName}V8Internal::${interfaceName}DomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes)); 2302 2302 END 2303 2303 return; … … 2330 2330 push(@implContent, "#if ${conditionalString}\n") if $conditionalString; 2331 2331 2332 push(@implContent, " ${conditional}$template->Set(v8 ::String::NewSymbol(\"$name\"), v8::FunctionTemplate::New($callback, v8Undefined(), ${signature})$property_attributes);\n");2332 push(@implContent, " ${conditional}$template->Set(v8String(\"$name\"), v8::FunctionTemplate::New($callback, v8Undefined(), ${signature})$property_attributes);\n"); 2333 2333 2334 2334 push(@implContent, "#endif // ${conditionalString}\n") if $conditionalString; … … 2952 2952 // For security reasons, these functions are on the instance instead 2953 2953 // of on the prototype object to ensure that they cannot be overwritten. 2954 instance->SetAccessor(v8 ::String::NewSymbol("reload"), V8Location::reloadAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));2955 instance->SetAccessor(v8 ::String::NewSymbol("replace"), V8Location::replaceAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));2956 instance->SetAccessor(v8 ::String::NewSymbol("assign"), V8Location::assignAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));2954 instance->SetAccessor(v8String("reload"), V8Location::reloadAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)); 2955 instance->SetAccessor(v8String("replace"), V8Location::replaceAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)); 2956 instance->SetAccessor(v8String("assign"), V8Location::assignAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)); 2957 2957 END 2958 2958 } … … 3041 3041 my $callback = GetFunctionTemplateCallbackName($runtimeFunc, $interfaceName); 3042 3042 push(@implContent, <<END); 3043 proto->Set(v8 ::String::NewSymbol("${name}"), v8::FunctionTemplate::New(${callback}, v8Undefined(), defaultSignature)->GetFunction());3043 proto->Set(v8String("${name}"), v8::FunctionTemplate::New(${callback}, v8Undefined(), defaultSignature)->GetFunction()); 3044 3044 END 3045 3045 push(@implContent, " }\n"); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
r126237 r126348 108 108 v8::Handle<v8::FunctionTemplate> fooArgv[fooArgc] = { V8Float32Array::GetRawTemplate() }; 109 109 v8::Handle<v8::Signature> fooSignature = v8::Signature::New(desc, fooArgc, fooArgv); 110 proto->Set(v8 ::String::NewSymbol("foo"), v8::FunctionTemplate::New(Float64ArrayV8Internal::fooCallback, v8Undefined(), fooSignature));110 proto->Set(v8String("foo"), v8::FunctionTemplate::New(Float64ArrayV8Internal::fooCallback, v8Undefined(), fooSignature)); 111 111 112 112 // Custom toString template -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
r126237 r126348 135 135 v8::Handle<v8::FunctionTemplate> excitingFunctionArgv[excitingFunctionArgc] = { V8Node::GetRawTemplate() }; 136 136 v8::Handle<v8::Signature> excitingFunctionSignature = v8::Signature::New(desc, excitingFunctionArgc, excitingFunctionArgv); 137 proto->Set(v8 ::String::NewSymbol("excitingFunction"), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::excitingFunctionCallback, v8Undefined(), excitingFunctionSignature));137 proto->Set(v8String("excitingFunction"), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::excitingFunctionCallback, v8Undefined(), excitingFunctionSignature)); 138 138 139 139 // Function 'postMessage' (ExtAttr: 'DoNotCheckSecurity') 140 proto->SetAccessor(v8 ::String::NewSymbol("postMessage"), TestActiveDOMObjectV8Internal::postMessageAttrGetter, TestActiveDOMObjectV8Internal::TestActiveDOMObjectDomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));140 proto->SetAccessor(v8String("postMessage"), TestActiveDOMObjectV8Internal::postMessageAttrGetter, TestActiveDOMObjectV8Internal::TestActiveDOMObjectDomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete)); 141 141 142 142 // Custom toString template -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
r126237 r126348 132 132 v8::Handle<v8::FunctionTemplate> dispatchEventArgv[dispatchEventArgc] = { V8Event::GetRawTemplate() }; 133 133 v8::Handle<v8::Signature> dispatchEventSignature = v8::Signature::New(desc, dispatchEventArgc, dispatchEventArgv); 134 proto->Set(v8 ::String::NewSymbol("dispatchEvent"), v8::FunctionTemplate::New(TestEventTargetV8Internal::dispatchEventCallback, v8Undefined(), dispatchEventSignature));134 proto->Set(v8String("dispatchEvent"), v8::FunctionTemplate::New(TestEventTargetV8Internal::dispatchEventCallback, v8Undefined(), dispatchEventSignature)); 135 135 136 136 // Custom toString template -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
r126237 r126348 296 296 v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(desc, supplementalMethod2Argc, supplementalMethod2Argv); 297 297 #if ENABLE(Condition11) || ENABLE(Condition12) 298 proto->Set(v8 ::String::NewSymbol("supplementalMethod2"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod2Callback, v8Undefined(), supplementalMethod2Signature));299 #endif // ENABLE(Condition11) || ENABLE(Condition12) 300 #if ENABLE(Condition11) || ENABLE(Condition12) 301 desc->Set(v8 ::String::NewSymbol("supplementalMethod4"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod4Callback, v8Undefined(), v8::Local<v8::Signature>()));298 proto->Set(v8String("supplementalMethod2"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod2Callback, v8Undefined(), supplementalMethod2Signature)); 299 #endif // ENABLE(Condition11) || ENABLE(Condition12) 300 #if ENABLE(Condition11) || ENABLE(Condition12) 301 desc->Set(v8String("supplementalMethod4"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod4Callback, v8Undefined(), v8::Local<v8::Signature>())); 302 302 #endif // ENABLE(Condition11) || ENABLE(Condition12) 303 303 V8DOMConfiguration::batchConfigureConstants(desc, proto, TestInterfaceConsts, WTF_ARRAY_LENGTH(TestInterfaceConsts)); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
r126237 r126348 96 96 v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate(); 97 97 instance->SetInternalFieldCount(V8TestNamedConstructor::internalFieldCount); 98 result->SetClassName(v8 ::String::NewSymbol("TestNamedConstructor"));98 result->SetClassName(v8String("TestNamedConstructor")); 99 99 result->Inherit(V8TestNamedConstructor::GetTemplate()); 100 100 -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
r126237 r126348 2193 2193 v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() }; 2194 2194 v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(desc, voidMethodWithArgsArgc, voidMethodWithArgsArgv); 2195 proto->Set(v8 ::String::NewSymbol("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::voidMethodWithArgsCallback, v8Undefined(), voidMethodWithArgsSignature));2195 proto->Set(v8String("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::voidMethodWithArgsCallback, v8Undefined(), voidMethodWithArgsSignature)); 2196 2196 2197 2197 // Custom Signature 'MethodWithArgs' … … 2199 2199 v8::Handle<v8::FunctionTemplate> MethodWithArgsArgv[MethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() }; 2200 2200 v8::Handle<v8::Signature> MethodWithArgsSignature = v8::Signature::New(desc, MethodWithArgsArgc, MethodWithArgsArgv); 2201 proto->Set(v8 ::String::NewSymbol("MethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::MethodWithArgsCallback, v8Undefined(), MethodWithArgsSignature));2201 proto->Set(v8String("MethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::MethodWithArgsCallback, v8Undefined(), MethodWithArgsSignature)); 2202 2202 2203 2203 // Custom Signature 'objMethodWithArgs' … … 2205 2205 v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() }; 2206 2206 v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(desc, objMethodWithArgsArgc, objMethodWithArgsArgv); 2207 proto->Set(v8 ::String::NewSymbol("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::objMethodWithArgsCallback, v8Undefined(), objMethodWithArgsSignature));2207 proto->Set(v8String("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::objMethodWithArgsCallback, v8Undefined(), objMethodWithArgsSignature)); 2208 2208 2209 2209 // Custom Signature 'methodWithSequenceArg' … … 2211 2211 v8::Handle<v8::FunctionTemplate> methodWithSequenceArgArgv[methodWithSequenceArgArgc] = { V8sequence<ScriptProfile>::GetRawTemplate() }; 2212 2212 v8::Handle<v8::Signature> methodWithSequenceArgSignature = v8::Signature::New(desc, methodWithSequenceArgArgc, methodWithSequenceArgArgv); 2213 proto->Set(v8 ::String::NewSymbol("methodWithSequenceArg"), v8::FunctionTemplate::New(TestObjV8Internal::methodWithSequenceArgCallback, v8Undefined(), methodWithSequenceArgSignature));2213 proto->Set(v8String("methodWithSequenceArg"), v8::FunctionTemplate::New(TestObjV8Internal::methodWithSequenceArgCallback, v8Undefined(), methodWithSequenceArgSignature)); 2214 2214 2215 2215 // Custom Signature 'methodThatRequiresAllArgsAndThrows' … … 2217 2217 v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[methodThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() }; 2218 2218 v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresAllArgsAndThrowsArgv); 2219 proto->Set(v8 ::String::NewSymbol("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature));2220 desc->Set(v8 ::String::NewSymbol("classMethod"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodCallback, v8Undefined(), v8::Local<v8::Signature>()));2221 desc->Set(v8 ::String::NewSymbol("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodWithOptionalCallback, v8Undefined(), v8::Local<v8::Signature>()));2222 desc->Set(v8 ::String::NewSymbol("classMethod2"), v8::FunctionTemplate::New(V8TestObj::classMethod2Callback, v8Undefined(), v8::Local<v8::Signature>()));2219 proto->Set(v8String("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature)); 2220 desc->Set(v8String("classMethod"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodCallback, v8Undefined(), v8::Local<v8::Signature>())); 2221 desc->Set(v8String("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodWithOptionalCallback, v8Undefined(), v8::Local<v8::Signature>())); 2222 desc->Set(v8String("classMethod2"), v8::FunctionTemplate::New(V8TestObj::classMethod2Callback, v8Undefined(), v8::Local<v8::Signature>())); 2223 2223 #if ENABLE(Condition1) 2224 desc->Set(v8 ::String::NewSymbol("overloadedMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::overloadedMethod1Callback, v8Undefined(), v8::Local<v8::Signature>()));2224 desc->Set(v8String("overloadedMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::overloadedMethod1Callback, v8Undefined(), v8::Local<v8::Signature>())); 2225 2225 #endif // ENABLE(Condition1) 2226 2226 if (RuntimeEnabledFeatures::enabledAtRuntimeMethod1Enabled()) 2227 proto->Set(v8 ::String::NewSymbol("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod1Callback, v8Undefined(), defaultSignature));2227 proto->Set(v8String("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod1Callback, v8Undefined(), defaultSignature)); 2228 2228 if (RuntimeEnabledFeatures::featureNameEnabled()) 2229 proto->Set(v8 ::String::NewSymbol("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod2Callback, v8Undefined(), defaultSignature));2229 proto->Set(v8String("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod2Callback, v8Undefined(), defaultSignature)); 2230 2230 2231 2231 // Custom Signature 'convert1' … … 2233 2233 v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8a::GetRawTemplate() }; 2234 2234 v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, convert1Argc, convert1Argv); 2235 proto->Set(v8 ::String::NewSymbol("convert1"), v8::FunctionTemplate::New(TestObjV8Internal::convert1Callback, v8Undefined(), convert1Signature));2235 proto->Set(v8String("convert1"), v8::FunctionTemplate::New(TestObjV8Internal::convert1Callback, v8Undefined(), convert1Signature)); 2236 2236 2237 2237 // Custom Signature 'convert2' … … 2239 2239 v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8b::GetRawTemplate() }; 2240 2240 v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, convert2Argc, convert2Argv); 2241 proto->Set(v8 ::String::NewSymbol("convert2"), v8::FunctionTemplate::New(TestObjV8Internal::convert2Callback, v8Undefined(), convert2Signature));2241 proto->Set(v8String("convert2"), v8::FunctionTemplate::New(TestObjV8Internal::convert2Callback, v8Undefined(), convert2Signature)); 2242 2242 2243 2243 // Custom Signature 'convert4' … … 2245 2245 v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8d::GetRawTemplate() }; 2246 2246 v8::Handle<v8::Signature> convert4Signature = v8::Signature::New(desc, convert4Argc, convert4Argv); 2247 proto->Set(v8 ::String::NewSymbol("convert4"), v8::FunctionTemplate::New(TestObjV8Internal::convert4Callback, v8Undefined(), convert4Signature));2247 proto->Set(v8String("convert4"), v8::FunctionTemplate::New(TestObjV8Internal::convert4Callback, v8Undefined(), convert4Signature)); 2248 2248 2249 2249 // Custom Signature 'convert5' … … 2251 2251 v8::Handle<v8::FunctionTemplate> convert5Argv[convert5Argc] = { V8e::GetRawTemplate() }; 2252 2252 v8::Handle<v8::Signature> convert5Signature = v8::Signature::New(desc, convert5Argc, convert5Argv); 2253 proto->Set(v8 ::String::NewSymbol("convert5"), v8::FunctionTemplate::New(TestObjV8Internal::convert5Callback, v8Undefined(), convert5Signature));2253 proto->Set(v8String("convert5"), v8::FunctionTemplate::New(TestObjV8Internal::convert5Callback, v8Undefined(), convert5Signature)); 2254 2254 V8DOMConfiguration::batchConfigureConstants(desc, proto, TestObjConsts, WTF_ARRAY_LENGTH(TestObjConsts)); 2255 2255 … … 2311 2311 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. 2312 2312 if (ContextFeatures::enabledPerContextMethod1Enabled(impl->document())) { 2313 proto->Set(v8 ::String::NewSymbol("enabledPerContextMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod1Callback, v8Undefined(), defaultSignature)->GetFunction());2313 proto->Set(v8String("enabledPerContextMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod1Callback, v8Undefined(), defaultSignature)->GetFunction()); 2314 2314 } 2315 2315 if (ContextFeatures::featureNameEnabled(impl->document())) { 2316 proto->Set(v8 ::String::NewSymbol("enabledPerContextMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod2Callback, v8Undefined(), defaultSignature)->GetFunction());2316 proto->Set(v8String("enabledPerContextMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod2Callback, v8Undefined(), defaultSignature)->GetFunction()); 2317 2317 } 2318 2318 } -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
r126237 r126348 72 72 { 73 73 INC_STATS("DOM.TestSerializedScriptValueInterface.cachedValue._get"); 74 v8::Handle<v8::String> propertyName = v8 ::String::NewSymbol("cachedValue");74 v8::Handle<v8::String> propertyName = v8String("cachedValue", info.GetIsolate()); 75 75 v8::Handle<v8::Value> value = info.Holder()->GetHiddenValue(propertyName); 76 76 if (!value.IsEmpty()) … … 89 89 RefPtr<SerializedScriptValue> v = SerializedScriptValue::create(value, info.GetIsolate()); 90 90 imp->setCachedValue(WTF::getPtr(v)); 91 info.Holder()->DeleteHiddenValue(v8 ::String::NewSymbol("cachedValue")); // Invalidate the cached value.91 info.Holder()->DeleteHiddenValue(v8String("cachedValue", info.GetIsolate())); // Invalidate the cached value. 92 92 return; 93 93 } … … 110 110 { 111 111 INC_STATS("DOM.TestSerializedScriptValueInterface.cachedReadonlyValue._get"); 112 v8::Handle<v8::String> propertyName = v8 ::String::NewSymbol("cachedReadonlyValue");112 v8::Handle<v8::String> propertyName = v8String("cachedReadonlyValue", info.GetIsolate()); 113 113 v8::Handle<v8::Value> value = info.Holder()->GetHiddenValue(propertyName); 114 114 if (!value.IsEmpty()) -
trunk/Source/WebCore/bindings/v8/V8Binding.h
r126262 r126348 99 99 } 100 100 101 // Convert a string to a V8 string.101 // Convert a WebCore String to a V8 string. 102 102 inline v8::Handle<v8::String> v8String(const String& string, v8::Isolate* isolate = 0) 103 103 { 104 104 return v8ExternalString(string, isolate); 105 } 106 107 // Convert a char* string to a V8 string. 108 inline v8::Handle<v8::String> v8String(const char* string, v8::Isolate* isolate = 0) 109 { 110 return v8ExternalString(String(string), isolate); 105 111 } 106 112
Note: See TracChangeset
for help on using the changeset viewer.