Changeset 229817 in webkit


Ignore:
Timestamp:
Mar 21, 2018 12:33:01 PM (6 years ago)
Author:
mark.lam@apple.com
Message:

Refactor the PtrTag list as a macro so that we can auto-generate code that enumerates each PtrTag.
https://bugs.webkit.org/show_bug.cgi?id=183861
<rdar://problem/38716822>

Reviewed by Filip Pizlo.

Also added ptrTagName() to aid debugging. ptrTagName() is implemented using this
new PtrTag macro list.

  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Sources.txt:
  • runtime/PtrTag.cpp: Added.

(JSC::ptrTagName):

  • runtime/PtrTag.h:
Location:
trunk/Source/JavaScriptCore
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r229798 r229817  
    8484    runtime/NumberPrototype.cpp
    8585    runtime/ObjectConstructor.cpp
     86    runtime/PtrTag.cpp
    8687    runtime/ReflectObject.cpp
    8788    runtime/RegExpConstructor.cpp
  • trunk/Source/JavaScriptCore/ChangeLog

    r229815 r229817  
     12018-03-21  Mark Lam  <mark.lam@apple.com>
     2
     3        Refactor the PtrTag list as a macro so that we can auto-generate code that enumerates each PtrTag.
     4        https://bugs.webkit.org/show_bug.cgi?id=183861
     5        <rdar://problem/38716822>
     6
     7        Reviewed by Filip Pizlo.
     8
     9        Also added ptrTagName() to aid debugging.  ptrTagName() is implemented using this
     10        new PtrTag macro list.
     11
     12        * CMakeLists.txt:
     13        * JavaScriptCore.xcodeproj/project.pbxproj:
     14        * Sources.txt:
     15        * runtime/PtrTag.cpp: Added.
     16        (JSC::ptrTagName):
     17        * runtime/PtrTag.h:
     18
    1192018-03-21  Mark Lam  <mark.lam@apple.com>
    220
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r229738 r229817  
    47034703                FE68C6351B90DDD90042BCB3 /* MacroAssemblerPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MacroAssemblerPrinter.cpp; sourceTree = "<group>"; };
    47044704                FE68C6361B90DDD90042BCB3 /* MacroAssemblerPrinter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerPrinter.h; sourceTree = "<group>"; };
     4705                FE6C1E57203FF6E200BDC2B7 /* PtrTag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PtrTag.cpp; sourceTree = "<group>"; };
    47054706                FE6F56DC1E64E92000D17801 /* VMTraps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VMTraps.cpp; sourceTree = "<group>"; };
    47064707                FE6F56DD1E64E92000D17801 /* VMTraps.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMTraps.h; sourceTree = "<group>"; };
     
    68806881                                79160DBB1C8E3EC8008C085A /* ProxyRevoke.cpp */,
    68816882                                79160DBC1C8E3EC8008C085A /* ProxyRevoke.h */,
     6883                                FE6C1E57203FF6E200BDC2B7 /* PtrTag.cpp */,
    68826884                                FE9AE1C82032C887002B6934 /* PtrTag.h */,
    68836885                                0F5780A118FE1E98001E72D9 /* PureNaN.h */,
  • trunk/Source/JavaScriptCore/Sources.txt

    r228552 r229817  
    873873runtime/Operations.cpp
    874874runtime/Options.cpp
     875runtime/PtrTag.cpp
    875876runtime/ProgramExecutable.cpp
    876877runtime/PromiseDeferredTimer.cpp
  • trunk/Source/JavaScriptCore/runtime/PtrTag.h

    r229767 r229817  
    3030namespace JSC {
    3131
     32#define FOR_EACH_PTRTAG_ENUM(v) \
     33    v(NoPtrTag) \
     34    v(NearCallPtrTag) \
     35    v(NearJumpPtrTag) \
     36    v(CFunctionPtrTag) \
     37    \
     38    v(BytecodePtrTag) \
     39    v(BytecodeHelperPtrTag) \
     40    v(CodeEntryPtrTag) \
     41    v(CodeEntryWithArityCheckPtrTag) \
     42    v(ExceptionHandlerPtrTag) \
     43    v(JITCodePtrTag) \
     44    v(JITOperationPtrTag) \
     45    v(JITThunkPtrTag) \
     46    v(NativeCodePtrTag) \
     47    v(SlowPathPtrTag) \
     48    \
     49    v(Yarr8BitPtrTag) \
     50    v(Yarr16BitPtrTag) \
     51    v(YarrMatchOnly8BitPtrTag) \
     52    v(YarrMatchOnly16BitPtrTag) \
     53    v(YarrBacktrackPtrTag) \
     54
     55
    3256enum PtrTag : uintptr_t {
    33     NoPtrTag = 0,
    34     NearCallPtrTag,
    35     NearJumpPtrTag,
     57#define DECLARE_PTRTAG_ENUM(tag)  tag,
     58    FOR_EACH_PTRTAG_ENUM(DECLARE_PTRTAG_ENUM)
     59#undef DECLARE_PTRTAG_ENUM
     60};
    3661
    37     CFunctionPtrTag,
     62static_assert(static_cast<uintptr_t>(NoPtrTag) == static_cast<uintptr_t>(0), "");
     63static_assert(static_cast<uintptr_t>(NearCallPtrTag) == static_cast<uintptr_t>(1), "");
     64static_assert(static_cast<uintptr_t>(NearJumpPtrTag) == static_cast<uintptr_t>(2), "");
    3865
    39     BytecodePtrTag,
    40     BytecodeHelperPtrTag,
    41     CodeEntryPtrTag,
    42     CodeEntryWithArityCheckPtrTag,
    43     ExceptionHandlerPtrTag,
    44     JITCodePtrTag,
    45     JITOperationPtrTag,
    46     JITThunkPtrTag,
    47     NativeCodePtrTag,
    48     SlowPathPtrTag,
    49 
    50     Yarr8BitPtrTag,
    51     Yarr16BitPtrTag,
    52     YarrMatchOnly8BitPtrTag,
    53     YarrMatchOnly16BitPtrTag,
    54     YarrBacktrackPtrTag,
    55 };
     66JS_EXPORT_PRIVATE const char* ptrTagName(PtrTag);
    5667
    5768uintptr_t nextPtrTagID();
Note: See TracChangeset for help on using the changeset viewer.