Closed Bug 1224280 Opened 7 years ago Closed 7 years ago

[jsdbg2] wrong warning message when disabling asm.js with allowUnobservedAsmJS

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: jlong, Assigned: jandem)

Details

Attachments

(1 file)

It appears that if I create a Debugger and set `allowUnobservedAsmJS = true` initially, and then later I set it to `false` to disable it, I get this warning in the console: "TypeError: asm.js type error: Disabled by javascript.options.asmjs in about:config"

Not sure why the warning is different. If I never changed the flag (it default to false) I see a warning more like "disabled by debugger". We should fix this as it's very confusing why it's disabled.
Blocks: 1132501
Not sure this is really a hard blocker for bug 1132501.
I agree, not a hard blocker but really want to fix it asap. It's going to be confusing, but it's ok if the other bug lands first.

Not sure how best to track that. I suppose we can remove the blocker but I'll just make sure this gets worked on.
No longer blocks: 1132501
Should be an easy fix.
Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
Attached patch PatchSplinter Review
ParseTask::init disabled asm.js manually when we're parsing off-thread, and that triggered the confusing message.

This patch makes asmJSOption an enum class, so that we can distinguish the two cases. It also handles this case in the CompileOptions constructors so we don't need that check in ParseTask::init.
Attachment #8687105 - Flags: review?(luke)
Comment on attachment 8687105 [details] [diff] [review]
Patch

Review of attachment 8687105 [details] [diff] [review]:
-----------------------------------------------------------------

Excellent, thanks!

::: js/src/asmjs/AsmJSValidate.cpp
@@ +8283,3 @@
>          return Warn(parser, JSMSG_USE_ASM_TYPE_FAIL, "Disabled by debugger");
>  
> +    MOZ_ASSERT(parser.options().asmJSOption == AsmJSOption::Enabled);

How about a switch (parser.options().asmJSOption)?
Attachment #8687105 - Flags: review?(luke) → review+
https://hg.mozilla.org/mozilla-central/rev/799834846e7c
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.