Changeset 230455 in webkit


Ignore:
Timestamp:
Apr 9, 2018, 4:44:56 PM (7 years ago)
Author:
mark.lam@apple.com
Message:

Decorate method table entries to support pointer profiling.
https://bugs.webkit.org/show_bug.cgi?id=184430
<rdar://problem/39296190>

Reviewed by Saam Barati.

Source/JavaScriptCore:

  • runtime/ClassInfo.h:

Source/WTF:

  • wtf/PointerPreparations.h:
Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r230450 r230455  
     12018-04-09  Mark Lam  <mark.lam@apple.com>
     2
     3        Decorate method table entries to support pointer profiling.
     4        https://bugs.webkit.org/show_bug.cgi?id=184430
     5        <rdar://problem/39296190>
     6
     7        Reviewed by Saam Barati.
     8
     9        * runtime/ClassInfo.h:
     10
    1112018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
    212
  • trunk/Source/JavaScriptCore/runtime/ClassInfo.h

    r228500 r230455  
    22 *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
    33 *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
    4  *  Copyright (C) 2003-2017 Apple Inc. All rights reserved.
     4 *  Copyright (C) 2003-2018 Apple Inc. All rights reserved.
    55 *
    66 *  This library is free software; you can redistribute it and/or
     
    4040struct MethodTable {
    4141    using DestroyFunctionPtr = void (*)(JSCell*);
    42     DestroyFunctionPtr destroy;
     42    DestroyFunctionPtr WTF_METHOD_TABLE_ENTRY(destroy);
    4343
    4444    using VisitChildrenFunctionPtr = void (*)(JSCell*, SlotVisitor&);
    45     VisitChildrenFunctionPtr visitChildren;
     45    VisitChildrenFunctionPtr WTF_METHOD_TABLE_ENTRY(visitChildren);
    4646
    4747    using GetCallDataFunctionPtr = CallType (*)(JSCell*, CallData&);
    48     GetCallDataFunctionPtr getCallData;
     48    GetCallDataFunctionPtr WTF_METHOD_TABLE_ENTRY(getCallData);
    4949
    5050    using GetConstructDataFunctionPtr = ConstructType (*)(JSCell*, ConstructData&);
    51     GetConstructDataFunctionPtr getConstructData;
     51    GetConstructDataFunctionPtr WTF_METHOD_TABLE_ENTRY(getConstructData);
    5252
    5353    using PutFunctionPtr = bool (*)(JSCell*, ExecState*, PropertyName propertyName, JSValue, PutPropertySlot&);
    54     PutFunctionPtr put;
     54    PutFunctionPtr WTF_METHOD_TABLE_ENTRY(put);
    5555
    5656    using PutByIndexFunctionPtr = bool (*)(JSCell*, ExecState*, unsigned propertyName, JSValue, bool shouldThrow);
    57     PutByIndexFunctionPtr putByIndex;
     57    PutByIndexFunctionPtr WTF_METHOD_TABLE_ENTRY(putByIndex);
    5858
    5959    using DeletePropertyFunctionPtr = bool (*)(JSCell*, ExecState*, PropertyName);
    60     DeletePropertyFunctionPtr deleteProperty;
     60    DeletePropertyFunctionPtr WTF_METHOD_TABLE_ENTRY(deleteProperty);
    6161
    6262    using DeletePropertyByIndexFunctionPtr = bool (*)(JSCell*, ExecState*, unsigned);
    63     DeletePropertyByIndexFunctionPtr deletePropertyByIndex;
     63    DeletePropertyByIndexFunctionPtr WTF_METHOD_TABLE_ENTRY(deletePropertyByIndex);
    6464
    6565    using GetOwnPropertySlotFunctionPtr = bool (*)(JSObject*, ExecState*, PropertyName, PropertySlot&);
    66     GetOwnPropertySlotFunctionPtr getOwnPropertySlot;
     66    GetOwnPropertySlotFunctionPtr WTF_METHOD_TABLE_ENTRY(getOwnPropertySlot);
    6767
    6868    using GetOwnPropertySlotByIndexFunctionPtr = bool (*)(JSObject*, ExecState*, unsigned, PropertySlot&);
    69     GetOwnPropertySlotByIndexFunctionPtr getOwnPropertySlotByIndex;
     69    GetOwnPropertySlotByIndexFunctionPtr WTF_METHOD_TABLE_ENTRY(getOwnPropertySlotByIndex);
    7070
    7171    using ToThisFunctionPtr = JSValue (*)(JSCell*, ExecState*, ECMAMode);
    72     ToThisFunctionPtr toThis;
     72    ToThisFunctionPtr WTF_METHOD_TABLE_ENTRY(toThis);
    7373
    7474    using DefaultValueFunctionPtr = JSValue (*)(const JSObject*, ExecState*, PreferredPrimitiveType);
    75     DefaultValueFunctionPtr defaultValue;
     75    DefaultValueFunctionPtr WTF_METHOD_TABLE_ENTRY(defaultValue);
    7676
    7777    using GetOwnPropertyNamesFunctionPtr = void (*)(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
    78     GetOwnPropertyNamesFunctionPtr getOwnPropertyNames;
     78    GetOwnPropertyNamesFunctionPtr WTF_METHOD_TABLE_ENTRY(getOwnPropertyNames);
    7979
    8080    using GetOwnNonIndexPropertyNamesFunctionPtr = void (*)(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
    81     GetOwnNonIndexPropertyNamesFunctionPtr getOwnNonIndexPropertyNames;
     81    GetOwnNonIndexPropertyNamesFunctionPtr WTF_METHOD_TABLE_ENTRY(getOwnNonIndexPropertyNames);
    8282
    8383    using GetPropertyNamesFunctionPtr = void (*)(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
    84     GetPropertyNamesFunctionPtr getPropertyNames;
     84    GetPropertyNamesFunctionPtr WTF_METHOD_TABLE_ENTRY(getPropertyNames);
    8585
    8686    using GetEnumerableLengthFunctionPtr = uint32_t (*)(ExecState*, JSObject*);
    87     GetEnumerableLengthFunctionPtr getEnumerableLength;
    88 
    89     GetPropertyNamesFunctionPtr getStructurePropertyNames;
    90     GetPropertyNamesFunctionPtr getGenericPropertyNames;
     87    GetEnumerableLengthFunctionPtr WTF_METHOD_TABLE_ENTRY(getEnumerableLength);
     88
     89    GetPropertyNamesFunctionPtr WTF_METHOD_TABLE_ENTRY(getStructurePropertyNames);
     90    GetPropertyNamesFunctionPtr WTF_METHOD_TABLE_ENTRY(getGenericPropertyNames);
    9191
    9292    using ClassNameFunctionPtr = String (*)(const JSObject*);
    93     ClassNameFunctionPtr className;
     93    ClassNameFunctionPtr WTF_METHOD_TABLE_ENTRY(className);
    9494
    9595    using ToStringNameFunctionPtr = String (*)(const JSObject*, ExecState*);
    96     ToStringNameFunctionPtr toStringName;
     96    ToStringNameFunctionPtr WTF_METHOD_TABLE_ENTRY(toStringName);
    9797
    9898    using CustomHasInstanceFunctionPtr = bool (*)(JSObject*, ExecState*, JSValue);
    99     CustomHasInstanceFunctionPtr customHasInstance;
     99    CustomHasInstanceFunctionPtr WTF_METHOD_TABLE_ENTRY(customHasInstance);
    100100
    101101    using DefineOwnPropertyFunctionPtr = bool (*)(JSObject*, ExecState*, PropertyName, const PropertyDescriptor&, bool);
    102     DefineOwnPropertyFunctionPtr defineOwnProperty;
     102    DefineOwnPropertyFunctionPtr WTF_METHOD_TABLE_ENTRY(defineOwnProperty);
    103103
    104104    using SlowDownAndWasteMemory = ArrayBuffer* (*)(JSArrayBufferView*);
    105     SlowDownAndWasteMemory slowDownAndWasteMemory;
     105    SlowDownAndWasteMemory WTF_METHOD_TABLE_ENTRY(slowDownAndWasteMemory);
    106106
    107107    using GetTypedArrayImpl = RefPtr<ArrayBufferView> (*)(JSArrayBufferView*);
    108     GetTypedArrayImpl getTypedArrayImpl;
     108    GetTypedArrayImpl WTF_METHOD_TABLE_ENTRY(getTypedArrayImpl);
    109109
    110110    using PreventExtensionsFunctionPtr = bool (*)(JSObject*, ExecState*);
    111     PreventExtensionsFunctionPtr preventExtensions;
     111    PreventExtensionsFunctionPtr WTF_METHOD_TABLE_ENTRY(preventExtensions);
    112112
    113113    using IsExtensibleFunctionPtr = bool (*)(JSObject*, ExecState*);
    114     IsExtensibleFunctionPtr isExtensible;
     114    IsExtensibleFunctionPtr WTF_METHOD_TABLE_ENTRY(isExtensible);
    115115
    116116    using SetPrototypeFunctionPtr = bool (*)(JSObject*, ExecState*, JSValue, bool shouldThrowIfCantSet);
    117     SetPrototypeFunctionPtr setPrototype;
     117    SetPrototypeFunctionPtr WTF_METHOD_TABLE_ENTRY(setPrototype);
    118118
    119119    using GetPrototypeFunctionPtr = JSValue (*)(JSObject*, ExecState*);
    120     GetPrototypeFunctionPtr getPrototype;
     120    GetPrototypeFunctionPtr WTF_METHOD_TABLE_ENTRY(getPrototype);
    121121
    122122    using DumpToStreamFunctionPtr = void (*)(const JSCell*, PrintStream&);
    123     DumpToStreamFunctionPtr dumpToStream;
     123    DumpToStreamFunctionPtr WTF_METHOD_TABLE_ENTRY(dumpToStream);
    124124
    125125    using HeapSnapshotFunctionPtr = void (*)(JSCell*, HeapSnapshotBuilder&);
    126     HeapSnapshotFunctionPtr heapSnapshot;
     126    HeapSnapshotFunctionPtr WTF_METHOD_TABLE_ENTRY(heapSnapshot);
    127127
    128128    using EstimatedSizeFunctionPtr = size_t (*)(JSCell*);
    129     EstimatedSizeFunctionPtr estimatedSize;
     129    EstimatedSizeFunctionPtr WTF_METHOD_TABLE_ENTRY(estimatedSize);
    130130
    131131    using VisitOutputConstraintsPtr = void (*)(JSCell*, SlotVisitor&);
    132     VisitOutputConstraintsPtr visitOutputConstraints;
     132    VisitOutputConstraintsPtr WTF_METHOD_TABLE_ENTRY(visitOutputConstraints);
    133133
    134134    using ReifyPropertyNameIfNeededPtr = PropertyReificationResult (*)(JSCell*, ExecState*, PropertyName&);
    135     ReifyPropertyNameIfNeededPtr reifyPropertyNameIfNeeded;
     135    ReifyPropertyNameIfNeededPtr WTF_METHOD_TABLE_ENTRY(reifyPropertyNameIfNeeded);
    136136};
    137137
  • trunk/Source/WTF/ChangeLog

    r230381 r230455  
     12018-04-09  Mark Lam  <mark.lam@apple.com>
     2
     3        Decorate method table entries to support pointer profiling.
     4        https://bugs.webkit.org/show_bug.cgi?id=184430
     5        <rdar://problem/39296190>
     6
     7        Reviewed by Saam Barati.
     8
     9        * wtf/PointerPreparations.h:
     10
    1112018-04-08  Yusuke Suzuki  <utatane.tea@gmail.com>
    212
  • trunk/Source/WTF/wtf/PointerPreparations.h

    r230129 r230455  
    3838#endif
    3939
     40#ifndef WTF_METHOD_TABLE_ENTRY
     41#define WTF_METHOD_TABLE_ENTRY(method) method
     42#endif
Note: See TracChangeset for help on using the changeset viewer.