x87 Support: assertion failure in register-allocator

23 views
Skip to first unread message

Konrad Schwarz

unread,
Oct 5, 2020, 4:19:55 AM10/5/20
to v8-dev
To support a product based on the Intel Quark, which only has an x87 FPU and no MMX/SSE/AVX, a colleague of mine resurrected the x87 port.

This was done successfully for node.js version 8 -- unfortunately, I don't know to which V8 version this corresponds to exactly, because the node.js code base copies the V8 files rather than incorporating the V8 repository as a submodule.

I've attempted to move the patch forward to node.js version 10.  (One of the primary new features for V8 was the Liftoff compiler for WASM; the garbage collector has changed as well).  Unfortunately, I am getting an assertion error during the "mksnapshot" build step:

# Fatal error in ../deps/v8/src/compiler/register-allocator.cc, line 2663
# Debug check failed: start_instr <= end_instr (80 vs. 0).
#
#
#
#FailureMessage Object: 0xffa80374

As can be expected, this is happening while AllocateFPRegistersPhase() is active (on the call stack).

The V8 x87 port basically uses only one of the (stack-addressed) x87 registers, so on the one hand it would not be surprising for the register allocator to have problems here.  On the other hand, this part of the code has not changed much between the node.js v8 and v10, which indicates a problem that I introduced.

Any pointers or hints would be very much appreciated!

--
Konrad Schwarz

Ben Noordhuis

unread,
Oct 5, 2020, 11:25:25 AM10/5/20
to v8-...@googlegroups.com
Not a direct answer to your question but you can find out the V8
version with `node -p process.versions.v8` or by looking at
deps/v8/include/v8-version.h.

For the last v8.x release, that's V8 6.2.78, for v10.x that's 6.8.32.
Both are pretty ancient by now, the latest major/minor is 8.8.x.

As to that debug check you're hitting, try starting node with `node
--trace_alloc script.js` - that should hopefully shed a clue where the
bad live range comes from.

Jakob Kummerow

unread,
Oct 5, 2020, 12:53:53 PM10/5/20
to v8-dev
Not a direct answer to your question but you can find out the V8
version with `node -p process.versions.v8` or by looking at
deps/v8/include/v8-version.h.

I've also found https://nodejs.org/en/download/releases/ very useful for quickly looking up V8 versions in Node.

If you're running into porting difficulty with Liftoff (which this particular problem doesn't seem to be), note that you can turn off Liftoff usage. You'll see slower startup for WebAssembly apps; there should be no other negative side effects. Set FLAG_liftoff and FLAG_wasm_tier_up both to false (in flag-definitions.h).

Reply all
Reply to author
Forward
0 new messages