Closed
Bug 812596
Opened 13 years ago
Closed 13 years ago
BaselineCompiler: Add GETELEM/SETELEM ICs
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(4 files, 2 obsolete files)
5.22 KB,
patch
|
djvj
:
review+
|
Details | Diff | Splinter Review |
13.87 KB,
patch
|
djvj
:
review+
|
Details | Diff | Splinter Review |
11.77 KB,
patch
|
djvj
:
review+
|
Details | Diff | Splinter Review |
6.89 KB,
patch
|
djvj
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•13 years ago
|
||
Attachment #682578 -
Flags: review?(kvijayan)
Assignee | ||
Comment 2•13 years ago
|
||
Updated after the merge today.
Attachment #682578 -
Attachment is obsolete: true
Attachment #682578 -
Flags: review?(kvijayan)
Attachment #683046 -
Flags: review?(kvijayan)
Assignee | ||
Comment 3•13 years ago
|
||
I tried to add hasStub to ICEntry instead of FallbackStub, but that lead to some complicated dependencies. Also
Attachment #683056 -
Flags: review?(kvijayan)
Assignee | ||
Comment 4•13 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #3)
> Also
Sorry ignore this ;)
Updated•13 years ago
|
Attachment #683046 -
Flags: review?(kvijayan) → review+
Comment 5•13 years ago
|
||
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)
Assignee | ||
Comment 6•13 years ago
|
||
Now takes a scratch register from the register set.
Attachment #683056 -
Attachment is obsolete: true
Attachment #683508 -
Flags: review?(kvijayan)
Assignee | ||
Comment 7•13 years ago
|
||
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)
Assignee | ||
Comment 8•13 years ago
|
||
Attachment #683522 -
Flags: review?(kvijayan)
Assignee | ||
Updated•13 years ago
|
Summary: BaselineCompiler: Add a GETELEM IC → BaselineCompiler: Add GETELEM/SETELEM ICs
Comment 9•13 years ago
|
||
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+
Updated•13 years ago
|
Attachment #683520 -
Flags: review?(kvijayan) → review+
Comment 10•13 years ago
|
||
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.
Updated•13 years ago
|
Attachment #683522 -
Flags: review?(kvijayan) → review+
Assignee | ||
Comment 11•13 years ago
|
||
https://hg.mozilla.org/projects/ionmonkey/rev/cb05e88b551e
https://hg.mozilla.org/projects/ionmonkey/rev/32ab3af7f779
https://hg.mozilla.org/projects/ionmonkey/rev/1c1cd2a6d76c
https://hg.mozilla.org/projects/ionmonkey/rev/b8159d750821
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•