Changeset 241644 in webkit


Ignore:
Timestamp:
Feb 15, 2019 11:41:20 PM (5 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Remove unused global private variables
https://bugs.webkit.org/show_bug.cgi?id=194741

Reviewed by Joseph Pecoraro.

There are some private functions and constants that are no longer referenced from builtin JS code.
This patch cleans up them.

  • builtins/BuiltinNames.h:
  • builtins/ObjectConstructor.js:

(entries):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init):

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r241640 r241644  
     12019-02-15  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Remove unused global private variables
     4        https://bugs.webkit.org/show_bug.cgi?id=194741
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        There are some private functions and constants that are no longer referenced from builtin JS code.
     9        This patch cleans up them.
     10
     11        * builtins/BuiltinNames.h:
     12        * builtins/ObjectConstructor.js:
     13        (entries):
     14        * runtime/JSGlobalObject.cpp:
     15        (JSC::JSGlobalObject::init):
     16
    1172019-02-15  Yusuke Suzuki  <ysuzuki@apple.com>
    218
  • trunk/Source/JavaScriptCore/builtins/BuiltinNames.h

    r241104 r241644  
    6363    macro(Array) \
    6464    macro(ArrayBuffer) \
    65     macro(String) \
    6665    macro(RegExp) \
    67     macro(Map) \
    6866    macro(Promise) \
    6967    macro(Reflect) \
    7068    macro(InternalPromise) \
    71     macro(abs) \
    72     macro(floor) \
    7369    macro(trunc) \
    7470    macro(create) \
     
    183179    macro(importModule) \
    184180    macro(propertyIsEnumerable) \
    185     macro(WebAssembly) \
    186     macro(Module) \
    187     macro(Instance) \
    188     macro(Memory) \
    189     macro(Table) \
    190     macro(CompileError) \
    191     macro(LinkError) \
    192     macro(RuntimeError) \
    193181    macro(meta) \
    194182    macro(webAssemblyCompileStreamingInternal) \
  • trunk/Source/JavaScriptCore/builtins/ObjectConstructor.js

    r235589 r241644  
    3131
    3232    var obj = @toObject(object, "Object.entries requires that input parameter not be null or undefined");
    33     var names = @getOwnPropertyNames(obj);
     33    var names = @Object.@getOwnPropertyNames(obj);
    3434    var properties = [];
    3535    for (var i = 0, length = names.length; i < length; ++i) {
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r241640 r241644  
    817817    JSFunction* builtinDescribe = JSFunction::create(vm, this, 1, vm.propertyNames->emptyIdentifier.string(), globalFuncBuiltinDescribe);
    818818
    819     JSFunction* privateFuncAbs = JSFunction::create(vm, this, 0, String(), mathProtoFuncAbs, AbsIntrinsic);
    820     JSFunction* privateFuncFloor = JSFunction::create(vm, this, 0, String(), mathProtoFuncFloor, FloorIntrinsic);
    821819    JSFunction* privateFuncTrunc = JSFunction::create(vm, this, 0, String(), mathProtoFuncTrunc, TruncIntrinsic);
    822820
    823     JSFunction* privateFuncGetOwnPropertyNames = JSFunction::create(vm, this, 0, String(), objectConstructorGetOwnPropertyNames);
    824821    JSFunction* privateFuncPropertyIsEnumerable = JSFunction::create(vm, this, 0, String(), globalFuncPropertyIsEnumerable);
    825822    JSFunction* privateFuncImportModule = JSFunction::create(vm, this, 0, String(), globalFuncImportModule);
     
    890887        GlobalPropertyInfo(vm.propertyNames->Infinity, jsNumber(std::numeric_limits<double>::infinity()), PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
    891888        GlobalPropertyInfo(vm.propertyNames->undefinedKeyword, jsUndefined(), PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
    892         GlobalPropertyInfo(vm.propertyNames->builtinNames().getOwnPropertyNamesPrivateName(), privateFuncGetOwnPropertyNames, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
    893889        GlobalPropertyInfo(vm.propertyNames->builtinNames().propertyIsEnumerablePrivateName(), privateFuncPropertyIsEnumerable, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
    894890        GlobalPropertyInfo(vm.propertyNames->builtinNames().importModulePrivateName(), privateFuncImportModule, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
     
    908904        GlobalPropertyInfo(vm.propertyNames->builtinNames().BuiltinDescribePrivateName(), builtinDescribe, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
    909905        GlobalPropertyInfo(vm.propertyNames->builtinNames().RegExpPrivateName(), regExpConstructor, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
    910         GlobalPropertyInfo(vm.propertyNames->builtinNames().StringPrivateName(), stringConstructor, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
    911         GlobalPropertyInfo(vm.propertyNames->builtinNames().absPrivateName(), privateFuncAbs, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
    912         GlobalPropertyInfo(vm.propertyNames->builtinNames().floorPrivateName(), privateFuncFloor, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
    913906        GlobalPropertyInfo(vm.propertyNames->builtinNames().truncPrivateName(), privateFuncTrunc, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
    914907        GlobalPropertyInfo(vm.propertyNames->builtinNames().PromisePrivateName(), promiseConstructor, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
     
    925918        GlobalPropertyInfo(vm.propertyNames->builtinNames().hostPromiseRejectionTrackerPrivateName(), JSFunction::create(vm, this, 2, String(), globalFuncHostPromiseRejectionTracker), PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
    926919        GlobalPropertyInfo(vm.propertyNames->builtinNames().InspectorInstrumentationPrivateName(), InspectorInstrumentationObject::create(vm, this, InspectorInstrumentationObject::createStructure(vm, this, m_objectPrototype.get())), PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
    927         GlobalPropertyInfo(vm.propertyNames->builtinNames().MapPrivateName(), mapConstructor, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
    928920        GlobalPropertyInfo(vm.propertyNames->builtinNames().SetPrivateName(), setConstructor, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
    929921        GlobalPropertyInfo(vm.propertyNames->builtinNames().thisTimeValuePrivateName(), privateFuncThisTimeValue, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
Note: See TracChangeset for help on using the changeset viewer.