Title: [231902] trunk/Source/_javascript_Core
Revision
231902
Author
utatane....@gmail.com
Date
2018-05-17 09:08:51 -0700 (Thu, 17 May 2018)

Log Message

[JSC] Remove reifyPropertyNameIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=185350

Reviewed by Saam Barati.

reifyPropertyNameIfNeeded is in the middle of putDirectInternal, which is super critical path.
This is a virtual call, and it is only used by JSFunction right now. Since this causes too much
cost, we should remove this from the critical path.

This patch removes this function call from the critical path. And in our slow paths, we call
helper functions which calls reifyLazyPropertyIfNeeded if the given value is a JSFunction.
While putDirect is a bit raw API, our slow paths just call it. This helper wraps this calls
and care the edge cases. The other callsites of putDirect should know the type of the given
object and the name of the property (And avoid these edge cases).

This improves SixSpeed/object-assign.es6 by ~4% on MacBook Pro. And this patch does not cause
regressions of the existing tests.

                                   baseline                  patched
Kraken:
    json-parse-financial        35.522+-0.069      ^      34.708+-0.097         ^ definitely 1.0234x faster

SixSpeed:
    object-assign.es6         145.8779+-0.2838     ^    140.1019+-0.8007        ^ definitely 1.0412x faster

* dfg/DFGOperations.cpp:
(JSC::DFG::putByValInternal):
(JSC::DFG::putByValCellInternal):
* jit/JITOperations.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/ClassInfo.h:
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::putDirectWithReify):
(JSC::CommonSlowPaths::putDirectAccessorWithReify):
* runtime/JSCell.cpp:
(JSC::JSCell::reifyPropertyNameIfNeeded): Deleted.
* runtime/JSCell.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::reifyPropertyNameIfNeeded): Deleted.
* runtime/JSFunction.h:
* runtime/JSObject.cpp:
(JSC::JSObject::putDirectAccessor):
(JSC::JSObject::putDirectNonIndexAccessor):
* runtime/JSObject.h:
* runtime/JSObjectInlines.h:
(JSC::JSObject::putDirectInternal):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (231901 => 231902)


--- trunk/Source/_javascript_Core/ChangeLog	2018-05-17 16:03:27 UTC (rev 231901)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-05-17 16:08:51 UTC (rev 231902)
@@ -1,3 +1,53 @@
+2018-05-17  Yusuke Suzuki  <utatane....@gmail.com>
+
+        [JSC] Remove reifyPropertyNameIfNeeded
+        https://bugs.webkit.org/show_bug.cgi?id=185350
+
+        Reviewed by Saam Barati.
+
+        reifyPropertyNameIfNeeded is in the middle of putDirectInternal, which is super critical path.
+        This is a virtual call, and it is only used by JSFunction right now. Since this causes too much
+        cost, we should remove this from the critical path.
+
+        This patch removes this function call from the critical path. And in our slow paths, we call
+        helper functions which calls reifyLazyPropertyIfNeeded if the given value is a JSFunction.
+        While putDirect is a bit raw API, our slow paths just call it. This helper wraps this calls
+        and care the edge cases. The other callsites of putDirect should know the type of the given
+        object and the name of the property (And avoid these edge cases).
+
+        This improves SixSpeed/object-assign.es6 by ~4% on MacBook Pro. And this patch does not cause
+        regressions of the existing tests.
+
+                                           baseline                  patched
+        Kraken:
+            json-parse-financial        35.522+-0.069      ^      34.708+-0.097         ^ definitely 1.0234x faster
+
+        SixSpeed:
+            object-assign.es6         145.8779+-0.2838     ^    140.1019+-0.8007        ^ definitely 1.0412x faster
+
+        * dfg/DFGOperations.cpp:
+        (JSC::DFG::putByValInternal):
+        (JSC::DFG::putByValCellInternal):
+        * jit/JITOperations.cpp:
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * runtime/ClassInfo.h:
+        * runtime/CommonSlowPaths.h:
+        (JSC::CommonSlowPaths::putDirectWithReify):
+        (JSC::CommonSlowPaths::putDirectAccessorWithReify):
+        * runtime/JSCell.cpp:
+        (JSC::JSCell::reifyPropertyNameIfNeeded): Deleted.
+        * runtime/JSCell.h:
+        * runtime/JSFunction.cpp:
+        (JSC::JSFunction::reifyPropertyNameIfNeeded): Deleted.
+        * runtime/JSFunction.h:
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::putDirectAccessor):
+        (JSC::JSObject::putDirectNonIndexAccessor):
+        * runtime/JSObject.h:
+        * runtime/JSObjectInlines.h:
+        (JSC::JSObject::putDirectInternal):
+
 2018-05-17  Saam Barati  <sbar...@apple.com>
 
         Unreviewed. Try to fix windows build.

Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.cpp (231901 => 231902)


--- trunk/Source/_javascript_Core/dfg/DFGOperations.cpp	2018-05-17 16:03:27 UTC (rev 231901)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.cpp	2018-05-17 16:08:51 UTC (rev 231902)
@@ -139,12 +139,13 @@
     PutPropertySlot slot(baseValue, strict);
     if (direct) {
         RELEASE_ASSERT(baseValue.isObject());
+        JSObject* baseObject = asObject(baseValue);
         if (std::optional<uint32_t> index = parseIndex(propertyName)) {
             scope.release();
-            asObject(baseValue)->putDirectIndex(exec, index.value(), value, 0, strict ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
+            baseObject->putDirectIndex(exec, index.value(), value, 0, strict ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
             return;
         }
-        asObject(baseValue)->putDirect(vm, propertyName, value, slot);
+        CommonSlowPaths::putDirectWithReify(vm, exec, baseObject, propertyName, value, slot);
         return;
     }
     scope.release();
@@ -157,10 +158,12 @@
     PutPropertySlot slot(base, strict);
     if (direct) {
         RELEASE_ASSERT(base->isObject());
-        if (std::optional<uint32_t> index = parseIndex(propertyName))
-            asObject(base)->putDirectIndex(exec, index.value(), value, 0, strict ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
-        else
-            asObject(base)->putDirect(vm, propertyName, value, slot);
+        JSObject* baseObject = asObject(base);
+        if (std::optional<uint32_t> index = parseIndex(propertyName)) {
+            baseObject->putDirectIndex(exec, index.value(), value, 0, strict ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
+            return;
+        }
+        CommonSlowPaths::putDirectWithReify(vm, exec, baseObject, propertyName, value, slot);
         return;
     }
     base->putInline(exec, propertyName, value, slot);
@@ -838,7 +841,7 @@
     }
 
     PutPropertySlot slot(object, true);
-    object->putDirect(vm, Identifier::from(exec, index), jsValue, slot);
+    CommonSlowPaths::putDirectWithReify(vm, exec, object, Identifier::from(exec, index), jsValue, slot);
 }
 
 void JIT_OPERATION operationPutDoubleByValDirectBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* object, int32_t index, double value)
@@ -854,7 +857,7 @@
     }
 
     PutPropertySlot slot(object, false);
-    object->putDirect(vm, Identifier::from(exec, index), jsValue, slot);
+    CommonSlowPaths::putDirectWithReify(vm, exec, object, Identifier::from(exec, index), jsValue, slot);
 }
 
 void JIT_OPERATION operationPutByValDirectStrict(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)
@@ -931,7 +934,7 @@
     }
     
     PutPropertySlot slot(object, true);
-    object->putDirect(vm, Identifier::from(exec, index), JSValue::decode(encodedValue), slot);
+    CommonSlowPaths::putDirectWithReify(vm, exec, object, Identifier::from(exec, index), JSValue::decode(encodedValue), slot);
 }
 
 void JIT_OPERATION operationPutByValDirectBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* object, int32_t index, EncodedJSValue encodedValue)
@@ -945,7 +948,7 @@
     }
     
     PutPropertySlot slot(object, false);
-    object->putDirect(vm, Identifier::from(exec, index), JSValue::decode(encodedValue), slot);
+    CommonSlowPaths::putDirectWithReify(vm, exec, object, Identifier::from(exec, index), JSValue::decode(encodedValue), slot);
 }
 
 EncodedJSValue JIT_OPERATION operationArrayPush(ExecState* exec, EncodedJSValue encodedValue, JSArray* array)

Modified: trunk/Source/_javascript_Core/jit/JITOperations.cpp (231901 => 231902)


--- trunk/Source/_javascript_Core/jit/JITOperations.cpp	2018-05-17 16:03:27 UTC (rev 231901)
+++ trunk/Source/_javascript_Core/jit/JITOperations.cpp	2018-05-17 16:08:51 UTC (rev 231902)
@@ -474,16 +474,16 @@
 {
     SuperSamplerScope superSamplerScope(false);
     
-    VM* vm = &exec->vm();
-    NativeCallFrameTracer tracer(vm, exec);
+    VM& vm = exec->vm();
+    NativeCallFrameTracer tracer(&vm, exec);
     
     stubInfo->tookSlowPath = true;
     
     JSValue baseValue = JSValue::decode(encodedBase);
-    Identifier ident = Identifier::fromUid(vm, uid);
-    LOG_IC((ICEvent::OperationPutByIdDirectStrict, baseValue.classInfoOrNull(*vm), ident));
+    Identifier ident = Identifier::fromUid(&vm, uid);
+    LOG_IC((ICEvent::OperationPutByIdDirectStrict, baseValue.classInfoOrNull(vm), ident));
     PutPropertySlot slot(baseValue, true, exec->codeBlock()->putByIdContext());
-    asObject(baseValue)->putDirect(*vm, ident, JSValue::decode(encodedValue), slot);
+    CommonSlowPaths::putDirectWithReify(vm, exec, asObject(baseValue), ident, JSValue::decode(encodedValue), slot);
 }
 
 void JIT_OPERATION operationPutByIdDirectNonStrict(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
@@ -490,16 +490,16 @@
 {
     SuperSamplerScope superSamplerScope(false);
     
-    VM* vm = &exec->vm();
-    NativeCallFrameTracer tracer(vm, exec);
+    VM& vm = exec->vm();
+    NativeCallFrameTracer tracer(&vm, exec);
     
     stubInfo->tookSlowPath = true;
     
     JSValue baseValue = JSValue::decode(encodedBase);
-    Identifier ident = Identifier::fromUid(vm, uid);
-    LOG_IC((ICEvent::OperationPutByIdDirectNonStrict, baseValue.classInfoOrNull(*vm), ident));
+    Identifier ident = Identifier::fromUid(&vm, uid);
+    LOG_IC((ICEvent::OperationPutByIdDirectNonStrict, baseValue.classInfoOrNull(vm), ident));
     PutPropertySlot slot(baseValue, false, exec->codeBlock()->putByIdContext());
-    asObject(baseValue)->putDirect(*vm, ident, JSValue::decode(encodedValue), slot);
+    CommonSlowPaths::putDirectWithReify(vm, exec, asObject(baseValue), ident, JSValue::decode(encodedValue), slot);
 }
 
 void JIT_OPERATION operationPutByIdStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
@@ -562,21 +562,22 @@
 {
     SuperSamplerScope superSamplerScope(false);
     
-    VM* vm = &exec->vm();
-    NativeCallFrameTracer tracer(vm, exec);
+    VM& vm = exec->vm();
+    NativeCallFrameTracer tracer(&vm, exec);
+    auto scope = DECLARE_THROW_SCOPE(vm);
     
-    Identifier ident = Identifier::fromUid(vm, uid);
+    Identifier ident = Identifier::fromUid(&vm, uid);
     AccessType accessType = static_cast<AccessType>(stubInfo->accessType);
 
     JSValue value = JSValue::decode(encodedValue);
     JSObject* baseObject = asObject(JSValue::decode(encodedBase));
-    LOG_IC((ICEvent::OperationPutByIdDirectStrictOptimize, baseObject->classInfo(*vm), ident));
+    LOG_IC((ICEvent::OperationPutByIdDirectStrictOptimize, baseObject->classInfo(vm), ident));
     CodeBlock* codeBlock = exec->codeBlock();
     PutPropertySlot slot(baseObject, true, codeBlock->putByIdContext());
+    Structure* structure = nullptr;
+    CommonSlowPaths::putDirectWithReify(vm, exec, baseObject, ident, value, slot, &structure);
+    RETURN_IF_EXCEPTION(scope, void());
     
-    Structure* structure = baseObject->structure(*vm);
-    baseObject->putDirect(*vm, ident, value, slot);
-    
     if (accessType != static_cast<AccessType>(stubInfo->accessType))
         return;
     
@@ -588,21 +589,22 @@
 {
     SuperSamplerScope superSamplerScope(false);
     
-    VM* vm = &exec->vm();
-    NativeCallFrameTracer tracer(vm, exec);
+    VM& vm = exec->vm();
+    NativeCallFrameTracer tracer(&vm, exec);
+    auto scope = DECLARE_THROW_SCOPE(vm);
     
-    Identifier ident = Identifier::fromUid(vm, uid);
+    Identifier ident = Identifier::fromUid(&vm, uid);
     AccessType accessType = static_cast<AccessType>(stubInfo->accessType);
 
     JSValue value = JSValue::decode(encodedValue);
     JSObject* baseObject = asObject(JSValue::decode(encodedBase));
-    LOG_IC((ICEvent::OperationPutByIdDirectNonStrictOptimize, baseObject->classInfo(*vm), ident));
+    LOG_IC((ICEvent::OperationPutByIdDirectNonStrictOptimize, baseObject->classInfo(vm), ident));
     CodeBlock* codeBlock = exec->codeBlock();
     PutPropertySlot slot(baseObject, false, codeBlock->putByIdContext());
+    Structure* structure = nullptr;
+    CommonSlowPaths::putDirectWithReify(vm, exec, baseObject, ident, value, slot, &structure);
+    RETURN_IF_EXCEPTION(scope, void());
     
-    Structure* structure = baseObject->structure(*vm);
-    baseObject->putDirect(*vm, ident, value, slot);
-    
     if (accessType != static_cast<AccessType>(stubInfo->accessType))
         return;
     
@@ -710,7 +712,7 @@
         byValInfo->tookSlowPath = true;
 
     PutPropertySlot slot(baseObject, isStrictMode);
-    baseObject->putDirect(vm, property, value, slot);
+    CommonSlowPaths::putDirectWithReify(vm, callFrame, baseObject, property, value, slot);
 }
 
 enum class OptimizationResult {
@@ -1745,7 +1747,7 @@
     NativeCallFrameTracer tracer(&vm, exec);
 
     ASSERT(object && object->isObject());
-    JSObject* baseObj = asObject(object);
+    JSObject* baseObject = asObject(object);
 
     GetterSetter* accessor = GetterSetter::create(vm, exec->lexicalGlobalObject());
 
@@ -1759,7 +1761,7 @@
         accessor->setGetter(vm, exec->lexicalGlobalObject(), asObject(getter));
     if (!setter.isUndefined())
         accessor->setSetter(vm, exec->lexicalGlobalObject(), asObject(setter));
-    baseObj->putDirectAccessor(exec, uid, accessor, attribute);
+    CommonSlowPaths::putDirectAccessorWithReify(vm, exec, baseObject, uid, accessor, attribute);
 }
 
 #else
@@ -1769,7 +1771,7 @@
     NativeCallFrameTracer tracer(&vm, exec);
 
     ASSERT(object && object->isObject());
-    JSObject* baseObj = asObject(object);
+    JSObject* baseObject = asObject(object);
 
     GetterSetter* accessor = GetterSetter::create(vm, exec->lexicalGlobalObject());
 
@@ -1781,7 +1783,7 @@
         accessor->setGetter(vm, exec->lexicalGlobalObject(), getter->getObject());
     if (setter)
         accessor->setSetter(vm, exec->lexicalGlobalObject(), setter->getObject());
-    baseObj->putDirectAccessor(exec, uid, accessor, attribute);
+    CommonSlowPaths::putDirectAccessorWithReify(vm, exec, baseObject, uid, accessor, attribute);
 }
 #endif
 

Modified: trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp (231901 => 231902)


--- trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp	2018-05-17 16:03:27 UTC (rev 231901)
+++ trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp	2018-05-17 16:08:51 UTC (rev 231902)
@@ -793,7 +793,7 @@
     JSValue baseValue = LLINT_OP_C(1).jsValue();
     PutPropertySlot slot(baseValue, codeBlock->isStrictMode(), codeBlock->putByIdContext());
     if (pc[8].u.putByIdFlags & PutByIdIsDirect)
-        asObject(baseValue)->putDirect(vm, ident, LLINT_OP_C(3).jsValue(), slot);
+        CommonSlowPaths::putDirectWithReify(vm, exec, asObject(baseValue), ident, LLINT_OP_C(3).jsValue(), slot);
     else
         baseValue.putInline(exec, ident, LLINT_OP_C(3).jsValue(), slot);
     LLINT_CHECK_EXCEPTION();
@@ -1010,7 +1010,7 @@
         baseObject->putDirectIndex(exec, index.value(), value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
     else {
         PutPropertySlot slot(baseObject, isStrictMode);
-        baseObject->putDirect(vm, property, value, slot);
+        CommonSlowPaths::putDirectWithReify(vm, exec, baseObject, property, value, slot);
     }
     LLINT_END();
 }
@@ -1077,7 +1077,7 @@
 {
     LLINT_BEGIN();
     ASSERT(LLINT_OP(1).jsValue().isObject());
-    JSObject* baseObj = asObject(LLINT_OP(1).jsValue());
+    JSObject* baseObject = asObject(LLINT_OP(1).jsValue());
     
     GetterSetter* accessor = GetterSetter::create(vm, exec->lexicalGlobalObject());
     LLINT_CHECK_EXCEPTION();
@@ -1092,10 +1092,7 @@
         accessor->setGetter(vm, exec->lexicalGlobalObject(), asObject(getter));
     if (!setter.isUndefined())
         accessor->setSetter(vm, exec->lexicalGlobalObject(), asObject(setter));
-    baseObj->putDirectAccessor(
-        exec,
-        exec->codeBlock()->identifier(pc[2].u.operand),
-        accessor, pc[3].u.operand);
+    CommonSlowPaths::putDirectAccessorWithReify(vm, exec, baseObject, exec->codeBlock()->identifier(pc[2].u.operand), accessor, pc[3].u.operand);
     LLINT_END();
 }
 

Modified: trunk/Source/_javascript_Core/runtime/ClassInfo.h (231901 => 231902)


--- trunk/Source/_javascript_Core/runtime/ClassInfo.h	2018-05-17 16:03:27 UTC (rev 231901)
+++ trunk/Source/_javascript_Core/runtime/ClassInfo.h	2018-05-17 16:08:51 UTC (rev 231902)
@@ -130,9 +130,6 @@
 
     using VisitOutputConstraintsPtr = void (*)(JSCell*, SlotVisitor&);
     VisitOutputConstraintsPtr WTF_METHOD_TABLE_ENTRY(visitOutputConstraints);
-
-    using ReifyPropertyNameIfNeededPtr = PropertyReificationResult (*)(JSCell*, ExecState*, PropertyName&);
-    ReifyPropertyNameIfNeededPtr WTF_METHOD_TABLE_ENTRY(reifyPropertyNameIfNeeded);
 };
 
 #define CREATE_MEMBER_CHECKER(member) \
@@ -187,7 +184,6 @@
         &ClassName::heapSnapshot, \
         &ClassName::estimatedSize, \
         &ClassName::visitOutputConstraints, \
-        &ClassName::reifyPropertyNameIfNeeded, \
     }, \
     ClassName::TypedArrayStorageType
 

Modified: trunk/Source/_javascript_Core/runtime/CommonSlowPaths.h (231901 => 231902)


--- trunk/Source/_javascript_Core/runtime/CommonSlowPaths.h	2018-05-17 16:03:27 UTC (rev 231901)
+++ trunk/Source/_javascript_Core/runtime/CommonSlowPaths.h	2018-05-17 16:08:51 UTC (rev 231902)
@@ -225,6 +225,28 @@
     return false;
 }
 
+static ALWAYS_INLINE void putDirectWithReify(VM& vm, ExecState* exec, JSObject* baseObject, PropertyName propertyName, JSValue value, PutPropertySlot& slot, Structure** result = nullptr)
+{
+    if (baseObject->inherits<JSFunction>(vm)) {
+        auto scope = DECLARE_THROW_SCOPE(vm);
+        jsCast<JSFunction*>(baseObject)->reifyLazyPropertyIfNeeded(vm, exec, propertyName);
+        RETURN_IF_EXCEPTION(scope, void());
+    }
+    if (result)
+        *result = baseObject->structure(vm);
+    baseObject->putDirect(vm, propertyName, value, slot);
+}
+
+static ALWAYS_INLINE void putDirectAccessorWithReify(VM& vm, ExecState* exec, JSObject* baseObject, PropertyName propertyName, GetterSetter* accessor, unsigned attribute)
+{
+    if (baseObject->inherits<JSFunction>(vm)) {
+        auto scope = DECLARE_THROW_SCOPE(vm);
+        jsCast<JSFunction*>(baseObject)->reifyLazyPropertyIfNeeded(vm, exec, propertyName);
+        RETURN_IF_EXCEPTION(scope, void());
+    }
+    baseObject->putDirectAccessor(exec, propertyName, accessor, attribute);
+}
+
 } // namespace CommonSlowPaths
 
 class ExecState;

Modified: trunk/Source/_javascript_Core/runtime/JSCell.cpp (231901 => 231902)


--- trunk/Source/_javascript_Core/runtime/JSCell.cpp	2018-05-17 16:03:27 UTC (rev 231901)
+++ trunk/Source/_javascript_Core/runtime/JSCell.cpp	2018-05-17 16:08:51 UTC (rev 231902)
@@ -64,11 +64,6 @@
     return cell->cellSize();
 }
 
-PropertyReificationResult JSCell::reifyPropertyNameIfNeeded(JSCell*, ExecState*, PropertyName&)
-{
-    return PropertyReificationResult::Nothing;
-}
-
 void JSCell::heapSnapshot(JSCell*, HeapSnapshotBuilder&)
 {
 }

Modified: trunk/Source/_javascript_Core/runtime/JSCell.h (231901 => 231902)


--- trunk/Source/_javascript_Core/runtime/JSCell.h	2018-05-17 16:03:27 UTC (rev 231901)
+++ trunk/Source/_javascript_Core/runtime/JSCell.h	2018-05-17 16:08:51 UTC (rev 231902)
@@ -57,12 +57,6 @@
     DoesNotHaveArg
 };
 
-enum class PropertyReificationResult {
-    Nothing,
-    Something,
-    TriedButFailed, // Sometimes the property name already exists but has special behavior and can't be reified, e.g. Array.length.
-};
-
 template<typename T> void* allocateCell(Heap&, size_t = sizeof(T));
 template<typename T> void* tryAllocateCell(Heap&, size_t = sizeof(T));
 template<typename T> void* allocateCell(Heap&, GCDeferralContext*, size_t = sizeof(T));
@@ -179,8 +173,6 @@
     static void visitChildren(JSCell*, SlotVisitor&);
     static void visitOutputConstraints(JSCell*, SlotVisitor&);
 
-    JS_EXPORT_PRIVATE static PropertyReificationResult reifyPropertyNameIfNeeded(JSCell*, ExecState*, PropertyName&);
-
     JS_EXPORT_PRIVATE static void heapSnapshot(JSCell*, HeapSnapshotBuilder&);
 
     // Object operations, with the toObject operation included.

Modified: trunk/Source/_javascript_Core/runtime/JSFunction.cpp (231901 => 231902)


--- trunk/Source/_javascript_Core/runtime/JSFunction.cpp	2018-05-17 16:03:27 UTC (rev 231901)
+++ trunk/Source/_javascript_Core/runtime/JSFunction.cpp	2018-05-17 16:08:51 UTC (rev 231902)
@@ -234,13 +234,6 @@
     visitor.append(thisObject->m_rareData);
 }
 
-PropertyReificationResult JSFunction::reifyPropertyNameIfNeeded(JSCell* cell, ExecState* exec, PropertyName& propertyName)
-{
-    JSFunction* thisObject = jsCast<JSFunction*>(cell);
-    PropertyStatus propertyType = thisObject->reifyLazyPropertyIfNeeded(exec->vm(), exec, propertyName);
-    return isReified(propertyType) ? PropertyReificationResult::Something : PropertyReificationResult::Nothing;
-}
-
 CallType JSFunction::getCallData(JSCell* cell, CallData& callData)
 {
     JSFunction* thisObject = jsCast<JSFunction*>(cell);

Modified: trunk/Source/_javascript_Core/runtime/JSFunction.h (231901 => 231902)


--- trunk/Source/_javascript_Core/runtime/JSFunction.h	2018-05-17 16:03:27 UTC (rev 231901)
+++ trunk/Source/_javascript_Core/runtime/JSFunction.h	2018-05-17 16:08:51 UTC (rev 231902)
@@ -156,6 +156,13 @@
     bool canUseAllocationProfile();
     bool canUseAllocationProfileNonInline();
 
+    enum class PropertyStatus {
+        Eager,
+        Lazy,
+        Reified,
+    };
+    PropertyStatus reifyLazyPropertyIfNeeded(VM&, ExecState*, PropertyName);
+
 protected:
     JS_EXPORT_PRIVATE JSFunction(VM&, JSGlobalObject*, Structure*);
     JSFunction(VM&, FunctionExecutable*, JSScope*, Structure*);
@@ -173,8 +180,6 @@
 
     static void visitChildren(JSCell*, SlotVisitor&);
 
-    static PropertyReificationResult reifyPropertyNameIfNeeded(JSCell*, ExecState*, PropertyName&);
-
 private:
     static JSFunction* createImpl(VM& vm, FunctionExecutable* executable, JSScope* scope, Structure* structure)
     {
@@ -194,15 +199,9 @@
     void reifyName(VM&, ExecState*);
     void reifyName(VM&, ExecState*, String name);
 
-    enum class PropertyStatus {
-        Eager,
-        Lazy,
-        Reified,
-    };
     static bool isLazy(PropertyStatus property) { return property == PropertyStatus::Lazy || property == PropertyStatus::Reified; }
     static bool isReified(PropertyStatus property) { return property == PropertyStatus::Reified; }
 
-    PropertyStatus reifyLazyPropertyIfNeeded(VM&, ExecState*, PropertyName);
     PropertyStatus reifyLazyPropertyForHostOrBuiltinIfNeeded(VM&, ExecState*, PropertyName);
     PropertyStatus reifyLazyLengthIfNeeded(VM&, ExecState*, PropertyName);
     PropertyStatus reifyLazyNameIfNeeded(VM&, ExecState*, PropertyName);

Modified: trunk/Source/_javascript_Core/runtime/JSObject.cpp (231901 => 231902)


--- trunk/Source/_javascript_Core/runtime/JSObject.cpp	2018-05-17 16:03:27 UTC (rev 231901)
+++ trunk/Source/_javascript_Core/runtime/JSObject.cpp	2018-05-17 16:08:51 UTC (rev 231902)
@@ -1752,14 +1752,14 @@
     return defineOwnProperty(this, exec, propertyName, descriptor, true);
 }
 
-bool JSObject::putDirectAccessor(ExecState* exec, PropertyName propertyName, JSValue value, unsigned attributes)
+bool JSObject::putDirectAccessor(ExecState* exec, PropertyName propertyName, GetterSetter* accessor, unsigned attributes)
 {
-    ASSERT(value.isGetterSetter() && (attributes & PropertyAttribute::Accessor));
+    ASSERT(attributes & PropertyAttribute::Accessor);
 
     if (std::optional<uint32_t> index = parseIndex(propertyName))
-        return putDirectIndex(exec, index.value(), value, attributes, PutDirectIndexLikePutDirect);
+        return putDirectIndex(exec, index.value(), accessor, attributes, PutDirectIndexLikePutDirect);
 
-    return putDirectNonIndexAccessor(exec->vm(), propertyName, value, attributes);
+    return putDirectNonIndexAccessor(exec->vm(), propertyName, accessor, attributes);
 }
 
 bool JSObject::putDirectCustomAccessor(VM& vm, PropertyName propertyName, JSValue value, unsigned attributes)
@@ -1778,10 +1778,10 @@
     return result;
 }
 
-bool JSObject::putDirectNonIndexAccessor(VM& vm, PropertyName propertyName, JSValue value, unsigned attributes)
+bool JSObject::putDirectNonIndexAccessor(VM& vm, PropertyName propertyName, GetterSetter* accessor, unsigned attributes)
 {
     PutPropertySlot slot(this);
-    bool result = putDirectInternal<PutModeDefineOwnProperty>(vm, propertyName, value, attributes, slot);
+    bool result = putDirectInternal<PutModeDefineOwnProperty>(vm, propertyName, accessor, attributes, slot);
 
     Structure* structure = this->structure(vm);
     if (attributes & PropertyAttribute::ReadOnly)

Modified: trunk/Source/_javascript_Core/runtime/JSObject.h (231901 => 231902)


--- trunk/Source/_javascript_Core/runtime/JSObject.h	2018-05-17 16:03:27 UTC (rev 231901)
+++ trunk/Source/_javascript_Core/runtime/JSObject.h	2018-05-17 16:08:51 UTC (rev 231902)
@@ -583,8 +583,8 @@
     bool putDirect(VM&, PropertyName, JSValue, unsigned attributes = 0);
     bool putDirect(VM&, PropertyName, JSValue, PutPropertySlot&);
     void putDirectWithoutTransition(VM&, PropertyName, JSValue, unsigned attributes = 0);
-    bool putDirectNonIndexAccessor(VM&, PropertyName, JSValue, unsigned attributes);
-    bool putDirectAccessor(ExecState*, PropertyName, JSValue, unsigned attributes);
+    bool putDirectNonIndexAccessor(VM&, PropertyName, GetterSetter*, unsigned attributes);
+    bool putDirectAccessor(ExecState*, PropertyName, GetterSetter*, unsigned attributes);
     JS_EXPORT_PRIVATE bool putDirectCustomAccessor(VM&, PropertyName, JSValue, unsigned attributes);
 
     bool putGetter(ExecState*, PropertyName, JSValue, unsigned attributes);

Modified: trunk/Source/_javascript_Core/runtime/JSObjectInlines.h (231901 => 231902)


--- trunk/Source/_javascript_Core/runtime/JSObjectInlines.h	2018-05-17 16:03:27 UTC (rev 231901)
+++ trunk/Source/_javascript_Core/runtime/JSObjectInlines.h	2018-05-17 16:08:51 UTC (rev 231902)
@@ -272,12 +272,6 @@
     ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));
     ASSERT(!parseIndex(propertyName));
 
-    switch (methodTable(vm)->reifyPropertyNameIfNeeded(this, globalObject(vm)->globalExec(), propertyName)) {
-    case PropertyReificationResult::Nothing: break;
-    case PropertyReificationResult::Something: break;
-    case PropertyReificationResult::TriedButFailed: RELEASE_ASSERT_NOT_REACHED();
-    }
-
     StructureID structureID = this->structureID();
     Structure* structure = vm.heap.structureIDTable().get(structureID);
     if (structure->isDictionary()) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to