nHints is a static variable. It has a harmless race that Helgrind detected. It's written by Assembler::nInit() and read by Assembler::hint(), and there's no locking. It's harmless because the values written by Assembler::nInit() are always the same. But it's worth fixing just to avoid the warning.
An easy fix would be to make it non-static. It's one int32 per opcode, so the extra space is minimal, something like 512 bytes. It would need to be manually zeroed, as well.
Created attachment 517335 [details] [diff] [review]
Comment on attachment 517335 [details] [diff] [review]
Yes, that appears to fix the race -- is no longer detectable.
I only checked on x64-linux, although I know this race also
exists on arm and probably x86 too. From the look of it this
patch fixes all targets, yes?
(In reply to comment #2)
> From the look of it this patch fixes all targets, yes?
user: Nicholas Nethercote <firstname.lastname@example.org>
summary: Bug 623362 - nanojit: avoid harmless race on nHints. r=jseward.