Closed
Bug 1165804
Opened 9 years ago
Closed 3 years ago
JIT broken on big-endian mips
Categories
(Core :: JavaScript Engine: JIT, defect, P5)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: glandium, Unassigned)
References
(Blocks 2 open bugs)
Details
For example:
$ echo '0' | ./dist/bin/js --baseline-eager
TypeError: null is not an object or null
js> 0
2.121995728e-314
js>
First, note the TypeError message. Then the value for 0. This doesn't happen without baseline:
$ echo '0' | ./dist/bin/js --no-baseline
js> 0
0
js>
If I print result from EvalAndPrint in gdb, I get this with baseline:
$1 = {<js::RootedBase<JS::Value>> = {<js::MutableValueOperations<JS::Rooted<JS::Value> >> = {<js::ValueOperations<JS::Rooted<JS::Value> >> = {<No data fields>}, <No data fields>}, <No data fields>}, stack = 0xadf9d4, prev = 0x0, ptr = {data = {asBits = 4294967169,
s = {tag = 0, payload = {i32 = -127, u32 = 4294967169, boo = 4294967169, str = 0xffffff81, sym = 0xffffff81, obj = 0xffffff81,
cell = 0xffffff81, ptr = 0xffffff81, why = 4294967169, word = 4294967169, uintptr = 4294967169}},
asDouble = 2.1219957282189353e-314, asPtr = 0x0}}}
and this without:
$1 = {<js::RootedBase<JS::Value>> = {<js::MutableValueOperations<JS::Rooted<JS::Value> >> = {<js::ValueOperations<JS::Rooted<JS::Value> >> = {<No data fields>}, <No data fields>}, <No data fields>}, stack = 0xadf9d4, prev = 0x0, ptr = {data = {
asBits = 18446743528248705024, s = {tag = JSVAL_TAG_INT32, payload = {i32 = 0, u32 = 0, boo = 0, str = 0x0, sym = 0x0,
obj = 0x0, cell = 0x0, ptr = 0x0, why = JS_ELEMENTS_HOLE, word = 0, uintptr = 0}}, asDouble = -nan(0xfff8100000000),
asPtr = 0xffffff81}}}
So I guess baseline is filling JS::Values as if it were little endian.
Reporter | ||
Comment 1•9 years ago
|
||
I tried the obvious thing, changing the offsets in js/src/jit/mips/Architecture-mips.h, but now I'm getting a bug error. I guess there are other things involved.
Reporter | ||
Comment 2•9 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #1)
> bug error
bus error.
Updated•9 years ago
|
Flags: needinfo?(branislav.rankov)
Reporter | ||
Comment 3•9 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #1)
> I tried the obvious thing, changing the offsets in
> js/src/jit/mips/Architecture-mips.h, but now I'm getting a bus error.
However, for simple things like numbers, it does solve the problem:
$ touch foo.js
$ echo '0' | MOZ_SELFHOSTEDJS=foo.js ./dist/bin/js --baseline-eager
js> 0
0
js>
Reporter | ||
Comment 4•9 years ago
|
||
My guess is that most problems will go away when I can make this work:
$ echo 'Object(1)' | MOZ_SELFHOSTEDJS=foo.js ./dist/bin/js --baseline-eager
js> Object(1)
(new Number(4.243991519e-314))
js>
Comment 5•9 years ago
|
||
Cameron Kaiser recently did a big-endian port to PowerPC for TenFourFox. You might want to talk with him.
Comment 6•9 years ago
|
||
Big-endian is currently not supported in MIPS port. I would not expect it to be trivial to make it work.
However, you are on the good track.
For the current issue, I would look in MacroAssembler-mips.cpp at functions:
MacroAssemblerMIPS::ma_ld()
MacroAssemblerMIPS::ma_sd()
Flags: needinfo?(branislav.rankov)
Comment 7•9 years ago
|
||
On the front end I had to do a little hacking in Ion to get around some assertions. (The PowerPC Ion port does pass tests.) As it happens, it was largely based on Branislav's work, though he's right that there were some non-trivial backend changes required. I don't remember all of them because a number were completely rewritten.
Updated•8 years ago
|
Priority: -- → P5
Updated•5 years ago
|
Blocks: big-endian
Comment 8•3 years ago
|
||
It is my understanding that the JS+wasm JITs no longer support any big-endian architecture and that all (partial) big-endian support code has been removed.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•