Closed Bug 864216 Opened 7 years ago Closed 7 years ago

Generate IonScriptCounts for asm.js functions


(Core :: JavaScript Engine, defect)

Other Branch
Not set





(Reporter: bhackett, Unassigned)


(Blocks 1 open bug)



(1 file)

Attached patch patchSplinter Review
Right now if PC counts are enabled, generated code and hit counts are computed for the IonScripts attached to JSScripts.  Ion code compiled for asm.js functions is ignored.  It would be better if IonScriptCounts were also computed for asm.js functions, which would make it easier to manually or automatically inspect the generated code, and in particular to compare behavior with and without asm.js compilation.  The attached patch does this, hooking the asm.js IonScriptCounts into the output of -D in a shell.  This doesn't add JIT inspector integration, though that wouldn't be too hard to do given source information for the functions being compiled.
Attachment #740154 - Flags: review?(luke)
Does PC counts not work when --no-asmjs is specified?  That should create a script that behaves normally.
Sure, but the point of this bug is to make it easier to see what happens when asm.js is used for compilation.
Comment on attachment 740154 [details] [diff] [review]

Review of attachment 740154 [details] [diff] [review]:

Ah, I misunderstood what you were trying to do.  Sounds good then.

::: js/src/ion/AsmJS.cpp
@@ +1147,5 @@
>      MacroAssembler &masm() { return masm_; }
>      Label &stackOverflowLabel() { return stackOverflowLabel_; }
>      Label &operationCallbackLabel() { return operationCallbackLabel_; }
>      bool hasError() const { return errorString_ != NULL; }
> +    AsmJSModule &module() const { return *module_.get(); }

Can you keep the 'const' and add ModuleCompiler members to mutate the AsmJSModule?  (Thus far, I've tried to encapsulate mutation of the AsmJSModule inside the ModuleCompiler.)

::: js/src/ion/CodeGenerator.h
@@ +259,5 @@
>      bool visitBindNameIC(OutOfLineUpdateCache *ool, BindNameIC *ic);
>      bool visitNameIC(OutOfLineUpdateCache *ool, NameIC *ic);
>      bool visitCallsiteCloneIC(OutOfLineUpdateCache *ool, CallsiteCloneIC *ic);
> +    IonScriptCounts *getUnassociatedScriptCounts() {

Given that this returns ownership of the IonScriptCounts pointer, can you name it something more imperative like extractUnassociatedScriptCounts?
Attachment #740154 - Flags: review?(luke) → review+
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Followup fix, the logic in maybeCreateScriptCounts was broken and would always create script counts for asm.js functions.
You need to log in before you can comment on or make changes to this bug.