Last Comment Bug 773587 - IonMonkey: Assertion failure: isInt32(), at ../../jsapi.h:450
: IonMonkey: Assertion failure: isInt32(), at ../../jsapi.h:450
: assertion, testcase
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Other Branch
: x86 Linux
-- major (vote)
: ---
Assigned To: Jan de Mooij [:jandem]
: general
: Jason Orendorff [:jorendorff]
Depends on:
Blocks: langfuzz IonFuzz
  Show dependency treegraph
Reported: 2012-07-13 03:54 PDT by Christian Holler (:decoder)
Modified: 2013-01-14 07:53 PST (History)
7 users (show)
choller: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Proposed fix (1.90 KB, patch)
2012-07-18 01:32 PDT, Jan de Mooij [:jandem]
dvander: review+
Details | Diff | Splinter Review

Description User image Christian Holler (:decoder) 2012-07-13 03:54:22 PDT
The following testcase asserts on ionmonkey revision a29f6c635516 (run with --ion -n -m --ion-eager):

StrictEquality( true, new Boolean(true), false );
function StrictEquality( x, y, expect ) {
  result = ( x === y );
  StrictEquality(y.environment !== Set.environment, true);
Comment 1 User image David Anderson [:dvander] 2012-07-17 17:18:53 PDT
Jan, it looks like the bug is that we're feeding a constant boolean into ToInt32(). It feels like handling that isn't a good fix though. The TypePolicy logic and lowering is kind of squirrelly and I kind of want to just refactor and separate out int32 from boolean specialization. Thoughts?
Comment 2 User image Jan de Mooij [:jandem] 2012-07-18 01:32:59 PDT
Created attachment 643290 [details] [diff] [review]
Proposed fix

If TI knows a comparison is like

  bool === bool

we will use specialization Int32 and lower to LCompare. If it's a strict comparison and we know one side is boolean, we use specialization Bool and lower to CompareB (Value === bool).

Due to inlining etc, the MIR type may be more precise than what TI tells us, so if we have a Bool specialization we may still get two bool inputs and we want to switch the specialization to Int32 to match the first case (known bool === bool). The bug is that we don't want to return early in this case but want to insert MToInt32.
Comment 3 User image Jan de Mooij [:jandem] 2012-07-19 02:10:30 PDT
Comment 4 User image Christian Holler (:decoder) 2013-01-14 07:53:17 PST
A testcase for this bug was automatically identified at js/src/jit-test/tests/ion/bug773587.js.

Note You need to log in before you can comment on or make changes to this bug.