зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1177318 - Add Ion support for JSOP_TOSTRING, to make template strings faster. r=jandem.
--HG-- extra : commitid : 5sBn3j0Ttil extra : rebase_source : fa44a4dfc7cab12600e6eb41a684cc6cf7fbc718
This commit is contained in:
Родитель
5e14a3b3a8
Коммит
15a26cce97
|
@ -699,6 +699,7 @@ IonBuilder::analyzeNewLoopTypes(MBasicBlock* entry, jsbytecode* start, jsbytecod
|
|||
type = MIRType_Double;
|
||||
break;
|
||||
case JSOP_STRING:
|
||||
case JSOP_TOSTRING:
|
||||
case JSOP_TYPEOF:
|
||||
case JSOP_TYPEOFEXPR:
|
||||
type = MIRType_String;
|
||||
|
@ -1524,6 +1525,7 @@ IonBuilder::traverseBytecode()
|
|||
|
||||
case JSOP_POS:
|
||||
case JSOP_TOID:
|
||||
case JSOP_TOSTRING:
|
||||
// These ops may leave their input on the stack without setting
|
||||
// the ImplicitlyUsed flag. If this value will be popped immediately,
|
||||
// we may replace it with |undefined|, but the difference is
|
||||
|
@ -1665,6 +1667,9 @@ IonBuilder::inspectOpcode(JSOp op)
|
|||
case JSOP_NEG:
|
||||
return jsop_neg();
|
||||
|
||||
case JSOP_TOSTRING:
|
||||
return jsop_tostring();
|
||||
|
||||
case JSOP_AND:
|
||||
case JSOP_OR:
|
||||
return jsop_andor(op);
|
||||
|
@ -4548,6 +4553,7 @@ IonBuilder::jsop_bitnot()
|
|||
MOZ_ASSERT(ins->isEffectful());
|
||||
return resumeAfter(ins);
|
||||
}
|
||||
|
||||
bool
|
||||
IonBuilder::jsop_bitop(JSOp op)
|
||||
{
|
||||
|
@ -4865,6 +4871,20 @@ IonBuilder::jsop_neg()
|
|||
return jsop_binary_arith(JSOP_MUL, negator, right);
|
||||
}
|
||||
|
||||
bool
|
||||
IonBuilder::jsop_tostring()
|
||||
{
|
||||
if (current->peek(-1)->type() == MIRType_String)
|
||||
return true;
|
||||
|
||||
MDefinition* value = current->pop();
|
||||
MToString* ins = MToString::New(alloc(), value);
|
||||
current->add(ins);
|
||||
current->push(ins);
|
||||
MOZ_ASSERT(!ins->isEffectful());
|
||||
return true;
|
||||
}
|
||||
|
||||
class AutoAccumulateReturns
|
||||
{
|
||||
MIRGraph& graph_;
|
||||
|
|
|
@ -649,6 +649,7 @@ class IonBuilder
|
|||
bool jsop_pow();
|
||||
bool jsop_pos();
|
||||
bool jsop_neg();
|
||||
bool jsop_tostring();
|
||||
bool jsop_setarg(uint32_t arg);
|
||||
bool jsop_defvar(uint32_t index);
|
||||
bool jsop_deffun(uint32_t index);
|
||||
|
|
Загрузка…
Ссылка в новой задаче