Closed Bug 1459038 Opened 8 years ago Closed 7 years ago

Deduplicate CacheIR emitters that differ only in stub fields

Categories

(Core :: JavaScript Engine: JIT, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Tracking Status
firefox61 --- affected

People

(Reporter: mgaudet, Unassigned)

References

Details

Attachments

(1 obsolete file)

Once Bug 1348792 lands, we will be able to merge the Baseline and Ion CacheIR compiler code for opcodes whose implementations differ only in terms of how they handle stub fields.
Assignee: nobody → mgaudet
Status: NEW → ASSIGNED
Depends on: 1460895
Attachment #8973821 - Attachment is obsolete: true
I took a pass through and have highlighted the below methods as either perfect for deduplication, or almost perfect. Perfect cases for deduplication * emitGuardGroupHasUnanalyzedNewScript * emitGuardXrayExpandoShapeAndDefaultProto * emitGuardFunctionPrototype l * emitMegamorphicLoadSlotResult (Bug 1460895) * emitMegamorphicStoreSlotResult * emitLoadObject Look unifiable, though may have require one extra scratch reg: * emitGuardShape * emitGuardGroup * emitLoadUnboxedPropertyResult * emitLoadEnvironmentFixedSlotResult * emitLoadEnvironmentDynamicSlotResult Assuming Bug 1460895 is a good example, I'll follow up opening bugs for the perfect cases above. Jan: About the deduplications where we'd need an extra scratch register (and immediate load). What is your feeling: Worth it in terms of deduplication value, or potentially a performance concern?
Flags: needinfo?(jdemooij)
(In reply to Matthew Gaudet (he/him) [:mgaudet] (UTC-5) from comment #2) > Jan: About the deduplications where we'd need an extra scratch register (and > immediate load). What is your feeling: Worth it in terms of deduplication > value, or potentially a performance concern? For the ones you listed I'd say it's probably not worth it because they're all very simple instructions. Also, emitGuardShape in particular is very hot because most property access stubs contain at least one shape guard, so adding an extra load + scratch register isn't great :) Unifying the others sounds great though!
Flags: needinfo?(jdemooij)
Depends on: 1461372
Depends on: 1461374
Depends on: 1461375
Depends on: 1461376
I think it's possible to deduplicate things like emitGuardShape, with some more magic. But I don't have a clear answer right now, so I won't open a blocking bug for that.
Depends on: 1461386
Assignee: mgaudet → nobody
Status: ASSIGNED → NEW
See Also: → 1467191
All the dependent bugs are closed, so closing this.
Status: NEW → RESOLVED
Closed: 7 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: