Ignore:
Timestamp:
Mar 2, 2016, 2:39:02 PM (9 years ago)
Author:
[email protected]
Message:

SetPrototypeOf should be a fully virtual method in ClassInfo::methodTable
https://bugs.webkit.org/show_bug.cgi?id=154897

Reviewed by Filip Pizlo.

This patch makes us more consistent with how the ES6 specification models the
SetPrototypeOf trap. Moving this method into ClassInfo::methodTable
is a prerequisite for implementing Proxy.SetPrototypeOf. This patch
still allows directly setting the prototype for situations where this
is the desired behavior. This is equivalent to setting the internal
Prototype field as described in the specification.

  • API/JSClassRef.cpp:

(OpaqueJSClass::prototype):

  • API/JSObjectRef.cpp:

(JSObjectMake):
(JSObjectSetPrototype):
(JSObjectHasProperty):

  • API/JSWrapperMap.mm:

(makeWrapper):

  • runtime/ClassInfo.h:
  • runtime/IntlCollatorConstructor.cpp:

(JSC::constructIntlCollator):

  • runtime/IntlDateTimeFormatConstructor.cpp:

(JSC::constructIntlDateTimeFormat):

  • runtime/IntlNumberFormatConstructor.cpp:

(JSC::constructIntlNumberFormat):

  • runtime/JSCell.cpp:

(JSC::JSCell::isExtensible):
(JSC::JSCell::setPrototypeOf):

  • runtime/JSCell.h:
  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::resetPrototype):

  • runtime/JSGlobalObjectFunctions.cpp:

(JSC::globalFuncProtoSetter):

  • runtime/JSObject.cpp:

(JSC::JSObject::switchToSlowPutArrayStorage):
(JSC::JSObject::setPrototypeDirect):
(JSC::JSObject::setPrototypeWithCycleCheck):
(JSC::JSObject::setPrototypeOf):
(JSC::JSObject::allowsAccessFrom):
(JSC::JSObject::setPrototype): Deleted.

  • runtime/JSObject.h:

(JSC::JSObject::setPrototypeOfInline):
(JSC::JSObject::mayInterceptIndexedAccesses):

  • runtime/JSProxy.cpp:

(JSC::JSProxy::setTarget):

  • runtime/ObjectConstructor.cpp:

(JSC::objectConstructorSetPrototypeOf):

  • runtime/ReflectObject.cpp:

(JSC::reflectObjectSetPrototypeOf):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/ClassInfo.h

    r197412 r197467  
    109109    typedef bool (*IsExtensibleFunctionPtr)(JSObject*, ExecState*);
    110110    IsExtensibleFunctionPtr isExtensible;
     111
     112    typedef bool (*SetPrototypeOfFunctionPtr)(JSObject*, ExecState*, JSValue);
     113    SetPrototypeOfFunctionPtr setPrototypeOf;
    111114
    112115    typedef void (*DumpToStreamFunctionPtr)(const JSCell*, PrintStream&);
     
    163166        &ClassName::preventExtensions, \
    164167        &ClassName::isExtensible, \
     168        &ClassName::setPrototypeOf, \
    165169        &ClassName::dumpToStream, \
    166170        &ClassName::estimatedSize \
Note: See TracChangeset for help on using the changeset viewer.