Closed
Bug 1017539
Opened 12 years ago
Closed 12 years ago
Move codegen for some LIR instructions to platform-independent code
Categories
(Core :: JavaScript Engine: JIT, defect)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: jandem, Assigned: jandem)
Details
Attachments
(7 files)
|
9.25 KB,
patch
|
sstangl
:
review+
|
Details | Diff | Splinter Review |
|
10.69 KB,
patch
|
sstangl
:
review+
|
Details | Diff | Splinter Review |
|
5.77 KB,
patch
|
sstangl
:
review+
|
Details | Diff | Splinter Review |
|
14.87 KB,
patch
|
sstangl
:
review+
|
Details | Diff | Splinter Review |
|
16.25 KB,
patch
|
sstangl
:
review+
|
Details | Diff | Splinter Review |
|
10.60 KB,
patch
|
sstangl
:
review+
|
Details | Diff | Splinter Review |
|
37.83 KB,
patch
|
sstangl
:
review+
|
Details | Diff | Splinter Review |
bz noticed LoadSlotV codegen is identical for all platforms. There are a number of other LIR instructions we can share as well.
| Assignee | ||
Comment 1•12 years ago
|
||
Attachment #8430732 -
Flags: review?(sstangl)
| Assignee | ||
Comment 2•12 years ago
|
||
We're using masm.loadUnboxedValue for LoadFixedSlotT, we can also use it for LoadSlotT.
Attachment #8430734 -
Flags: review?(sstangl)
| Assignee | ||
Comment 3•12 years ago
|
||
This patch uses masm.loadUnboxedValue for LoadElementT on x64, so that we can remove CodeGeneratorX64::loadUnboxedValue.
I also changed the x86 codegen to look more like the x64 one.
Attachment #8430754 -
Flags: review?(sstangl)
| Assignee | ||
Comment 4•12 years ago
|
||
Especially the ARM and MIPS implementations were way more complicated than necessary.
11 files changed, 37 insertions(+), 117 deletions(-)
Attachment #8430789 -
Flags: review?(sstangl)
| Assignee | ||
Comment 5•12 years ago
|
||
It's unused. There's JSOP_IMPLICITTHIS now but it's uncommon and if Ion ever has to compile it, it can be just a VM call.
Attachment #8430798 -
Flags: review?(sstangl)
| Assignee | ||
Updated•12 years ago
|
Attachment #8430798 -
Attachment description: rm MImplicitThis/LImplicitThis → Part 5 - rm MImplicitThis/LImplicitThis
| Assignee | ||
Comment 6•12 years ago
|
||
Attachment #8430803 -
Flags: review?(sstangl)
| Assignee | ||
Comment 7•12 years ago
|
||
Also moves storeUnboxedValue to the macro assemblers and eliminates some code duplication with storeElementTyped.
Attachment #8430875 -
Flags: review?(sstangl)
Updated•12 years ago
|
Attachment #8430732 -
Flags: review?(sstangl) → review+
Comment 8•12 years ago
|
||
Comment on attachment 8430734 [details] [diff] [review]
Part 2 - LoadSlotT
Review of attachment 8430734 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jit/CodeGenerator.cpp
@@ +1561,5 @@
> + Register base = ToRegister(lir->slots());
> + int32_t offset = lir->mir()->slot() * sizeof(js::Value);
> + AnyRegister result = ToAnyRegister(lir->output());
> +
> + masm.loadUnboxedValue(Address(base, offset), lir->mir()->type(), result);
loadUnboxedValue() could easily be moved to the shared CodeGenerator also. Needs the LoadElementT patch to land first, though.
Attachment #8430734 -
Flags: review?(sstangl) → review+
Updated•12 years ago
|
Attachment #8430754 -
Flags: review?(sstangl) → review+
Comment 9•12 years ago
|
||
Comment on attachment 8430789 [details] [diff] [review]
Part 4 - LoadElementT
Review of attachment 8430789 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jit/CodeGenerator.h
@@ +229,5 @@
> bool visitThrow(LThrow *lir);
> bool visitTypeOfV(LTypeOfV *lir);
> bool visitOutOfLineTypeOfV(OutOfLineTypeOfV *ool);
> bool visitToIdV(LToIdV *lir);
> + template<typename T>
prefer vertical whitespace before the template<typename T> line. Or just put it on the same line as the function declaration.
Attachment #8430789 -
Flags: review?(sstangl) → review+
Comment 10•12 years ago
|
||
Comment on attachment 8430798 [details] [diff] [review]
Part 5 - rm MImplicitThis/LImplicitThis
Review of attachment 8430798 [details] [diff] [review]:
-----------------------------------------------------------------
\o/
Attachment #8430798 -
Flags: review?(sstangl) → review+
Comment 11•12 years ago
|
||
Comment on attachment 8430803 [details] [diff] [review]
Part 6 - InterruptCheck
Review of attachment 8430803 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jit/CodeGenerator.cpp
@@ +8832,5 @@
> + if (!ool)
> + return false;
> +
> + masm.branch32(Assembler::NotEqual,
> + AbsoluteAddress(GetIonContext()->runtime->addressOfInterrupt()), Imm32(0),
If the AbsoluteAddress is declared on its own line and given a name, then the branch32() call need not span multiple lines.
Attachment #8430803 -
Flags: review?(sstangl) → review+
Comment 12•12 years ago
|
||
Comment on attachment 8430875 [details] [diff] [review]
Part 7 - StoreSlotT
Review of attachment 8430875 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jit/mips/CodeGenerator-mips.cpp
@@ -1752,5 @@
>
> masm.bind(&done);
> return true;
> }
>
It looks like MacroAssembler-mips.cpp doesn't have storeUnboxedValue() defined for it, but that function is called by shared code.
Attachment #8430875 -
Flags: review?(sstangl)
| Assignee | ||
Comment 13•12 years ago
|
||
(In reply to Sean Stangl [:sstangl] from comment #12)
> It looks like MacroAssembler-mips.cpp doesn't have storeUnboxedValue()
> defined for it, but that function is called by shared code.
That was on purpose. MIPS is a tier-3 platform so I don't think we should spend too much time on it, especially if there's no way to verify our changes (I don't think the simulator landed completely).
I can copy paste some code and hope it works, or define the function and add a MOZ_CRASH()...
Comment 14•12 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #13)
> (In reply to Sean Stangl [:sstangl] from comment #12)
> > It looks like MacroAssembler-mips.cpp doesn't have storeUnboxedValue()
> > defined for it, but that function is called by shared code.
>
> That was on purpose. MIPS is a tier-3 platform so I don't think we should
> spend too much time on it, especially if there's no way to verify our
> changes (I don't think the simulator landed completely).
>
> I can copy paste some code and hope it works, or define the function and add
> a MOZ_CRASH()...
Breaking compilation is probably preferable to MOZ_CRASH(), so I'll flip the bits.
Updated•12 years ago
|
Attachment #8430875 -
Flags: review+
| Assignee | ||
Comment 15•12 years ago
|
||
Thanks for the quick reviews!
https://hg.mozilla.org/integration/mozilla-inbound/rev/163a0c70a67d
https://hg.mozilla.org/integration/mozilla-inbound/rev/ddd78e3d6656
https://hg.mozilla.org/integration/mozilla-inbound/rev/b010c950836b
https://hg.mozilla.org/integration/mozilla-inbound/rev/f7ec1d00485e
https://hg.mozilla.org/integration/mozilla-inbound/rev/7cb1827f5f61
https://hg.mozilla.org/integration/mozilla-inbound/rev/b99f4cd25bad
https://hg.mozilla.org/integration/mozilla-inbound/rev/c970565582c2
Comment 16•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/163a0c70a67d
https://hg.mozilla.org/mozilla-central/rev/ddd78e3d6656
https://hg.mozilla.org/mozilla-central/rev/b010c950836b
https://hg.mozilla.org/mozilla-central/rev/f7ec1d00485e
https://hg.mozilla.org/mozilla-central/rev/7cb1827f5f61
https://hg.mozilla.org/mozilla-central/rev/b99f4cd25bad
https://hg.mozilla.org/mozilla-central/rev/c970565582c2
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in
before you can comment on or make changes to this bug.
Description
•