2018-05-11 Saam Barati <sbarati@apple.com>
+ 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 <sbarati@apple.com>
+
Don't allocate value profiles when the JIT is disabled
https://bugs.webkit.org/show_bug.cgi?id=185525
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();
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);
}
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);
}
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);
}