Title: [223709] trunk/Source/_javascript_Core
Revision
223709
Author
[email protected]
Date
2017-10-19 13:45:54 -0700 (Thu, 19 Oct 2017)

Log Message

Turn various poly proto RELEASE_ASSERTs into ASSERTs because they're on the hot path in speedometer
https://bugs.webkit.org/show_bug.cgi?id=178529

Reviewed by Mark Lam.

* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::storedPrototypeObject const):
(JSC::Structure::storedPrototypeStructure const):
(JSC::Structure::storedPrototype const):
(JSC::Structure::prototypeForLookup const):
(JSC::Structure::prototypeChain const):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (223708 => 223709)


--- trunk/Source/_javascript_Core/ChangeLog	2017-10-19 20:43:41 UTC (rev 223708)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-10-19 20:45:54 UTC (rev 223709)
@@ -1,5 +1,20 @@
 2017-10-19  Saam Barati  <[email protected]>
 
+        Turn various poly proto RELEASE_ASSERTs into ASSERTs because they're on the hot path in speedometer
+        https://bugs.webkit.org/show_bug.cgi?id=178529
+
+        Reviewed by Mark Lam.
+
+        * runtime/Structure.h:
+        * runtime/StructureInlines.h:
+        (JSC::Structure::storedPrototypeObject const):
+        (JSC::Structure::storedPrototypeStructure const):
+        (JSC::Structure::storedPrototype const):
+        (JSC::Structure::prototypeForLookup const):
+        (JSC::Structure::prototypeChain const):
+
+2017-10-19  Saam Barati  <[email protected]>
+
         Turn poly proto back on by default and remove the option
         https://bugs.webkit.org/show_bug.cgi?id=178525
 

Modified: trunk/Source/_javascript_Core/runtime/Structure.h (223708 => 223709)


--- trunk/Source/_javascript_Core/runtime/Structure.h	2017-10-19 20:43:41 UTC (rev 223708)
+++ trunk/Source/_javascript_Core/runtime/Structure.h	2017-10-19 20:45:54 UTC (rev 223709)
@@ -262,22 +262,22 @@
     // object of a structure is presumed to be immutable in a bunch of places.
     void setGlobalObject(VM& vm, JSGlobalObject* globalObject) { m_globalObject.set(vm, this, globalObject); }
 
-    bool hasMonoProto() const
+    ALWAYS_INLINE bool hasMonoProto() const
     {
         return !m_prototype.get().isInt32();
     }
-    bool hasPolyProto() const
+    ALWAYS_INLINE bool hasPolyProto() const
     {
         return !hasMonoProto();
     }
-    JSValue storedPrototype() const
+    ALWAYS_INLINE JSValue storedPrototype() const
     {
-        RELEASE_ASSERT(hasMonoProto());
+        ASSERT(hasMonoProto());
         return m_prototype.get();
     }
-    PropertyOffset polyProtoOffset() const
+    ALWAYS_INLINE PropertyOffset polyProtoOffset() const
     {
-        RELEASE_ASSERT(hasPolyProto());
+        ASSERT(hasPolyProto());
         return m_prototype.get().asInt32();
     }
     JSValue storedPrototype(const JSObject*) const;

Modified: trunk/Source/_javascript_Core/runtime/StructureInlines.h (223708 => 223709)


--- trunk/Source/_javascript_Core/runtime/StructureInlines.h	2017-10-19 20:43:41 UTC (rev 223708)
+++ trunk/Source/_javascript_Core/runtime/StructureInlines.h	2017-10-19 20:45:54 UTC (rev 223709)
@@ -61,7 +61,7 @@
 
 inline JSObject* Structure::storedPrototypeObject() const
 {
-    RELEASE_ASSERT(hasMonoProto());
+    ASSERT(hasMonoProto());
     JSValue value = m_prototype.get();
     if (value.isNull())
         return nullptr;
@@ -70,7 +70,7 @@
 
 inline Structure* Structure::storedPrototypeStructure() const
 {
-    RELEASE_ASSERT(hasMonoProto());
+    ASSERT(hasMonoProto());
     JSObject* object = storedPrototypeObject();
     if (!object)
         return nullptr;
@@ -79,10 +79,10 @@
 
 ALWAYS_INLINE JSValue Structure::storedPrototype(const JSObject* object) const
 {
-    RELEASE_ASSERT(object->structure() == this);
+    ASSERT(object->structure() == this);
     if (hasMonoProto())
         return storedPrototype();
-    RELEASE_ASSERT(m_prototype.get().isInt32());
+    ASSERT(m_prototype.get().isInt32());
     PropertyOffset offset = m_prototype.get().asInt32();
     return object->getDirect(offset);
 }
@@ -89,7 +89,7 @@
 
 ALWAYS_INLINE JSObject* Structure::storedPrototypeObject(const JSObject* object) const
 {
-    RELEASE_ASSERT(object->structure() == this);
+    ASSERT(object->structure() == this);
     if (hasMonoProto())
         return storedPrototypeObject();
     JSValue proto = object->getDirect(polyProtoOffset());
@@ -210,7 +210,7 @@
 
 inline JSValue Structure::prototypeForLookup(JSGlobalObject* globalObject) const
 {
-    RELEASE_ASSERT(hasMonoProto());
+    ASSERT(hasMonoProto());
     if (isObject())
         return storedPrototype();
     return prototypeForLookupPrimitiveImpl(globalObject, this);
@@ -218,7 +218,7 @@
 
 inline JSValue Structure::prototypeForLookup(JSGlobalObject* globalObject, JSCell* base) const
 {
-    RELEASE_ASSERT(base->structure() == this);
+    ASSERT(base->structure() == this);
     if (isObject())
         return storedPrototype(asObject(base));
     return prototypeForLookupPrimitiveImpl(globalObject, this);
@@ -226,7 +226,7 @@
 
 inline StructureChain* Structure::prototypeChain(VM& vm, JSGlobalObject* globalObject, JSObject* base) const
 {
-    RELEASE_ASSERT(base->structure(vm) == this);
+    ASSERT(base->structure(vm) == this);
     // We cache our prototype chain so our clients can share it.
     if (!isValid(globalObject, m_cachedPrototypeChain.get(), base)) {
         JSValue prototype = prototypeForLookup(globalObject, base);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to