Title: [231703] trunk/Source/_javascript_Core
Revision
231703
Author
[email protected]
Date
2018-05-11 09:08:42 -0700 (Fri, 11 May 2018)

Log Message

Don't use inferred types when the JIT is disabled
https://bugs.webkit.org/show_bug.cgi?id=185539

Reviewed by Yusuke Suzuki.

There are many JSC API clients that run with the JIT disabled. They were
all allocating and tracking inferred types for no benefit. Inferred types
only benefit programs when they make it to the DFG/FTL. I was seeing cases
where the inferred type machinery used ~0.5MB. This patch makes is so we
don't allocate that machinery when the JIT is disabled.

* runtime/Structure.cpp:
(JSC::Structure::willStoreValueSlow):
* runtime/Structure.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (231702 => 231703)


--- trunk/Source/_javascript_Core/ChangeLog	2018-05-11 16:01:30 UTC (rev 231702)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-05-11 16:08:42 UTC (rev 231703)
@@ -1,5 +1,22 @@
 2018-05-11  Saam Barati  <[email protected]>
 
+        Don't use inferred types when the JIT is disabled
+        https://bugs.webkit.org/show_bug.cgi?id=185539
+
+        Reviewed by Yusuke Suzuki.
+
+        There are many JSC API clients that run with the JIT disabled. They were
+        all allocating and tracking inferred types for no benefit. Inferred types
+        only benefit programs when they make it to the DFG/FTL. I was seeing cases
+        where the inferred type machinery used ~0.5MB. This patch makes is so we
+        don't allocate that machinery when the JIT is disabled.
+
+        * runtime/Structure.cpp:
+        (JSC::Structure::willStoreValueSlow):
+        * runtime/Structure.h:
+
+2018-05-11  Saam Barati  <[email protected]>
+
         Don't allocate value profiles when the JIT is disabled
         https://bugs.webkit.org/show_bug.cgi?id=185525
 

Modified: trunk/Source/_javascript_Core/runtime/Structure.cpp (231702 => 231703)


--- trunk/Source/_javascript_Core/runtime/Structure.cpp	2018-05-11 16:01:30 UTC (rev 231702)
+++ trunk/Source/_javascript_Core/runtime/Structure.cpp	2018-05-11 16:08:42 UTC (rev 231703)
@@ -895,6 +895,8 @@
     ASSERT(structure()->classInfo() == info());
     ASSERT(!hasBeenDictionary());
 
+    ASSERT_WITH_MESSAGE(VM::canUseJIT(), "We don't want to use memory for inferred types unless we're using the JIT.");
+
     // Create the inferred type table before doing anything else, so that we don't GC after we have already
     // grabbed a pointer into the property map.
     InferredTypeTable* table = m_inferredTypeTable.get();

Modified: trunk/Source/_javascript_Core/runtime/Structure.h (231702 => 231703)


--- trunk/Source/_javascript_Core/runtime/Structure.h	2018-05-11 16:01:30 UTC (rev 231702)
+++ trunk/Source/_javascript_Core/runtime/Structure.h	2018-05-11 16:08:42 UTC (rev 231703)
@@ -608,7 +608,7 @@
     ALWAYS_INLINE void willStoreValueForNewTransition(
         VM& vm, PropertyName propertyName, JSValue value, bool shouldOptimize)
     {
-        if (hasBeenDictionary() || (!shouldOptimize && !m_inferredTypeTable))
+        if (hasBeenDictionary() || (!shouldOptimize && !m_inferredTypeTable) || !VM::canUseJIT())
             return;
         willStoreValueSlow(vm, propertyName, value, shouldOptimize, InferredTypeTable::NewProperty);
     }
@@ -619,7 +619,7 @@
     ALWAYS_INLINE void willStoreValueForExistingTransition(
         VM& vm, PropertyName propertyName, JSValue value, bool shouldOptimize)
     {
-        if (hasBeenDictionary() || !m_inferredTypeTable)
+        if (hasBeenDictionary() || !m_inferredTypeTable || !VM::canUseJIT())
             return;
         willStoreValueSlow(vm, propertyName, value, shouldOptimize, InferredTypeTable::NewProperty);
     }
@@ -628,7 +628,7 @@
     ALWAYS_INLINE void willStoreValueForReplace(
         VM& vm, PropertyName propertyName, JSValue value, bool shouldOptimize)
     {
-        if (hasBeenDictionary())
+        if (hasBeenDictionary() || !VM::canUseJIT())
             return;
         willStoreValueSlow(vm, propertyName, value, shouldOptimize, InferredTypeTable::OldProperty);
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to