Improve count operation in top-level compiler on ARM.

Save one instruction by using stm instead of push.

Review URL: http://codereview.chromium.org/517027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3531 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 637a2195
......@@ -1510,14 +1510,13 @@ void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
}
// Call runtime for +1/-1.
__ push(r0);
__ mov(ip, Operand(Smi::FromInt(1)));
__ push(ip);
if (expr->op() == Token::INC) {
__ CallRuntime(Runtime::kNumberAdd, 2);
__ mov(ip, Operand(Smi::FromInt(1)));
} else {
__ CallRuntime(Runtime::kNumberSub, 2);
__ mov(ip, Operand(Smi::FromInt(-1)));
}
__ stm(db_w, sp, ip.bit() | r0.bit());
__ CallRuntime(Runtime::kNumberAdd, 2);
// Store the value returned in r0.
switch (assign_type) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment