Closed Bug 812596 Opened 13 years ago Closed 13 years ago

BaselineCompiler: Add GETELEM/SETELEM ICs

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(4 files, 2 obsolete files)

No description provided.
Attached patch Part 1: Fallback path (obsolete) — Splinter Review
Attachment #682578 - Flags: review?(kvijayan)
Updated after the merge today.
Attachment #682578 - Attachment is obsolete: true
Attachment #682578 - Flags: review?(kvijayan)
Attachment #683046 - Flags: review?(kvijayan)
Attached patch Part 2: Add dense array stub (obsolete) — Splinter Review
I tried to add hasStub to ICEntry instead of FallbackStub, but that lead to some complicated dependencies. Also
Attachment #683056 - Flags: review?(kvijayan)
(In reply to Jan de Mooij [:jandem] from comment #3) > Also Sorry ignore this ;)
Attachment #683046 - Flags: review?(kvijayan) → review+
Comment on attachment 683056 [details] [diff] [review] Part 2: Add dense array stub Review of attachment 683056 [details] [diff] [review]: ----------------------------------------------------------------- Looks good except for the register usage issue on ARM. I think what we should do is take ICStubCompiler::availableGeneralRegs, and specialize it for each platform. The regset returned by this method can be all registers that it's OK to clobber in the stubcode, and are usable for masm calls (e.g. ScratchReg is excluded). On x86 and x64, this set can include BaselineTailCallReg, on ARM it won't. Then, you should be able to pull out scratchReg from that register set. What do you think? Canceling review for now until we figure out the best approach for this. ::: js/src/ion/BaselineIC.cpp @@ +369,5 @@ > + Register obj = masm.extractObject(R0, ExtractTemp0); > + masm.branchTestObjShape(Assembler::NotEqual, obj, shape, &failure); > + > + // Load obj->elements in scratchReg. > + Register scratchReg = BaselineTailCallReg; This won't work on ARM, because on ARM, BaselineTailCallReg cannot be used as scratch, since it's |lr|, and we won't be able to return to mainline code if we clobber it.
Attachment #683056 - Flags: review?(kvijayan)
Now takes a scratch register from the register set.
Attachment #683056 - Attachment is obsolete: true
Attachment #683508 - Flags: review?(kvijayan)
SETELEM depends on the patches in this bug so I will just post them here.. This leaves the RHS Value on the stack and loads the object and index values in R0 and R1. Generated code looks reasonable and what's nice about it is that this is very similar to GETELEM.
Attachment #683520 - Flags: review?(kvijayan)
Attachment #683522 - Flags: review?(kvijayan)
Summary: BaselineCompiler: Add a GETELEM IC → BaselineCompiler: Add GETELEM/SETELEM ICs
Comment on attachment 683508 [details] [diff] [review] Part 2: Add dense array stub (v2) Review of attachment 683508 [details] [diff] [review]: ----------------------------------------------------------------- Cool :) I'm just going to add a type-monitor IC bug for this and make this bug dependent on it, just as a reminder.
Attachment #683508 - Flags: review?(kvijayan) → review+
Depends on: 813606
Attachment #683520 - Flags: review?(kvijayan) → review+
Comment on attachment 683522 [details] [diff] [review] Part 4: SETELEM dense array stub Review of attachment 683522 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/ion/BaselineIC.cpp @@ +485,5 @@ > + masm.branchTestMagic(Assembler::Equal, element, &failure); > + > + // It's safe to overwrite R0 now. > + masm.loadValue(Address(BaselineStackReg, ICStackValueOffset), R0); > + masm.storeValue(R0, element); Do we need to worry about updating the TypeObject for the array with the type of the value being set? If so, we may have to specialize the stubs on the incoming types for the RHS value.
Attachment #683522 - Flags: review?(kvijayan) → review+
No longer depends on: 813606
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: