Title: [94931] trunk/Source/_javascript_Core
- Revision
- 94931
- Author
- [email protected]
- Date
- 2011-09-11 15:29:24 -0700 (Sun, 11 Sep 2011)
Log Message
De-virtualize JSCell::isAPIValueWrapper
https://bugs.webkit.org/show_bug.cgi?id=67909
Reviewed by Oliver Hunt.
* runtime/JSAPIValueWrapper.h:
(JSC::JSAPIValueWrapper::createStructure):
Set the correct type on structure creation.
* runtime/JSCell.h:
Remove virtual keyword and default implementation.
* runtime/JSType.h:
Add type for APIValueWrapper. It must come after CompoundType since
the APIValueWrapper has children in need of marking.
* runtime/Structure.h:
(JSC::JSCell::isAPIValueWrapper):
Implement predicate using type info.
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (94930 => 94931)
--- trunk/Source/_javascript_Core/ChangeLog 2011-09-11 21:45:40 UTC (rev 94930)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-09-11 22:29:24 UTC (rev 94931)
@@ -1,3 +1,25 @@
+2011-09-11 Sam Weinig <[email protected]>
+
+ De-virtualize JSCell::isAPIValueWrapper
+ https://bugs.webkit.org/show_bug.cgi?id=67909
+
+ Reviewed by Oliver Hunt.
+
+ * runtime/JSAPIValueWrapper.h:
+ (JSC::JSAPIValueWrapper::createStructure):
+ Set the correct type on structure creation.
+
+ * runtime/JSCell.h:
+ Remove virtual keyword and default implementation.
+
+ * runtime/JSType.h:
+ Add type for APIValueWrapper. It must come after CompoundType since
+ the APIValueWrapper has children in need of marking.
+
+ * runtime/Structure.h:
+ (JSC::JSCell::isAPIValueWrapper):
+ Implement predicate using type info.
+
2011-09-10 Sam Weinig <[email protected]>
De-virtualize JSCell::isGetterSetter, type information is available for it
Modified: trunk/Source/_javascript_Core/runtime/JSAPIValueWrapper.h (94930 => 94931)
--- trunk/Source/_javascript_Core/runtime/JSAPIValueWrapper.h 2011-09-11 21:45:40 UTC (rev 94930)
+++ trunk/Source/_javascript_Core/runtime/JSAPIValueWrapper.h 2011-09-11 22:29:24 UTC (rev 94931)
@@ -37,11 +37,9 @@
JSValue value() const { return m_value.get(); }
- virtual bool isAPIValueWrapper() const { return true; }
-
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
{
- return Structure::create(globalData, globalObject, prototype, TypeInfo(CompoundType, OverridesVisitChildren | OverridesGetPropertyNames), &s_info);
+ return Structure::create(globalData, globalObject, prototype, TypeInfo(APIValueWrapper, OverridesVisitChildren | OverridesGetPropertyNames), &s_info);
}
static const ClassInfo s_info;
Modified: trunk/Source/_javascript_Core/runtime/JSCell.h (94930 => 94931)
--- trunk/Source/_javascript_Core/runtime/JSCell.h 2011-09-11 21:45:40 UTC (rev 94930)
+++ trunk/Source/_javascript_Core/runtime/JSCell.h 2011-09-11 22:29:24 UTC (rev 94931)
@@ -89,7 +89,7 @@
bool isObject() const;
bool isGetterSetter() const;
bool inherits(const ClassInfo*) const;
- virtual bool isAPIValueWrapper() const { return false; }
+ bool isAPIValueWrapper() const;
virtual bool isPropertyNameIterator() const { return false; }
Structure* structure() const;
Modified: trunk/Source/_javascript_Core/runtime/JSType.h (94930 => 94931)
--- trunk/Source/_javascript_Core/runtime/JSType.h 2011-09-11 21:45:40 UTC (rev 94930)
+++ trunk/Source/_javascript_Core/runtime/JSType.h 2011-09-11 22:29:24 UTC (rev 94931)
@@ -37,7 +37,8 @@
// The CompoundType value must come before any JSType that may have children
CompoundType = 7,
ObjectType = 8,
- GetterSetterType = 9
+ GetterSetterType = 9,
+ APIValueWrapper = 10
};
} // namespace JSC
Modified: trunk/Source/_javascript_Core/runtime/Structure.h (94930 => 94931)
--- trunk/Source/_javascript_Core/runtime/Structure.h 2011-09-11 21:45:40 UTC (rev 94930)
+++ trunk/Source/_javascript_Core/runtime/Structure.h 2011-09-11 22:29:24 UTC (rev 94931)
@@ -317,6 +317,11 @@
return m_structure->typeInfo().type() == GetterSetterType;
}
+ inline bool JSCell::isAPIValueWrapper() const
+ {
+ return m_structure->typeInfo().type() == APIValueWrapper;
+ }
+
inline const ClassInfo* JSCell::classInfo() const
{
#if ENABLE(GC_VALIDATION)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes