Improve GDB output for LLInt on Linux
https://bugs.webkit.org/show_bug.cgi?id=192660

Reviewed by Yusuke Suzuki.

Annotate assembly code generated for LLInt with the bytecode operation. When debugging
LLInt assembly code GDB is then able to show which bytecode instruction is implemented by
the current assembly code. This also works for linux-perf.

* llint/LowLevelInterpreter.cpp:
* offlineasm/arm.rb:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@239199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 05d2e4a..3fc73c7 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,17 @@
+2018-12-13  Dominik Infuehr  <dinfuehr@igalia.com>
+
+        Improve GDB output for LLInt on Linux
+        https://bugs.webkit.org/show_bug.cgi?id=192660
+
+        Reviewed by Yusuke Suzuki.
+
+        Annotate assembly code generated for LLInt with the bytecode operation. When debugging
+        LLInt assembly code GDB is then able to show which bytecode instruction is implemented by
+        the current assembly code. This also works for linux-perf.
+
+        * llint/LowLevelInterpreter.cpp:
+        * offlineasm/arm.rb:
+
 2018-12-13  Mark Lam  <mark.lam@apple.com>
 
         Add a missing exception check.
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp b/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
index cebfe8b..83ad6c9 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
@@ -548,6 +548,7 @@
 
 #define OFFLINE_ASM_OPCODE_LABEL(__opcode) \
     EMBED_OPCODE_ID_IF_NEEDED(__opcode) \
+    OFFLINE_ASM_OPCODE_DEBUG_LABEL(llint_##__opcode) \
     OFFLINE_ASM_LOCAL_LABEL(llint_##__opcode)
 
 #define OFFLINE_ASM_GLUE_LABEL(__opcode)   OFFLINE_ASM_LOCAL_LABEL(__opcode)
@@ -578,6 +579,12 @@
 
 #define OFFLINE_ASM_LOCAL_LABEL(label)   LOCAL_LABEL_STRING(label) ":\n"
 
+#if OS(LINUX)
+#define OFFLINE_ASM_OPCODE_DEBUG_LABEL(label)  #label ":\n"
+#else
+#define OFFLINE_ASM_OPCODE_DEBUG_LABEL(label)
+#endif
+
 // This is a file generated by offlineasm, which contains all of the assembly code
 // for the interpreter, as compiled from LowLevelInterpreter.asm.
 #include "LLIntAssembly.h"
diff --git a/Source/JavaScriptCore/offlineasm/arm.rb b/Source/JavaScriptCore/offlineasm/arm.rb
index b0c3362..d78b82e 100644
--- a/Source/JavaScriptCore/offlineasm/arm.rb
+++ b/Source/JavaScriptCore/offlineasm/arm.rb
@@ -683,8 +683,8 @@
             temp = operands[2]
 
             uid = $asm.newUID
-            gotLabel = "L_offlineasm_arm_got_#{uid}"
-            offsetLabel = "L_offlineasm_arm_got_offset_#{uid}"
+            gotLabel = Assembler.localLabelReference("offlineasm_arm_got_#{uid}")
+            offsetLabel = Assembler.localLabelReference("offlineasm_arm_got_offset_#{uid}")
 
             $asm.puts "ldr #{dest.armOperand}, #{gotLabel}"
             $asm.puts "ldr #{temp.armOperand}, #{gotLabel}+4"