Ignore:
Timestamp:
Feb 26, 2018, 11:50:54 PM (7 years ago)
Author:
[email protected]
Message:

Modernize FINALIZE_CODE and peer macros to use VA_ARGS arguments.
https://bugs.webkit.org/show_bug.cgi?id=183159
<rdar://problem/37930837>

Reviewed by Keith Miller.

Source/JavaScriptCore:

  • assembler/LinkBuffer.h:
  • assembler/testmasm.cpp:

(JSC::compile):

  • b3/B3Compile.cpp:

(JSC::B3::compile):

  • b3/air/testair.cpp:
  • b3/testb3.cpp:

(JSC::B3::testEntrySwitchSimple):
(JSC::B3::testEntrySwitchNoEntrySwitch):
(JSC::B3::testEntrySwitchWithCommonPaths):
(JSC::B3::testEntrySwitchWithCommonPathsAndNonTrivialEntrypoint):
(JSC::B3::testEntrySwitchLoop):

  • bytecode/InlineAccess.cpp:

(JSC::linkCodeInline):
(JSC::InlineAccess::rewireStubAsJump):

  • bytecode/PolymorphicAccess.cpp:

(JSC::PolymorphicAccess::regenerate):

  • dfg/DFGJITFinalizer.cpp:

(JSC::DFG::JITFinalizer::finalize):
(JSC::DFG::JITFinalizer::finalizeFunction):

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::OSRExit::compileOSRExit):

  • dfg/DFGThunks.cpp:

(JSC::DFG::osrExitThunkGenerator):
(JSC::DFG::osrExitGenerationThunkGenerator):
(JSC::DFG::osrEntryThunkGenerator):

  • ftl/FTLJITFinalizer.cpp:

(JSC::FTL::JITFinalizer::finalizeCommon):

  • ftl/FTLLazySlowPath.cpp:

(JSC::FTL::LazySlowPath::generate):

  • ftl/FTLOSRExitCompiler.cpp:

(JSC::FTL::compileStub):

  • ftl/FTLThunks.cpp:

(JSC::FTL::genericGenerationThunkGenerator):
(JSC::FTL::slowPathCallThunkGenerator):

  • jit/ExecutableAllocator.cpp:
  • jit/JIT.cpp:

(JSC::JIT::link):

  • jit/JITMathIC.h:

(JSC::isProfileEmpty):

  • jit/JITOpcodes.cpp:

(JSC::JIT::privateCompileHasIndexedProperty):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::privateCompileHasIndexedProperty):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::stringGetByValStubGenerator):
(JSC::JIT::privateCompileGetByVal):
(JSC::JIT::privateCompileGetByValWithCachedId):
(JSC::JIT::privateCompilePutByVal):
(JSC::JIT::privateCompilePutByValWithCachedId):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::stringGetByValStubGenerator):

  • jit/JITStubRoutine.h:
  • jit/Repatch.cpp:

(JSC::linkPolymorphicCall):

  • jit/SpecializedThunkJIT.h:

(JSC::SpecializedThunkJIT::finalize):

  • jit/ThunkGenerators.cpp:

(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::linkCallThunkGenerator):
(JSC::linkPolymorphicCallThunkGenerator):
(JSC::virtualThunkFor):
(JSC::nativeForGenerator):
(JSC::arityFixupGenerator):
(JSC::unreachableGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator):

  • llint/LLIntThunks.cpp:

(JSC::LLInt::generateThunkWithJumpTo):

  • wasm/WasmBBQPlan.cpp:

(JSC::Wasm::BBQPlan::complete):

  • wasm/WasmBinding.cpp:

(JSC::Wasm::wasmToWasm):

  • wasm/WasmOMGPlan.cpp:

(JSC::Wasm::OMGPlan::work):

  • wasm/WasmThunks.cpp:

(JSC::Wasm::throwExceptionFromWasmThunkGenerator):
(JSC::Wasm::throwStackOverflowFromWasmThunkGenerator):
(JSC::Wasm::triggerOMGTierUpThunkGenerator):

  • wasm/js/WasmToJS.cpp:

(JSC::Wasm::handleBadI64Use):
(JSC::Wasm::wasmToJS):

  • yarr/YarrJIT.cpp:

(JSC::Yarr::YarrGenerator::compile):

Source/WebCore:

No new tests needed because this is just a refactoring patch.

  • cssjit/SelectorCompiler.cpp:

(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/assembler/LinkBuffer.h

    r225363 r229054  
    11/*
    2  * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2009-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    308308};
    309309
    310 #define FINALIZE_CODE_IF(condition, linkBufferReference, dataLogFArgumentsForHeading)  \
     310#define FINALIZE_CODE_IF(condition, linkBufferReference, ...)  \
    311311    (UNLIKELY((condition))                                              \
    312      ? ((linkBufferReference).finalizeCodeWithDisassembly dataLogFArgumentsForHeading) \
    313      : (linkBufferReference).finalizeCodeWithoutDisassembly())
     312        ? (linkBufferReference).finalizeCodeWithDisassembly(__VA_ARGS__) \
     313        : (linkBufferReference).finalizeCodeWithoutDisassembly())
    314314
    315315bool shouldDumpDisassemblyFor(CodeBlock*);
    316316
    317 #define FINALIZE_CODE_FOR(codeBlock, linkBufferReference, dataLogFArgumentsForHeading)  \
    318     FINALIZE_CODE_IF(shouldDumpDisassemblyFor(codeBlock) || Options::asyncDisassembly(), linkBufferReference, dataLogFArgumentsForHeading)
     317#define FINALIZE_CODE_FOR(codeBlock, linkBufferReference, ...)  \
     318    FINALIZE_CODE_IF((shouldDumpDisassemblyFor(codeBlock) || Options::asyncDisassembly()), linkBufferReference, __VA_ARGS__)
    319319
    320320// Use this to finalize code, like so:
    321321//
    322 // CodeRef code = FINALIZE_CODE(linkBuffer, ("my super thingy number %d", number));
     322// CodeRef code = FINALIZE_CODE(linkBuffer, "my super thingy number %d", number);
    323323//
    324324// Which, in disassembly mode, will print:
     
    331331// ... and so on.
    332332//
    333 // Note that the dataLogFArgumentsForHeading are only evaluated when dumpDisassembly
     333// Note that the format string and print arguments are only evaluated when dumpDisassembly
    334334// is true, so you can hide expensive disassembly-only computations inside there.
    335335
    336 #define FINALIZE_CODE(linkBufferReference, dataLogFArgumentsForHeading)  \
    337     FINALIZE_CODE_IF(JSC::Options::asyncDisassembly() || JSC::Options::dumpDisassembly(), linkBufferReference, dataLogFArgumentsForHeading)
    338 
    339 #define FINALIZE_DFG_CODE(linkBufferReference, dataLogFArgumentsForHeading)  \
    340     FINALIZE_CODE_IF(JSC::Options::asyncDisassembly() || JSC::Options::dumpDisassembly() || Options::dumpDFGDisassembly(), linkBufferReference, dataLogFArgumentsForHeading)
     336#define FINALIZE_CODE(linkBufferReference, ...)  \
     337    FINALIZE_CODE_IF((JSC::Options::asyncDisassembly() || JSC::Options::dumpDisassembly()), linkBufferReference, __VA_ARGS__)
     338
     339#define FINALIZE_DFG_CODE(linkBufferReference, ...)  \
     340    FINALIZE_CODE_IF((JSC::Options::asyncDisassembly() || JSC::Options::dumpDisassembly() || Options::dumpDFGDisassembly()), linkBufferReference, __VA_ARGS__)
    341341
    342342} // namespace JSC
Note: See TracChangeset for help on using the changeset viewer.