Changeset 284868 in webkit
- Timestamp:
- Oct 26, 2021, 8:52:37 AM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
-
CMakeLists.txt (modified) (1 diff)
-
ChangeLog (modified) (1 diff)
-
llint/LowLevelInterpreter.cpp (modified) (1 diff)
-
offlineasm/asm.rb (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r284435 r284868 440 440 else () 441 441 set(LLIntOutput LLIntAssembly.h) 442 endif () 443 444 if (CMAKE_SYSTEM_NAME MATCHES "Linux") 445 set(OFFLINE_ASM_ARGS --binary-format=ELF) 442 446 endif () 443 447 -
trunk/Source/JavaScriptCore/ChangeLog
r284852 r284868 1 2021-10-26 Xan López <xan@igalia.com> 2 3 [JSC] Improve offlineasm debug annotations for Linux/ELF 4 https://bugs.webkit.org/show_bug.cgi?id=232303 5 6 Reviewed by Mark Lam. 7 8 This patch does two things: 9 10 Add the .size and .type directives to every llint "function" 11 (global, llint opcode, 'glue'). This allows a debugger to tell you 12 in what logical function you are inside the giant chunk of code 13 that is the llint interpreter. So instead of something like this: 14 15 (gdb) x/5i $pc 16 => 0xf5f8af60 <wasmLLIntPCRangeStart+3856>: b.n 0xf5f8af6c <wasmLLIntPCRangeStart+3868> 17 0xf5f8af62 <wasmLLIntPCRangeStart+3858>: ldr r2, [r7, #8] 18 0xf5f8af64 <wasmLLIntPCRangeStart+3860>: ldr r2, [r2, #28] 19 0xf5f8af66 <wasmLLIntPCRangeStart+3862>: subs r0, #16 20 0xf5f8af68 <wasmLLIntPCRangeStart+3864>: ldr.w r0, [r2, r0, lsl #3] 21 22 you get something like this: 23 24 (gdb) x/5i $pc 25 => 0xf5f8c770 <wasm_f32_add+12>: bge.n 0xf5f8c77c <wasm_f32_add+24> 26 0xf5f8c772 <wasm_f32_add+14>: add.w r6, r7, r9, lsl #3 27 0xf5f8c776 <wasm_f32_add+18>: vldr d0, [r6] 28 0xf5f8c77a <wasm_f32_add+22>: b.n 0xf5f8c78c <wasm_f32_add+40> 29 0xf5f8c77c <wasm_f32_add+24>: ldr r2, [r7, #8] 30 31 The other change adds a local symbol (in addition to an internal 32 label) to all the "glue" labels. That allows wasm opcodes to be 33 seen by the debugger (and the user to break on them), among other 34 things. 35 36 * CMakeLists.txt: tell offlineasm we use the ELF binary format on Linux. 37 * llint/LowLevelInterpreter.cpp: emit a non-local label for "glue" labels. 38 * offlineasm/asm.rb: emit the .size and .type directives for every 39 llint "function" on ELF systems. 40 1 41 2021-10-25 Yusuke Suzuki <ysuzuki@apple.com> 2 42 -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
r281541 r284868 491 491 OFFLINE_ASM_LOCAL_LABEL(llint_##__opcode) 492 492 493 #define OFFLINE_ASM_GLUE_LABEL(__opcode) OFFLINE_ASM_LOCAL_LABEL(__opcode) 493 #define OFFLINE_ASM_GLUE_LABEL(__opcode) \ 494 OFFLINE_ASM_OPCODE_DEBUG_LABEL(__opcode) \ 495 OFFLINE_ASM_LOCAL_LABEL(__opcode) 494 496 495 497 #if CPU(ARM_THUMB2) -
trunk/Source/JavaScriptCore/offlineasm/asm.rb
r284341 r284868 265 265 end 266 266 end 267 if $emitELFDebugDirectives 268 deferNextLabelAction { 269 putStr(" \".size #{labelName} , . - #{labelName} \\n\"") 270 putStr(" \".type #{labelName} , function \\n\"") 271 } 272 end 267 273 @newlineSpacerState = :none # After a global label, we can use another spacer. 268 274 end … … 342 348 $options = {} 343 349 OptionParser.new do |opts| 344 opts.banner = "Usage: asm.rb asmFile offsetsFile outputFileName [--assembler=<ASM>] [--webkit-additions-path=<path>] "350 opts.banner = "Usage: asm.rb asmFile offsetsFile outputFileName [--assembler=<ASM>] [--webkit-additions-path=<path>] [--binary-format=<format>]" 345 351 # This option is currently only used to specify the masm assembler 346 352 opts.on("--assembler=[ASM]", "Specify an assembler to use.") do |assembler| … … 349 355 opts.on("--webkit-additions-path=PATH", "WebKitAdditions path.") do |path| 350 356 $options[:webkit_additions_path] = path 357 end 358 opts.on("--binary-format=FORMAT", "Specify the binary format used by the target system.") do |format| 359 $options[:binary_format] = format 351 360 end 352 361 end.parse! … … 366 375 $emitWinAsm = isMSVC ? outputFlnm.index(".asm") != nil : false 367 376 $commentPrefix = $emitWinAsm ? ";" : "//" 377 378 # We want this in all ELF systems we support, except for C_LOOP (we'll disable it later on if we are building cloop) 379 $emitELFDebugDirectives = $options.has_key?(:binary_format) && $options[:binary_format] == "ELF" 368 380 369 381 inputHash = … … 413 425 $enableDebugAnnotations = false 414 426 $preferredCommentStartColumn = 60 427 $emitELFDebugDirectives = false 415 428 end 416 429
Note:
See TracChangeset
for help on using the changeset viewer.