Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Unified Diff: src/mips/code-stubs-mips.cc

Issue 16361004: MIPS : Collect type feedback for power-of-2 right operands in BinaryOps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/code-stubs-mips.cc
diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc
index 552797adb224d70a3e36b79ec18269ef291811e0..3333213e621e926a3db53e0d87179705ab6aa121 100644
--- a/src/mips/code-stubs-mips.cc
+++ b/src/mips/code-stubs-mips.cc
@@ -2277,7 +2277,16 @@ void BinaryOpStub_GenerateSmiCode(
void BinaryOpStub::GenerateSmiStub(MacroAssembler* masm) {
- Label not_smis, call_runtime;
+ Label right_arg_changed, call_runtime;
+
+ if (op_ == Token::MOD && has_fixed_right_arg_) {
+ // It is guaranteed that the value will fit into a Smi, because if it
+ // didn't, we wouldn't be here, see BinaryOp_Patch.
+ __ Branch(&right_arg_changed,
+ ne,
+ a0,
+ Operand(Smi::FromInt(fixed_right_arg_value())));
+ }
if (result_type_ == BinaryOpIC::UNINITIALIZED ||
result_type_ == BinaryOpIC::SMI) {
@@ -2294,6 +2303,7 @@ void BinaryOpStub::GenerateSmiStub(MacroAssembler* masm) {
// Code falls through if the result is not returned as either a smi or heap
// number.
+ __ bind(&right_arg_changed);
GenerateTypeTransition(masm);
__ bind(&call_runtime);
@@ -2494,6 +2504,11 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
// to type transition.
} else {
+ if (has_fixed_right_arg_) {
+ __ Move(f16, fixed_right_arg_value());
+ __ BranchF(&transition, NULL, ne, f14, f16);
+ }
+
// We preserved a0 and a1 to be able to call runtime.
// Save the left value on the stack.
__ Push(t1, t0);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698