Title: [110525] trunk/Source/WebCore
- Revision
- 110525
- Author
- [email protected]
- Date
- 2012-03-12 18:38:54 -0700 (Mon, 12 Mar 2012)
Log Message
[V8][Refactoring] Remove getWrapper() and getWrapperSlow()
https://bugs.webkit.org/show_bug.cgi?id=80920
Reviewed by Adam Barth.
Now getWrapper() is the same as getExistingWrapper().
getWrapperSlow() is the same as getExistingWrapperSlow().
This patch removes getWrapper() and getWrapperSlow().
Also this patch renames getExistingWrapper() to getCachedWrapper().
No tests. No change in behavior.
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateHeader):
* bindings/v8/V8DOMWrapper.cpp:
(WebCore::V8DOMWrapper::getWrapperSlow):
* bindings/v8/V8DOMWrapper.h:
(WebCore::V8DOMWrapper::getWrapper):
(V8DOMWrapper):
* bindings/v8/custom/V8NodeCustom.cpp:
(WebCore::toV8Slow):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (110524 => 110525)
--- trunk/Source/WebCore/ChangeLog 2012-03-13 01:37:07 UTC (rev 110524)
+++ trunk/Source/WebCore/ChangeLog 2012-03-13 01:38:54 UTC (rev 110525)
@@ -1,3 +1,27 @@
+2012-03-12 Kentaro Hara <[email protected]>
+
+ [V8][Refactoring] Remove getWrapper() and getWrapperSlow()
+ https://bugs.webkit.org/show_bug.cgi?id=80920
+
+ Reviewed by Adam Barth.
+
+ Now getWrapper() is the same as getExistingWrapper().
+ getWrapperSlow() is the same as getExistingWrapperSlow().
+ This patch removes getWrapper() and getWrapperSlow().
+ Also this patch renames getExistingWrapper() to getCachedWrapper().
+
+ No tests. No change in behavior.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateHeader):
+ * bindings/v8/V8DOMWrapper.cpp:
+ (WebCore::V8DOMWrapper::getWrapperSlow):
+ * bindings/v8/V8DOMWrapper.h:
+ (WebCore::V8DOMWrapper::getWrapper):
+ (V8DOMWrapper):
+ * bindings/v8/custom/V8NodeCustom.cpp:
+ (WebCore::toV8Slow):
+
2012-03-12 Erik Arvidsson <[email protected]>
[V8] Use v8::V8::AddHiddenReferences instead of SetHiddenValue
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (110524 => 110525)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-03-13 01:37:07 UTC (rev 110524)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-03-13 01:38:54 UTC (rev 110525)
@@ -494,7 +494,7 @@
ALWAYS_INLINE v8::Handle<v8::Object> ${className}::existingWrapper(${nativeType}* impl)
{
END
- my $getWrapper = IsNodeSubType($dataNode) ? "V8DOMWrapper::getExistingWrapper(impl)" : "${domMapFunction}.get(impl)";
+ my $getWrapper = IsNodeSubType($dataNode) ? "V8DOMWrapper::getCachedWrapper(impl)" : "${domMapFunction}.get(impl)";
push(@headerContent, <<END);
return ${getWrapper};
}
@@ -542,7 +542,7 @@
return v8::Null();
if (UNLIKELY(forceNewObject))
return toV8Slow(impl, forceNewObject);
- v8::Handle<v8::Value> wrapper = V8DOMWrapper::getWrapper(impl);
+ v8::Handle<v8::Value> wrapper = V8DOMWrapper::getCachedWrapper(impl);
if (!wrapper.IsEmpty())
return wrapper;
return toV8Slow(impl, false);
Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp (110524 => 110525)
--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp 2012-03-13 01:37:07 UTC (rev 110524)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp 2012-03-13 01:38:54 UTC (rev 110525)
@@ -69,7 +69,7 @@
namespace WebCore {
-static ALWAYS_INLINE v8::Handle<v8::Object> getExistingWrapperInline(Node* node)
+static ALWAYS_INLINE v8::Handle<v8::Object> getCachedWrapperInline(Node* node)
{
V8IsolatedContext* context = V8IsolatedContext::getEntered();
if (LIKELY(!context)) {
@@ -303,16 +303,11 @@
return typeInfo == type;
}
-v8::Handle<v8::Object> V8DOMWrapper::getExistingWrapperSlow(Node* node)
+v8::Handle<v8::Object> V8DOMWrapper::getCachedWrapperSlow(Node* node)
{
- return getExistingWrapperInline(node);
+ return getCachedWrapperInline(node);
}
-v8::Handle<v8::Value> V8DOMWrapper::getWrapperSlow(Node* node)
-{
- return getExistingWrapperInline(node);
-}
-
#define TRY_TO_WRAP_WITH_INTERFACE(interfaceName) \
if (eventNames().interfaceFor##interfaceName == desiredInterface) \
return toV8(static_cast<interfaceName*>(target));
Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h (110524 => 110525)
--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h 2012-03-13 01:37:07 UTC (rev 110524)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h 2012-03-13 01:38:54 UTC (rev 110525)
@@ -124,7 +124,7 @@
static v8::Local<v8::Object> instantiateV8Object(V8Proxy* proxy, WrapperTypeInfo*, void* impl);
- static v8::Handle<v8::Object> getExistingWrapper(Node* node)
+ static v8::Handle<v8::Object> getCachedWrapper(Node* node)
{
ASSERT(isMainThread());
if (LIKELY(!IsolatedWorld::count())) {
@@ -132,23 +132,11 @@
if (LIKELY(!!wrapper))
return *wrapper;
}
- return getExistingWrapperSlow(node);
+ return getCachedWrapperSlow(node);
}
- static v8::Handle<v8::Value> getWrapper(Node* node)
- {
- ASSERT(isMainThread());
- if (LIKELY(!IsolatedWorld::count())) {
- v8::Persistent<v8::Object>* wrapper = node->wrapper();
- if (LIKELY(!!wrapper))
- return *wrapper;
- }
- return getWrapperSlow(node);
- }
-
private:
- static v8::Handle<v8::Object> getExistingWrapperSlow(Node*);
- static v8::Handle<v8::Value> getWrapperSlow(Node*);
+ static v8::Handle<v8::Object> getCachedWrapperSlow(Node*);
};
}
Modified: trunk/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp (110524 => 110525)
--- trunk/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp 2012-03-13 01:37:07 UTC (rev 110524)
+++ trunk/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp 2012-03-13 01:38:54 UTC (rev 110525)
@@ -142,7 +142,7 @@
return v8::Null();
if (!forceNewObject) {
- v8::Handle<v8::Value> wrapper = V8DOMWrapper::getExistingWrapper(impl);
+ v8::Handle<v8::Value> wrapper = V8DOMWrapper::getCachedWrapper(impl);
if (!wrapper.IsEmpty())
return wrapper;
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes