Closed
Bug 1373290
Opened 4 years ago
Closed 4 years ago
Move object/string pre-barrier null check to JIT code
Categories
(Core :: JavaScript Engine: JIT, enhancement)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla56
| Tracking | Status | |
|---|---|---|
| firefox56 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
7.57 KB,
patch
|
nbp
:
review+
|
Details | Diff | Splinter Review |
Right now we null check in Mark{Object,String}FromIon but that's slower than doing it in JIT code before we make the call.
The null case is actually pretty common when initializing unboxed objects, see the micro-benchmark below. I get:
before: 157 ms
after: 48 ms
I noticed this on Speedometer where we sometimes have incremental GCs going on while running tests.
function f() {
startgc(1);
var t = new Date;
var o;
for (var i=0; i<10000000; i++)
o = {x: Math};
print(new Date - t);
return o;
}
f();
Attachment #8878078 -
Flags: review?(nicolas.b.pierron)
Comment 1•4 years ago
|
||
Comment on attachment 8878078 [details] [diff] [review] Patch Review of attachment 8878078 [details] [diff] [review]: ----------------------------------------------------------------- Good catch! ::: js/src/jit/arm64/MacroAssembler-arm64-inl.h @@ +1038,5 @@ > + vixl::UseScratchRegisterScope temps(this); > + const Register scratch = temps.AcquireX().asUnsized(); > + MOZ_ASSERT(scratch != lhs.base); > + MOZ_ASSERT(scratch != lhs.index); > + loadPtr(lhs, scratch); nit: Pick a different temporary register. http://searchfox.org/mozilla-central/rev/c49a70b53f67dd5550eec8a08793805f2aca8d42/js/src/jit/arm64/MacroAssembler-arm64.h#761
Attachment #8878078 -
Flags: review?(nicolas.b.pierron) → review+
| Assignee | ||
Comment 2•4 years ago
|
||
(In reply to Nicolas B. Pierron [:nbp] from comment #1) > nit: Pick a different temporary register. I think on ARM64 UseScratchRegisterScope picks the next register that's available so it should be fine.
Pushed by jandemooij@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/231bd9d90fb3 Move object/string pre-barrier null check to JIT code. r=nbp
Comment 4•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/231bd9d90fb3
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in
before you can comment on or make changes to this bug.
Description
•