It should be easier to reify lazy property names
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Nov 2017 19:08:37 +0000 (19:08 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Nov 2017 19:08:37 +0000 (19:08 +0000)
commit30b2383931254165f01268c5683c662406e6c65f
tree514eafae7c48b4fbcbda286fcb38f040925df20e
parent4a52c0936615db983da771c6951233ba6a900278
It should be easier to reify lazy property names
https://bugs.webkit.org/show_bug.cgi?id=179734
<rdar://problem/35492521>

Reviewed by Keith Miller.

We reify lazy property names in a few different ways, each
specific to the JSCell implementation, in put() instead of having
a special function to do reification. Let's make that simpler.

This patch makes it easier to reify property names in a uniform
manner, and does so in JSFunction. As a follow up I'll use the
same mechanics for:

ClonedArguments   callee, iteratorSymbol (Symbol.iterator)
ErrorConstructor  stackTraceLimit
ErrorInstance     line, column, sourceURL, stack
GenericArguments  length, callee, iteratorSymbol (Symbol.iterator)
GetterSetter      RELEASE_ASSERT_NOT_REACHED()
JSArray           length
RegExpObject      lastIndex
StringObject      length

* runtime/ClassInfo.h: Add reifyPropertyNameIfNeeded to method table.
* runtime/JSCell.cpp:
(JSC::JSCell::reifyPropertyNameIfNeeded): by default, don't reify.
* runtime/JSCell.h:
* runtime/JSFunction.cpp: `name` and `length` can be reified.
(JSC::JSFunction::reifyPropertyNameIfNeeded):
(JSC::JSFunction::put):
(JSC::JSFunction::reifyLength):
(JSC::JSFunction::reifyName):
(JSC::JSFunction::reifyLazyPropertyIfNeeded):
(JSC::JSFunction::reifyLazyPropertyForHostOrBuiltinIfNeeded):
(JSC::JSFunction::reifyLazyLengthIfNeeded):
(JSC::JSFunction::reifyLazyNameIfNeeded):
(JSC::JSFunction::reifyLazyBoundNameIfNeeded):
* runtime/JSFunction.h:
(JSC::JSFunction::isLazy):
(JSC::JSFunction::isReified):
* runtime/JSObjectInlines.h:
(JSC::JSObject::putDirectInternal): do the reification here.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224927 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/ClassInfo.h
Source/JavaScriptCore/runtime/JSCell.cpp
Source/JavaScriptCore/runtime/JSCell.h
Source/JavaScriptCore/runtime/JSFunction.cpp
Source/JavaScriptCore/runtime/JSFunction.h
Source/JavaScriptCore/runtime/JSObjectInlines.h