Closed Bug 937058 Opened 6 years ago Closed 6 years ago

Paper over debug-mode checks of stack depth for unreachable bytecode

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: wingo, Assigned: wingo)

References

Details

Attachments

(1 file, 1 obsolete file)

In a number of cases, Ion somehow computes a stack depth for unreachable bytecode.  This is bug 937046.  It then does a sanity check to see that the stack depth is the same as the depth that the decompiler computes, which fails as the decompiler's parser doesn't visit unreachable code, and anyway the stack depth at  unreachable code is meaningless.

This fix will paper over the Ion problems by only asserting that stack depths match for reachable bytecode.
Assignee: nobody → wingo
Attachment #830119 - Flags: review?(jdemooij)
Blocks: 935294
Comment on attachment 830119 [details] [diff] [review]
Paper over debug-mode checks of stack depth for unreachable bytecode

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

Thanks!

::: js/src/jit/shared/CodeGenerator-shared.cpp
@@ +288,5 @@
> +                    JS_ASSERT(stackDepth - exprStack <= 1);
> +                } else if (JSOp(*bailPC) != JSOP_FUNAPPLY &&
> +                           !IsGetPropPC(bailPC) && !IsSetPropPC(bailPC))
> +                    {
> +                        // For fun.apply({}, arguments) the reconstructStackDepth will

Nit: unindent this block

::: js/src/jsopcode.cpp
@@ +715,5 @@
> +
> +    return true;
> +}
> +
> +

Micro-nit: remove one of these two blank lines
Attachment #830119 - Flags: review?(jdemooij) → review+
Attachment #830119 - Attachment is obsolete: true
Comment on attachment 830181 [details] [diff] [review]
Paper over debug-mode checks of stack depth for unreachable bytecode r=jandem

Nits fixed, r=jandem, thanks for the review!
Attachment #830181 - Attachment description: Paper over debug-mode checks of stack depth for unreachable bytecode → Paper over debug-mode checks of stack depth for unreachable bytecode r=jandem
Attachment #830181 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/2c7ad2dabeb8
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Duplicate of this bug: 935294
You need to log in before you can comment on or make changes to this bug.