Commit 9cc5df7d authored by mark.lam@apple.com's avatar mark.lam@apple.com
Browse files

Add cloopDo instruction for debugging the llint C++ backend.

https://bugs.webkit.org/show_bug.cgi?id=97502.

Reviewed by Geoffrey Garen.

* offlineasm/cloop.rb:
* offlineasm/instructions.rb:
* offlineasm/parser.rb:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e65252dc
2012-09-24 Mark Lam <mark.lam@apple.com>
Add cloopDo instruction for debugging the llint C++ backend.
https://bugs.webkit.org/show_bug.cgi?id=97502.
Reviewed by Geoffrey Garen.
* offlineasm/cloop.rb:
* offlineasm/instructions.rb:
* offlineasm/parser.rb:
2012-09-24 Filip Pizlo <fpizlo@apple.com>
 
JSArray::putByIndex asserts with readonly property on prototype
......
......@@ -507,7 +507,7 @@ end
class Instruction
def lowerC_LOOP
$asm.codeOrigin codeOriginString if $enableCodeOriginComments
$asm.annotation annotation if $enableInstrAnnotations
$asm.annotation annotation if $enableInstrAnnotations && (opcode != "cloopDo")
case opcode
when "addi"
......@@ -981,6 +981,12 @@ class Instruction
when "cloopCallSlowPath"
cloopEmitCallSlowPath(operands)
# For debugging only. This is used to insert instrumentation into the
# generated LLIntAssembly.h during llint development only. Do not use
# for production code.
when "cloopDo"
$asm.putc "#{annotation}"
else
lowerDefault
end
......
......@@ -227,6 +227,14 @@ CXX_INSTRUCTIONS =
"cloopCallJSFunction", # operands: callee
"cloopCallNative", # operands: callee
"cloopCallSlowPath", # operands: callTarget, currentFrame, currentPC
# For debugging only:
# Takes no operands but simply emits whatever follows in // comments as
# a line of C++ code in the generated LLIntAssembly.h file. This can be
# used to insert instrumentation into the interpreter loop to inspect
# variables of interest. Do not leave these instructions in production
# code.
"cloopDo", # no operands
]
INSTRUCTIONS = MACRO_INSTRUCTIONS + X86_INSTRUCTIONS + ARMv7_INSTRUCTIONS + CXX_INSTRUCTIONS
......
......@@ -103,7 +103,11 @@ def lex(str, fileName)
annotationType = whitespaceFound ? :local : :global
when /\A\n/
# We've found a '\n'. Emit the last comment recorded if appropriate:
if $enableInstrAnnotations and annotation
# We need to parse annotations regardless of whether the backend does
# anything with them or not. This is because the C++ backend may make
# use of this for its cloopDo debugging utility even if
# enableInstrAnnotations is not enabled.
if annotation
result << Annotation.new(CodeOrigin.new(fileName, lineNumber),
annotationType, annotation)
annotation = nil
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment