WebKit Bugzilla
Attachment 340082 Details for
Bug 185350
: [JSC] Remove reifyPropertyNameIfNeeded
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185350-20180510204423.patch (text/plain), 27.60 KB, created by
Yusuke Suzuki
on 2018-05-10 04:44:24 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-05-10 04:44:24 PDT
Size:
27.60 KB
patch
obsolete
>Subversion Revision: 231637 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 377da6914089e0bf7c0a2bdeb283ebdcab6d3180..7ddc0d8a37e3c3fb7c32d5004ae638287e3285cd 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,50 @@ >+2018-05-10 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ [JSC] Remove reifyPropertyNameIfNeeded >+ https://bugs.webkit.org/show_bug.cgi?id=185350 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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 1%. And this patch does not cause regressions of the >+ existing tests. >+ >+ baseline patched >+ >+ object-assign.es6 391.8056+-9.2863 387.3729+-11.2013 might be 1.0114x 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-09 Caio Lima <ticaiolima@gmail.com> > > [ESNext][BigInt] Implement support for "==" operation >diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp b/Source/JavaScriptCore/dfg/DFGOperations.cpp >index 9c2f44b7869a0e92602ec148cb02a5e28b3842c2..905fc7b4b448f6902c80150cf4bdbb03f15279fe 100644 >--- a/Source/JavaScriptCore/dfg/DFGOperations.cpp >+++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp >@@ -138,12 +138,13 @@ ALWAYS_INLINE static void putByValInternal(ExecState* exec, VM& vm, EncodedJSVal > 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<CommonSlowPaths::RequireCacheStructreMode::No>(vm, exec, baseObject, propertyName, value, slot); > return; > } > scope.release(); >@@ -156,10 +157,12 @@ ALWAYS_INLINE static void putByValCellInternal(ExecState* exec, VM& vm, JSCell* > 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<CommonSlowPaths::RequireCacheStructreMode::No>(vm, exec, baseObject, propertyName, value, slot); > return; > } > base->putInline(exec, propertyName, value, slot); >@@ -822,7 +825,7 @@ void JIT_OPERATION operationPutDoubleByValDirectBeyondArrayBoundsStrict(ExecStat > } > > PutPropertySlot slot(object, true); >- object->putDirect(vm, Identifier::from(exec, index), jsValue, slot); >+ CommonSlowPaths::putDirectWithReify<CommonSlowPaths::RequireCacheStructreMode::No>(vm, exec, object, Identifier::from(exec, index), jsValue, slot); > } > > void JIT_OPERATION operationPutDoubleByValDirectBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* object, int32_t index, double value) >@@ -838,7 +841,7 @@ void JIT_OPERATION operationPutDoubleByValDirectBeyondArrayBoundsNonStrict(ExecS > } > > PutPropertySlot slot(object, false); >- object->putDirect(vm, Identifier::from(exec, index), jsValue, slot); >+ CommonSlowPaths::putDirectWithReify<CommonSlowPaths::RequireCacheStructreMode::No>(vm, exec, object, Identifier::from(exec, index), jsValue, slot); > } > > void JIT_OPERATION operationPutByValDirectStrict(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) >@@ -915,7 +918,7 @@ void JIT_OPERATION operationPutByValDirectBeyondArrayBoundsStrict(ExecState* exe > } > > PutPropertySlot slot(object, true); >- object->putDirect(vm, Identifier::from(exec, index), JSValue::decode(encodedValue), slot); >+ CommonSlowPaths::putDirectWithReify<CommonSlowPaths::RequireCacheStructreMode::No>(vm, exec, object, Identifier::from(exec, index), JSValue::decode(encodedValue), slot); > } > > void JIT_OPERATION operationPutByValDirectBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* object, int32_t index, EncodedJSValue encodedValue) >@@ -929,7 +932,7 @@ void JIT_OPERATION operationPutByValDirectBeyondArrayBoundsNonStrict(ExecState* > } > > PutPropertySlot slot(object, false); >- object->putDirect(vm, Identifier::from(exec, index), JSValue::decode(encodedValue), slot); >+ CommonSlowPaths::putDirectWithReify<CommonSlowPaths::RequireCacheStructreMode::No>(vm, exec, object, Identifier::from(exec, index), JSValue::decode(encodedValue), slot); > } > > EncodedJSValue JIT_OPERATION operationArrayPush(ExecState* exec, EncodedJSValue encodedValue, JSArray* array) >diff --git a/Source/JavaScriptCore/jit/JITOperations.cpp b/Source/JavaScriptCore/jit/JITOperations.cpp >index 365bb73755a7a454cf085436c6378d1bf73fec4b..7d3b9bf42ce5cc1271f5fbc20107df6dc3f4b93e 100644 >--- a/Source/JavaScriptCore/jit/JITOperations.cpp >+++ b/Source/JavaScriptCore/jit/JITOperations.cpp >@@ -474,32 +474,32 @@ void JIT_OPERATION operationPutByIdDirectStrict(ExecState* exec, StructureStubIn > { > 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<CommonSlowPaths::RequireCacheStructreMode::No>(vm, exec, asObject(baseValue), ident, JSValue::decode(encodedValue), slot); > } > > void JIT_OPERATION operationPutByIdDirectNonStrict(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid) > { > 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<CommonSlowPaths::RequireCacheStructreMode::No>(vm, exec, asObject(baseValue), ident, JSValue::decode(encodedValue), slot); > } > > void JIT_OPERATION operationPutByIdStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid) >@@ -562,20 +562,20 @@ void JIT_OPERATION operationPutByIdDirectStrictOptimize(ExecState* exec, Structu > { > 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 = baseObject->structure(*vm); >- baseObject->putDirect(*vm, ident, value, slot); >+ Structure* structure = CommonSlowPaths::putDirectWithReify<CommonSlowPaths::RequireCacheStructreMode::Yes>(vm, exec, baseObject, ident, value, slot); >+ RETURN_IF_EXCEPTION(scope, void()); > > if (accessType != static_cast<AccessType>(stubInfo->accessType)) > return; >@@ -588,20 +588,20 @@ void JIT_OPERATION operationPutByIdDirectNonStrictOptimize(ExecState* exec, Stru > { > 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 = baseObject->structure(*vm); >- baseObject->putDirect(*vm, ident, value, slot); >+ Structure* structure = CommonSlowPaths::putDirectWithReify<CommonSlowPaths::RequireCacheStructreMode::Yes>(vm, exec, baseObject, ident, value, slot); >+ RETURN_IF_EXCEPTION(scope, void()); > > if (accessType != static_cast<AccessType>(stubInfo->accessType)) > return; >@@ -710,7 +710,7 @@ static void directPutByVal(CallFrame* callFrame, JSObject* baseObject, JSValue s > byValInfo->tookSlowPath = true; > > PutPropertySlot slot(baseObject, isStrictMode); >- baseObject->putDirect(vm, property, value, slot); >+ CommonSlowPaths::putDirectWithReify<CommonSlowPaths::RequireCacheStructreMode::No>(vm, callFrame, baseObject, property, value, slot); > } > > enum class OptimizationResult { >@@ -1745,7 +1745,7 @@ void JIT_OPERATION operationPutGetterSetter(ExecState* exec, JSCell* object, Uni > 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 +1759,7 @@ void JIT_OPERATION operationPutGetterSetter(ExecState* exec, JSCell* object, Uni > 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 >@@ -1781,7 +1781,7 @@ void JIT_OPERATION operationPutGetterSetter(ExecState* exec, JSCell* object, Uni > 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 > >diff --git a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp >index 817e6c930b12ca1f1d4fe6e2424c0e7d1e4001d6..f650412ee61fd8ce3fdac5f7b8518c81e2fc8168 100644 >--- a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp >+++ b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp >@@ -723,7 +723,7 @@ LLINT_SLOW_PATH_DECL(slow_path_put_by_id) > 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<CommonSlowPaths::RequireCacheStructreMode::No>(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(); >@@ -940,7 +940,7 @@ LLINT_SLOW_PATH_DECL(slow_path_put_by_val_direct) > baseObject->putDirectIndex(exec, index.value(), value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow); > else { > PutPropertySlot slot(baseObject, isStrictMode); >- baseObject->putDirect(vm, property, value, slot); >+ CommonSlowPaths::putDirectWithReify<CommonSlowPaths::RequireCacheStructreMode::No>(vm, exec, baseObject, property, value, slot); > } > LLINT_END(); > } >@@ -1007,7 +1007,7 @@ LLINT_SLOW_PATH_DECL(slow_path_put_getter_setter_by_id) > { > 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(); >@@ -1022,10 +1022,7 @@ LLINT_SLOW_PATH_DECL(slow_path_put_getter_setter_by_id) > 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(); > } > >diff --git a/Source/JavaScriptCore/runtime/ClassInfo.h b/Source/JavaScriptCore/runtime/ClassInfo.h >index 687bd9ae9ceff3065128c1d4739a4ceb7f2aab0b..42b39e1c68d3ed610a202681ff5acd45d6661300 100644 >--- a/Source/JavaScriptCore/runtime/ClassInfo.h >+++ b/Source/JavaScriptCore/runtime/ClassInfo.h >@@ -130,9 +130,6 @@ struct MethodTable { > > 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 @@ struct MethodTable { > &ClassName::heapSnapshot, \ > &ClassName::estimatedSize, \ > &ClassName::visitOutputConstraints, \ >- &ClassName::reifyPropertyNameIfNeeded, \ > }, \ > ClassName::TypedArrayStorageType > >diff --git a/Source/JavaScriptCore/runtime/CommonSlowPaths.h b/Source/JavaScriptCore/runtime/CommonSlowPaths.h >index 2549f6caec2374da3ef426811a1db0370ec1dbba..8aa56929588cd70cd44d7d124207d0cc1cc31dce 100644 >--- a/Source/JavaScriptCore/runtime/CommonSlowPaths.h >+++ b/Source/JavaScriptCore/runtime/CommonSlowPaths.h >@@ -225,6 +225,32 @@ inline bool canAccessArgumentIndexQuickly(JSObject& object, uint32_t index) > return false; > } > >+enum class RequireCacheStructreMode { Yes, No }; >+template<RequireCacheStructreMode mode> >+static ALWAYS_INLINE Structure* putDirectWithReify(VM& vm, ExecState* exec, JSObject* baseObject, PropertyName propertyName, JSValue value, PutPropertySlot& slot) >+{ >+ if (baseObject->inherits<JSFunction>(vm)) { >+ auto scope = DECLARE_THROW_SCOPE(vm); >+ jsCast<JSFunction*>(baseObject)->reifyLazyPropertyIfNeeded(vm, exec, propertyName); >+ RETURN_IF_EXCEPTION(scope, nullptr); >+ } >+ Structure* result = nullptr; >+ if (mode == RequireCacheStructreMode::Yes) >+ result = baseObject->structure(vm); >+ baseObject->putDirect(vm, propertyName, value, slot); >+ return result; >+} >+ >+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; >diff --git a/Source/JavaScriptCore/runtime/JSCell.cpp b/Source/JavaScriptCore/runtime/JSCell.cpp >index 68bebd699221a6b5b9df18076ad2250ca32bce66..1d0b5cc7cb82c84f317992355e85348e052d94ac 100644 >--- a/Source/JavaScriptCore/runtime/JSCell.cpp >+++ b/Source/JavaScriptCore/runtime/JSCell.cpp >@@ -64,11 +64,6 @@ size_t JSCell::estimatedSize(JSCell* cell) > return cell->cellSize(); > } > >-PropertyReificationResult JSCell::reifyPropertyNameIfNeeded(JSCell*, ExecState*, PropertyName&) >-{ >- return PropertyReificationResult::Nothing; >-} >- > void JSCell::heapSnapshot(JSCell*, HeapSnapshotBuilder&) > { > } >diff --git a/Source/JavaScriptCore/runtime/JSCell.h b/Source/JavaScriptCore/runtime/JSCell.h >index f8d5ac955f1b65ea2897ea88471bd106ae016741..d69a1fb4965a5a1eb9682267c5e36cfc4f1d7512 100644 >--- a/Source/JavaScriptCore/runtime/JSCell.h >+++ b/Source/JavaScriptCore/runtime/JSCell.h >@@ -57,12 +57,6 @@ enum class GCDeferralContextArgPresense { > 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)); >@@ -177,8 +171,6 @@ class JSCell : public HeapCell { > 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. >diff --git a/Source/JavaScriptCore/runtime/JSFunction.cpp b/Source/JavaScriptCore/runtime/JSFunction.cpp >index deb1a67e266d06c1166c363eacc490577542a3e6..c8cf513dd59c2438cd6f4a02be4f5aee57dafd8f 100644 >--- a/Source/JavaScriptCore/runtime/JSFunction.cpp >+++ b/Source/JavaScriptCore/runtime/JSFunction.cpp >@@ -233,13 +233,6 @@ void JSFunction::visitChildren(JSCell* cell, SlotVisitor& visitor) > 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); >diff --git a/Source/JavaScriptCore/runtime/JSFunction.h b/Source/JavaScriptCore/runtime/JSFunction.h >index 0350d8cd46eccb5b8301ae2239c86b32fcb9c76e..74a4a87d1f072f0bfb7235674eeb420bffa59704 100644 >--- a/Source/JavaScriptCore/runtime/JSFunction.h >+++ b/Source/JavaScriptCore/runtime/JSFunction.h >@@ -156,6 +156,13 @@ class JSFunction : public JSCallee { > 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 @@ class JSFunction : public JSCallee { > > 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 @@ class JSFunction : public JSCallee { > 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); >diff --git a/Source/JavaScriptCore/runtime/JSObject.cpp b/Source/JavaScriptCore/runtime/JSObject.cpp >index 2ac12d9e9a07150683696612f048b56bf628c358..d84f9931e01989a3632b3f8dcd46c79e839207dd 100644 >--- a/Source/JavaScriptCore/runtime/JSObject.cpp >+++ b/Source/JavaScriptCore/runtime/JSObject.cpp >@@ -1752,14 +1752,14 @@ bool JSObject::putSetter(ExecState* exec, PropertyName propertyName, JSValue set > 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 @@ bool JSObject::putDirectCustomAccessor(VM& vm, PropertyName propertyName, JSValu > 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) >diff --git a/Source/JavaScriptCore/runtime/JSObject.h b/Source/JavaScriptCore/runtime/JSObject.h >index c2eb8e6936429f4f6acef77754bf636d33ea3674..468b214f7aa93be8f59f4273814913dcb97af8c9 100644 >--- a/Source/JavaScriptCore/runtime/JSObject.h >+++ b/Source/JavaScriptCore/runtime/JSObject.h >@@ -583,8 +583,8 @@ class JSObject : public JSCell { > 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); >diff --git a/Source/JavaScriptCore/runtime/JSObjectInlines.h b/Source/JavaScriptCore/runtime/JSObjectInlines.h >index b3f278614d900f5c867f7528d04183081b365499..ffa58c44ff0fcb624319ca329e920fd236d7133e 100644 >--- a/Source/JavaScriptCore/runtime/JSObjectInlines.h >+++ b/Source/JavaScriptCore/runtime/JSObjectInlines.h >@@ -268,12 +268,6 @@ ALWAYS_INLINE bool JSObject::putDirectInternal(VM& vm, PropertyName propertyName > 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()) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185350
:
340081
|
340082
|
340083
|
340170
|
340482
|
340515