Changeset 229054 in webkit for trunk/Source/JavaScriptCore/assembler/LinkBuffer.h
- Timestamp:
- Feb 26, 2018, 11:50:54 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/assembler/LinkBuffer.h
r225363 r229054 1 1 /* 2 * Copyright (C) 2009-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2009-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 308 308 }; 309 309 310 #define FINALIZE_CODE_IF(condition, linkBufferReference, dataLogFArgumentsForHeading) \310 #define FINALIZE_CODE_IF(condition, linkBufferReference, ...) \ 311 311 (UNLIKELY((condition)) \ 312 ? ((linkBufferReference).finalizeCodeWithDisassembly dataLogFArgumentsForHeading) \313 : (linkBufferReference).finalizeCodeWithoutDisassembly())312 ? (linkBufferReference).finalizeCodeWithDisassembly(__VA_ARGS__) \ 313 : (linkBufferReference).finalizeCodeWithoutDisassembly()) 314 314 315 315 bool shouldDumpDisassemblyFor(CodeBlock*); 316 316 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__) 319 319 320 320 // Use this to finalize code, like so: 321 321 // 322 // CodeRef code = FINALIZE_CODE(linkBuffer, ("my super thingy number %d", number));322 // CodeRef code = FINALIZE_CODE(linkBuffer, "my super thingy number %d", number); 323 323 // 324 324 // Which, in disassembly mode, will print: … … 331 331 // ... and so on. 332 332 // 333 // Note that the dataLogFArgumentsForHeadingare only evaluated when dumpDisassembly333 // Note that the format string and print arguments are only evaluated when dumpDisassembly 334 334 // is true, so you can hide expensive disassembly-only computations inside there. 335 335 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__) 341 341 342 342 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.