Closed
Bug 814715
Opened 13 years ago
Closed 13 years ago
ParallelArray: Questionable codegen in CodeGenerator::visitParNew(LParNew *lir)
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: pnkfelix, Assigned: pnkfelix)
References
Details
(Whiteboard: PJS)
Attachments
(1 file)
1.60 KB,
patch
|
nmatsakis
:
review+
|
Details | Diff | Splinter Review |
ParallelArray code: Questionable codegen in CodeGenerator::visitParNew(LParNew *lir)
Reference:
https://github.com/syg/iontrail/blob/de6b15bcea20b9dd95b5c68e4965da948ef63ce7/js/src/ion/CodeGenerator.cpp#L1908
In the code for CodeGenerator::visitParNew, there is questionable code (copied below, linked above):
Register tempReg1 = ToRegister(lir->getTemp0());
...
// tempReg1 = (ArenaLists*) forkJoinSlice->arenaLists
masm.loadPtr(Address(threadContextReg, offsetof(ForkJoinSlice, arenaLists)), tempReg1);
// tempReg1 = (FreeSpan*) &objReg.freeLists[thingKind]
uintptr_t freeSpanOffset = gc::ArenaLists::getFreeListOffset(allocKind);
masm.addPtr(Imm32(freeSpanOffset), tempReg1);
That's the last reference of 'tempReg1' in the code; so something is almost certainly wrong. We either have dead code building up this value and then not using it, or the code gen that follows this is missing a use of 'tempReg1'.
Assignee | ||
Comment 1•13 years ago
|
||
see also conversation logged at:
http://logbot.glob.com.au/?c=mozilla%23pjs&s=23+Nov+2012&e=23+Nov+2012
where niko notes:
15:56 nmatsakis I think what it SHOULD Be
15:56 nmatsakis is that the lines which load tempReg2 and tempReg3
15:56 nmatsakis should be:
15:56 nmatsakis masm.loadPtr(Address(**tempReg1**, offsetof(gc::FreeSpan, first)), tempReg2);
15:56 nmatsakis (note the **)
15:56 nmatsakis and similar for tempReg3
Assignee | ||
Comment 2•13 years ago
|
||
I've run jit_test.py with this patch (though admittedly on a repo that also had other experimental changes applied; so not as pure a testbed as i would like).
No alarm bells were set off.
Assignee: general → fklock
Attachment #684720 -
Flags: review?(nmatsakis)
Comment 3•13 years ago
|
||
Comment on attachment 684720 [details] [diff] [review]
patch A v1: use tempReg1.
Review of attachment 684720 [details] [diff] [review]:
-----------------------------------------------------------------
Looks perfect. It'd be nice if we could make a test that exposes this bug first so we can validate it is fixed.
Attachment #684720 -
Flags: review?(nmatsakis) → review+
Assignee | ||
Comment 4•13 years ago
|
||
Pulled into iontrail:
https://github.com/syg/iontrail/commit/94bb1f9441b2173234039d6e4dc632acc83b87b4
Assignee | ||
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•