Bug 97502

Summary: JSC: add a debugging utility for the C++ llint backend.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: fpizlo, ggaren
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Fix. ggaren: review+

Description Mark Lam 2012-09-24 17:15:56 PDT
Added the "cloopDo" instruction that can be used to insert instrumentation in the llint generated code.  For example, when debugging, we can add the following into a llint ASM file:

    cloopDo // printf("I was here!!!\n");

The llint C++ backend will insert whatever is in the // comment as a C++ statement into the generated LLIntAssembly.h file at the location where we insert this cloopDo instruction into the llint ASM instruction stream.

cloopDo instructions should only be used for debugging the C++ llint.  They should not be left in the llint ASM file when we're done debugging.  Support for the cloopDo instruction is left enabled by default for convenience.  It does not affect the produced code if not used.
Comment 1 Mark Lam 2012-09-24 17:20:30 PDT
Created attachment 165474 [details]
Fix.
Comment 2 Geoffrey Garen 2012-09-24 17:26:18 PDT
Comment on attachment 165474 [details]
Fix.

View in context: https://bugs.webkit.org/attachment.cgi?id=165474&action=review

r=me

> Source/JavaScriptCore/offlineasm/parser.rb:107
> +            # We need to parse annotations regardless of whether the backend does
> +            # anything with them or not.

This comment should explain why.
Comment 3 Mark Lam 2012-09-24 17:39:38 PDT
(In reply to comment #2)
> > Source/JavaScriptCore/offlineasm/parser.rb:107
> > +            # We need to parse annotations regardless of whether the backend does
> > +            # anything with them or not.
> 
> This comment should explain why.

The comment has been updated.

Landed in http://trac.webkit.org/changeset/129434.