Simplify MacroAssemblerARMCompat::decBranchPtr.

RESOLVED FIXED in Firefox 46

Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: arai, Assigned: arai)

Tracking

Trunk
mozilla46
Points:
---

Firefox Tracking Flags

(firefox45 affected, firefox46 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
derived from bug 1229057 comment #30.

https://dxr.mozilla.org/mozilla-central/rev/470f4f8c2b2d6f82e56e161a4b05262c85f55b59/js/src/jit/arm/MacroAssembler-arm.h#985
>     void decBranchPtr(Condition cond, Register lhs, Imm32 imm, Label* label) {
>         subPtr(imm, lhs);
>         branch32(cond, lhs, Imm32(0), label);
>     }

branch32 calls ma_cmp with SetCC, but ma_sub called in subPtr can also called with SetCC.  We could replace them with ma_sub(..., SetCC) + j() or something


note that bug 1229057 will move the definition of decBranchPtr to MacroAssembler-arm-inl.h
(Assignee)

Updated

3 years ago
See Also: → bug 1229057
(Assignee)

Comment 1

3 years ago
Created attachment 8700396 [details] [diff] [review]
Simplify MacroAssemblerARMCompat::decBranchPtr.

Changed to almost same code as branchSub32.

Green on try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=302d5fb58843
Assignee: nobody → arai.unmht
Attachment #8700396 - Flags: review?(nicolas.b.pierron)
Comment on attachment 8700396 [details] [diff] [review]
Simplify MacroAssemblerARMCompat::decBranchPtr.

Review of attachment 8700396 [details] [diff] [review]:
-----------------------------------------------------------------

Good catch!

::: js/src/jit/arm/MacroAssembler-arm.h
@@ +972,5 @@
>          branch32(cond, lhs, imm, label);
>      }
> +    void decBranchPtr(Condition cond, Register lhs, Imm32 imm, Label* label) {
> +        ma_sub(imm, lhs, SetCC);
> +        j(cond, label);

nit: "j" is a x86-ism, prefer "as_b" instead.
Attachment #8700396 - Flags: review?(nicolas.b.pierron) → review+

Comment 4

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/6296b4d5aff3
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox46: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in before you can comment on or make changes to this bug.