Diff
Modified: trunk/Source/WebCore/ChangeLog (121540 => 121541)
--- trunk/Source/WebCore/ChangeLog 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/ChangeLog 2012-06-29 09:50:26 UTC (rev 121541)
@@ -1,5 +1,61 @@
2012-06-29 Kentaro Hara <[email protected]>
+ [V8] Replace v8::Integer::New() with v8Integer() in custom bindings
+ https://bugs.webkit.org/show_bug.cgi?id=90242
+
+ Reviewed by Yury Semikhatsky.
+
+ v8Integer() is a fast wrapper of v8::Integer::New().
+ This patch replaces v8::Integer::New() with v8Integer() in custom bindings,
+ and pass isolates.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp:
+ (WebCore::V8CSSStyleDeclaration::namedPropertyEnumerator):
+ (WebCore::V8CSSStyleDeclaration::namedPropertyQuery):
+ * bindings/v8/custom/V8ClipboardCustom.cpp:
+ (WebCore::V8Clipboard::typesAccessorGetter):
+ * bindings/v8/custom/V8DOMStringMapCustom.cpp:
+ (WebCore::V8DOMStringMap::namedPropertyQuery):
+ (WebCore::V8DOMStringMap::namedPropertyEnumerator):
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::WindowSetTimeoutImpl):
+ * bindings/v8/custom/V8DataViewCustom.cpp:
+ (WebCore::V8DataView::getInt8Callback):
+ (WebCore::V8DataView::getUint8Callback):
+ * bindings/v8/custom/V8HTMLInputElementCustom.cpp:
+ (WebCore::V8HTMLInputElement::selectionStartAccessorGetter):
+ (WebCore::V8HTMLInputElement::selectionEndAccessorGetter):
+ * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
+ (WebCore::V8HTMLOptionsCollection::lengthAccessorGetter):
+ * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+ (WebCore::V8InjectedScriptHost::functionDetailsCallback):
+ * bindings/v8/custom/V8MessageEventCustom.cpp:
+ (WebCore::V8MessageEvent::portsAccessorGetter):
+ * bindings/v8/custom/V8MutationCallbackCustom.cpp:
+ (WebCore::V8MutationCallback::handleEvent):
+ * bindings/v8/custom/V8NodeListCustom.cpp:
+ (WebCore::V8NodeList::namedPropertyGetter):
+ * bindings/v8/custom/V8SQLTransactionCustom.cpp:
+ (WebCore::V8SQLTransaction::executeSqlCallback):
+ * bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
+ (WebCore::V8SQLTransactionSync::executeSqlCallback):
+ * bindings/v8/custom/V8StorageCustom.cpp:
+ (WebCore::V8Storage::namedPropertyEnumerator):
+ (WebCore::V8Storage::indexedPropertyGetter):
+ (WebCore::V8Storage::namedPropertyQuery):
+ (WebCore::V8Storage::indexedPropertySetter):
+ (WebCore::V8Storage::indexedPropertyDeleter):
+ * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
+ (WebCore::toV8Object):
+ (WebCore::V8WebGLRenderingContext::getAttachedShadersCallback):
+ (WebCore::V8WebGLRenderingContext::getSupportedExtensionsCallback):
+ * bindings/v8/custom/V8WorkerContextCustom.cpp:
+ (WebCore::SetTimeoutOrInterval):
+
+2012-06-29 Kentaro Hara <[email protected]>
+
Unreviewed, rolling out r121520.
http://trac.webkit.org/changeset/121520
https://bugs.webkit.org/show_bug.cgi?id=90246
Modified: trunk/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -174,7 +174,7 @@
for (unsigned i = 0; i < propertyNamesLength; ++i) {
String key = propertyNames.at(i);
ASSERT(!key.isNull());
- properties->Set(v8::Integer::New(i), v8String(key, info.GetIsolate()));
+ properties->Set(v8Integer(i, info.GetIsolate()), v8String(key, info.GetIsolate()));
}
return properties;
@@ -185,7 +185,7 @@
INC_STATS("DOM.CSSStyleDeclaration.NamedPropertyQuery");
if (cssPropertyInfo(v8Name))
- return v8::Integer::New(v8::None);
+ return v8Integer(0, info.GetIsolate());
return v8::Handle<v8::Integer>();
}
Modified: trunk/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -57,7 +57,7 @@
HashSet<String>::const_iterator end = types.end();
int index = 0;
for (HashSet<String>::const_iterator it = types.begin(); it != end; ++it, ++index)
- result->Set(v8::Integer::New(index), v8String(*it, info.GetIsolate()));
+ result->Set(v8Integer(index, info.GetIsolate()), v8String(*it, info.GetIsolate()));
return result;
}
Modified: trunk/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -42,7 +42,7 @@
{
INC_STATS("DOM.DOMStringMap.NamedPropertyQuery");
if (V8DOMStringMap::toNative(info.Holder())->contains(toWebCoreString(name)))
- return v8::Integer::New(v8::None);
+ return v8Integer(v8::None, info.GetIsolate());
return v8::Handle<v8::Integer>();
}
@@ -62,7 +62,7 @@
V8DOMStringMap::toNative(info.Holder())->getNames(names);
v8::Handle<v8::Array> properties = v8::Array::New(names.size());
for (size_t i = 0; i < names.size(); ++i)
- properties->Set(v8::Integer::New(i), v8String(names[i], info.GetIsolate()));
+ properties->Set(v8Integer(i, info.GetIsolate()), v8String(names[i], info.GetIsolate()));
return properties;
}
Modified: trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -131,7 +131,7 @@
} else {
RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector());
if (imp->document() && !imp->document()->contentSecurityPolicy()->allowEval(callStack.release()))
- return v8::Integer::New(0);
+ return v8Integer(0, args.GetIsolate());
id = DOMTimer::install(scriptContext, adoptPtr(new ScheduledAction(V8Proxy::context(imp->frame()), functionString)), timeout, singleShot);
}
@@ -142,7 +142,7 @@
V8GCForContextDispose::instance().notifyIdleSooner(maximumFireInterval);
}
- return v8::Integer::New(id);
+ return v8Integer(id, args.GetIsolate());
}
v8::Handle<v8::Value> V8DOMWindow::eventAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
Modified: trunk/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -76,7 +76,7 @@
int8_t result = imp->getInt8(byteOffset, ec);
if (UNLIKELY(ec))
return V8Proxy::setDOMException(ec, args.GetIsolate());
- return v8::Integer::New(result);
+ return v8Integer(result, args.GetIsolate());
}
v8::Handle<v8::Value> V8DataView::getUint8Callback(const v8::Arguments& args)
@@ -91,7 +91,7 @@
uint8_t result = imp->getUint8(byteOffset, ec);
if (UNLIKELY(ec))
return V8Proxy::setDOMException(ec, args.GetIsolate());
- return v8::Integer::New(result);
+ return v8Integer(result, args.GetIsolate());
}
v8::Handle<v8::Value> V8DataView::setInt8Callback(const v8::Arguments& args)
Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -48,7 +48,7 @@
return V8Proxy::throwTypeError("Accessing selectionStart on an input element that cannot have a selection.", info.GetIsolate());
int v = imp->selectionStart();
- return v8::Integer::New(v);
+ return v8Integer(v, info.GetIsolate());
}
void V8HTMLInputElement::selectionStartAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
@@ -74,7 +74,7 @@
return V8Proxy::throwTypeError("Accessing selectionEnd on an input element that cannot have a selection.", info.GetIsolate());
int v = imp->selectionEnd();
- return v8::Integer::New(v);
+ return v8Integer(v, info.GetIsolate());
}
void V8HTMLInputElement::selectionEndAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -88,7 +88,7 @@
INC_STATS("DOM.HTMLOptionsCollection.length._get");
HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(info.Holder());
int v = imp->length();
- return v8::Integer::New(v);
+ return v8Integer(v, info.GetIsolate());
}
void V8HTMLOptionsCollection::lengthAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
Modified: trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -168,8 +168,8 @@
int columnNumber = function->GetScriptColumnNumber();
v8::Local<v8::Object> location = v8::Object::New();
- location->Set(v8::String::New("lineNumber"), v8::Integer::New(lineNumber));
- location->Set(v8::String::New("columnNumber"), v8::Integer::New(columnNumber));
+ location->Set(v8::String::New("lineNumber"), v8Integer(lineNumber, args.GetIsolate()));
+ location->Set(v8::String::New("columnNumber"), v8Integer(columnNumber, args.GetIsolate()));
location->Set(v8::String::New("scriptId"), function->GetScriptId()->ToString());
v8::Local<v8::Object> result = v8::Object::New();
Modified: trunk/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -101,7 +101,7 @@
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(), info.GetIsolate()));
+ portArray->Set(v8Integer(i, info.GetIsolate()), toV8(portsCopy[i].get(), info.GetIsolate()));
return portArray;
}
Modified: trunk/Source/WebCore/bindings/v8/custom/V8MutationCallbackCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8MutationCallbackCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8MutationCallbackCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -66,7 +66,7 @@
v8::Local<v8::Array> mutationsArray = v8::Array::New(mutations->size());
for (size_t i = 0; i < mutations->size(); ++i)
- mutationsArray->Set(v8::Integer::New(i), toV8(mutations->at(i).get()));
+ mutationsArray->Set(v8Integer(i), toV8(mutations->at(i).get()));
v8::Handle<v8::Value> observerHandle = toV8(observer);
if (observerHandle.IsEmpty()) {
Modified: trunk/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -51,7 +51,7 @@
// Length property cannot be overridden.
DEFINE_STATIC_LOCAL(const AtomicString, length, ("length"));
if (key == length)
- return v8::Integer::New(list->length());
+ return v8Integer(list->length(), info.GetIsolate());
RefPtr<Node> result = list->itemWithName(key);
if (!result)
Modified: trunk/Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -73,7 +73,7 @@
sqlArgsLength = length->Uint32Value();
for (unsigned int i = 0; i < sqlArgsLength; ++i) {
- v8::Local<v8::Integer> key = v8::Integer::New(i);
+ v8::Handle<v8::Integer> key = v8Integer(i, args.GetIsolate());
EXCEPTION_BLOCK(v8::Local<v8::Value>, value, sqlArgsObject->Get(key));
if (value.IsEmpty() || value->IsNull())
Modified: trunk/Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -73,7 +73,7 @@
sqlArgsLength = length->Uint32Value();
for (unsigned int i = 0; i < sqlArgsLength; ++i) {
- v8::Local<v8::Integer> key = v8::Integer::New(i);
+ v8::Handle<v8::Integer> key = v8Integer(i, args.GetIsolate());
EXCEPTION_BLOCK(v8::Local<v8::Value>, value, sqlArgsObject->Get(key));
if (value.IsEmpty() || value->IsNull())
Modified: trunk/Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -47,7 +47,7 @@
String key = storage->key(i);
ASSERT(!key.isNull());
String val = storage->getItem(key);
- properties->Set(v8::Integer::New(i), v8String(key, info.GetIsolate()));
+ properties->Set(v8Integer(i, info.GetIsolate()), v8String(key, info.GetIsolate()));
}
return properties;
@@ -67,7 +67,7 @@
v8::Handle<v8::Value> V8Storage::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Storage.IndexedPropertyGetter");
- v8::Local<v8::Integer> indexV8 = v8::Integer::New(index);
+ v8::Handle<v8::Integer> indexV8 = v8Integer(index, info.GetIsolate());
return storageGetter(indexV8->ToString(), info);
}
@@ -87,7 +87,7 @@
String name = toWebCoreString(v8Name);
if (name != "length" && storage->contains(name))
- return v8::Integer::New(v8::None);
+ return v8Integer(0, info.GetIsolate());
return v8::Handle<v8::Integer>();
}
@@ -116,7 +116,7 @@
v8::Handle<v8::Value> V8Storage::indexedPropertySetter(uint32_t index, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Storage.NamedPropertyGetter");
- v8::Local<v8::Integer> indexV8 = v8::Integer::New(index);
+ v8::Handle<v8::Integer> indexV8 = v8Integer(index, info.GetIsolate());
return storageSetter(indexV8->ToString(), value, info);
}
@@ -142,7 +142,7 @@
v8::Handle<v8::Boolean> V8Storage::indexedPropertyDeleter(uint32_t index, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Storage.IndexedPropertyDeleter");
- v8::Local<v8::Integer> indexV8 = v8::Integer::New(index);
+ v8::Handle<v8::Integer> indexV8 = v8Integer(index, info.GetIsolate());
return storageDeleter(indexV8->ToString(), info);
}
Modified: trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -125,19 +125,19 @@
const Vector<bool>& value = info.getBoolArray();
v8::Local<v8::Array> array = v8::Array::New(value.size());
for (size_t ii = 0; ii < value.size(); ++ii)
- array->Set(v8::Integer::New(ii), v8::Boolean::New(value[ii]));
+ array->Set(v8Integer(ii, isolate), v8::Boolean::New(value[ii]));
return array;
}
case WebGLGetInfo::kTypeFloat:
return v8::Number::New(info.getFloat());
case WebGLGetInfo::kTypeInt:
- return v8::Integer::New(info.getInt());
+ return v8Integer(info.getInt(), isolate);
case WebGLGetInfo::kTypeNull:
return v8::Null(isolate);
case WebGLGetInfo::kTypeString:
return v8::String::New(fromWebCoreString(info.getString()), info.getString().length());
case WebGLGetInfo::kTypeUnsignedInt:
- return v8::Integer::NewFromUnsigned(info.getUnsignedInt());
+ return v8UnsignedInteger(info.getUnsignedInt(), isolate);
case WebGLGetInfo::kTypeWebGLBuffer:
return toV8(info.getWebGLBuffer(), isolate);
case WebGLGetInfo::kTypeWebGLFloatArray:
@@ -289,7 +289,7 @@
return v8::Null(args.GetIsolate());
v8::Local<v8::Array> array = v8::Array::New(shaders.size());
for (size_t ii = 0; ii < shaders.size(); ++ii)
- array->Set(v8::Integer::New(ii), toV8(shaders[ii].get(), args.GetIsolate()));
+ array->Set(v8Integer(ii, args.GetIsolate()), toV8(shaders[ii].get(), args.GetIsolate()));
return array;
}
@@ -398,7 +398,7 @@
Vector<String> value = imp->getSupportedExtensions();
v8::Local<v8::Array> array = v8::Array::New(value.size());
for (size_t ii = 0; ii < value.size(); ++ii)
- array->Set(v8::Integer::New(ii), v8::String::New(fromWebCoreString(value[ii]), value[ii].length()));
+ array->Set(v8Integer(ii, args.GetIsolate()), v8::String::New(fromWebCoreString(value[ii]), value[ii].length()));
return array;
}
Modified: trunk/Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp (121540 => 121541)
--- trunk/Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp 2012-06-29 09:49:10 UTC (rev 121540)
+++ trunk/Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp 2012-06-29 09:50:26 UTC (rev 121541)
@@ -83,7 +83,7 @@
} else
return v8::Undefined();
- return v8::Integer::New(timerId);
+ return v8Integer(timerId, args.GetIsolate());
}
v8::Handle<v8::Value> V8WorkerContext::importScriptsCallback(const v8::Arguments& args)