Closed Bug 1461376 Opened 2 years ago Closed Last year

Deduplicate emitLoadObject


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




Tracking Status
firefox62 --- fixed


(Reporter: mgaudet, Assigned: bobslept, Mentored)



(Keywords: good-first-bug)


(1 file)

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

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::emitLoadObject and BaselineCacheIRCompiler::emitLoadObject 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

No longer depends on: 1461375
Building and running alright. Passes jsapi-test and cacheir jit_test. Did not ran a full jit_test yet.
Attachment #8977078 - Flags: review?(mgaudet)
Comment on attachment 8977078 [details] [diff] [review]

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

Looks good to me. One minor nit would be that I think it might be a good idea to try to match the order inside CacheIRCompiler.cpp to the enum of shared opcodes (which would put that earlier in the file). 

Having said that, I'd be equally OK with a followup bug aimed specifically at trying to do that. 

Pushed to try here:
Attachment #8977078 - Flags: review?(mgaudet) → review+
Assignee: nobody → bobslept
Keywords: checkin-needed
Pushed by
Deduplicate LoadObject using emitLoadStubField. r=mgaudet
Keywords: checkin-needed
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.