Closed Bug 814715 Opened 13 years ago Closed 13 years ago

ParallelArray: Questionable codegen in CodeGenerator::visitParNew(LParNew *lir)

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: pnkfelix, Assigned: pnkfelix)

References

Details

(Whiteboard: PJS)

Attachments

(1 file)

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'.
Blocks: PJS
Whiteboard: PJS
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
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 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+
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.

Attachment

General

Created:
Updated:
Size: