Closed
Bug 781368
Opened 12 years ago
Closed 12 years ago
IonMonkey: Fold TypeOf strings in MConstant.
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: sstangl, Unassigned)
Details
Attachments
(1 file, 1 obsolete file)
2.78 KB,
patch
|
efaust
:
review+
|
Details | Diff | Splinter Review |
JSOP_TYPEOF can produce an MConstant string, but we still lower to LCompareS, which takes a VM call. Instead, we should just fold away the comparison where possible. Miniscule performance improvement on kraken-crypto-pbkdf2.
Attachment #650345 -
Flags: review?(efaust)
Comment 1•12 years ago
|
||
Comment on attachment 650345 [details] [diff] [review] patch Review of attachment 650345 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/ion/MIR.cpp @@ +1354,5 @@ > + if (left == right) > + equal = true; > + else if (!EqualStrings(GetIonContext()->cx, lhs.toString(), rhs.toString(), &equal)) > + return false; > + *result = (equal ^ (jsop_ != JSOP_EQ && jsop_ != JSOP_STRICTEQ)); So if jsop_ == JSOP_LT, and equal came back false, result must be true? Are we guaranteed of that ordering?
Reporter | ||
Comment 2•12 years ago
|
||
Whoops. Calling EqualStrings() is obviously only a useful optimization if we're going to be checking whether strings are equal.
Attachment #650345 -
Attachment is obsolete: true
Attachment #650345 -
Flags: review?(efaust)
Attachment #650350 -
Flags: review?(efaust)
Comment 3•12 years ago
|
||
Comment on attachment 650350 [details] [diff] [review] patch v2 Review of attachment 650350 [details] [diff] [review]: ----------------------------------------------------------------- r=me. ::: js/src/ion/Lowering.cpp @@ +351,5 @@ > + return add(new LGoto(num ? ifTrue : ifFalse)); > + } > + > + // Constant Boolean operand. > + if (opd->type() == MIRType_Boolean && opd->isConstant()) { In theory it makes more sense to test ops->isConsant() first, since that's less likely to be true, but this is more in line with the structure of the existing code. ::: js/src/ion/MIR.cpp @@ +1360,5 @@ > + if (left == right) > + equal = true; > + else if (!EqualStrings(GetIonContext()->cx, lhs.toString(), rhs.toString(), &equal)) > + return false; > + *result = (equal ^ (jsop_ != JSOP_EQ && jsop_ != JSOP_STRICTEQ)); We could still make JSOP_GE and JSOP_LE work here in the equal case, at least. At any rate, this could use a comment.
Attachment #650350 -
Flags: review?(efaust) → review+
Reporter | ||
Comment 4•12 years ago
|
||
http://hg.mozilla.org/projects/ionmonkey/rev/0400c12c5295
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•