Closed Bug 1461372 Opened 4 years ago Closed 4 years ago

Deduplicate emitGuardGroupHasUnanalyzedNewScript


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




Tracking Status
firefox62 --- fixed


(Reporter: mgaudet, Assigned: bobslept, Mentored)



(Keywords: good-first-bug)


(1 file, 1 obsolete file)

+++ This bug was initially created as a clone of Bug #1460895 +++

CacheIR [1]  is a system for emitting Inline Cache [2] stubs in a rigorous manner. Occasionally a stub needs to refer to data that is specific to the particular stub. This is a accomplished with StubFields in CacheIR. Before Bug 1348792, the policy for handling stub fields was implicit, a property of the implementation: Ion would bake values into stubs, and baseline wouldn't (allowing the sharing of machine code). 

This bug is about taking advantage of the new machinery added in Bug 1348792, which allows us to use the same CacheIR code generation code for Ion and Baseline where the only difference between stubs is the handling of StubFields. 

The function IonCacheIRCompiler::emitGuardGroupHasUnanalyzedNewScript and BaselineCacheIRCompiler::emitGuardGroupHasUnanalyzedNewScript are almost identical, except in their handling of stub-fields, and therefore can be shared. 


* Verify that the two compiler functions remain almost identical except for their handling of stubFields
* Unify the implementations by moving it into CacheIRCompiler.cpp, adding the opcode to the CACHE_IR_SHARED_OPS list, and modifying the stub field loading to use a StubFieldOffset and emitLoadStubField.
* Delete the old implementations
* Ensure all the tests still pass

Is this the correct approach? It's building and running alright. Also passing jsapi-test.
Comment on attachment 8976602 [details] [diff] [review]

Review of attachment 8976602 [details] [diff] [review]:

Thanks so much! 

This looks really good. I'm marking r+, and I have just kicked off a try build:
Attachment #8976602 - Flags: review+
Assignee: nobody → bobslept
facepalm. I picked the commit onto an old revision. Here's a new try build with an up-to-date central:
Comment on attachment 8976602 [details] [diff] [review]

Turns out try caught a missed portion of the patch! Have talked with bobslept over IRC.
Attachment #8976602 - Flags: review+
Alright I have added the missing part in this patch.
Attachment #8976602 - Attachment is obsolete: true
Attachment #8976691 - Flags: review?(mgaudet)
A new try build:

(Eyeballing the changes look good. I'll just sit on the r+ until the try is green)
Comment on attachment 8976691 [details] [diff] [review]

Review of attachment 8976691 [details] [diff] [review]:

Great, thanks for the fix!
Attachment #8976691 - Flags: review?(mgaudet) → review+
Keywords: checkin-needed
Pushed by
Deduplicate GuardGroupHasUnanalyzedNewScript using emitLoadStubField. r=mgaudet
Keywords: checkin-needed
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.