Closed Bug 1114574 Opened 11 years ago Closed 11 years ago

Improve MCompare::tryFold

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: jandem, Assigned: jandem)

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
I think the code was written before we had TypeSets in MIR instructions. Now we can rewrite it to use mightBeType, which is both simpler/shorter (no need to list all types) and more effective, because we can now fold things like: (object|null) === undefined (int32|string) === true etc.
Attachment #8540130 - Flags: review?(hv1989)
Comment on attachment 8540130 [details] [diff] [review] Patch Review of attachment 8540130 [details] [diff] [review]: ----------------------------------------------------------------- Nice ::: js/src/jit/MIR.cpp @@ +3017,5 @@ > + *result = (op == JSOP_EQ); > + return true; > + } > + if (!lhs()->mightBeType(MIRType_Null) && !lhs()->mightBeType(MIRType_Undefined) && > + !operandMightEmulateUndefined()) Nit: maybe put every test on a new line? So put "!lhs()->mightBeType(MIRType_Undefined) &&" on a new line. I find that easier to read.
Attachment #8540130 - Flags: review?(hv1989) → review+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: