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

Unified Diff: src/ia32/codegen-ia32.cc

Issue 3388005: Make the CompareStub and the UnaryOpStub accept smi inputs.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: x64 and ARM port Created 10 years, 3 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
Index: src/ia32/codegen-ia32.cc
===================================================================
--- src/ia32/codegen-ia32.cc (revision 5449)
+++ src/ia32/codegen-ia32.cc (working copy)
@@ -2646,6 +2646,19 @@
}
+static CompareFlags ComputeCompareFlags(NaNInformation nan_info,
+ bool inline_number_compare) {
+ CompareFlags flags = NO_SMI_COMPARE_IN_STUB;
+ if (nan_info == kCantBothBeNaN) {
+ flags = static_cast<CompareFlags>(flags | CANT_BOTH_BE_NAN);
+ }
+ if (inline_number_compare) {
+ flags = static_cast<CompareFlags>(flags | NO_NUMBER_COMPARE_IN_STUB);
+ }
+ return flags;
+}
+
+
void CodeGenerator::Comparison(AstNode* node,
Condition cc,
bool strict,
@@ -2773,7 +2786,9 @@
// Setup and call the compare stub.
is_not_string.Bind(&left_side);
- CompareStub stub(cc, strict, kCantBothBeNaN);
+ CompareFlags flags =
+ static_cast<CompareFlags>(CANT_BOTH_BE_NAN | NO_SMI_COMPARE_IN_STUB);
+ CompareStub stub(cc, strict, flags);
Result result = frame_->CallStub(&stub, &left_side, &right_side);
result.ToRegister();
__ cmp(result.reg(), 0);
@@ -2867,7 +2882,8 @@
// End of in-line compare, call out to the compare stub. Don't include
// number comparison in the stub if it was inlined.
- CompareStub stub(cc, strict, nan_info, !inline_number_compare);
+ CompareFlags flags = ComputeCompareFlags(nan_info, inline_number_compare);
+ CompareStub stub(cc, strict, flags);
Result answer = frame_->CallStub(&stub, &left_side, &right_side);
__ test(answer.reg(), Operand(answer.reg()));
answer.Unuse();
@@ -2900,7 +2916,9 @@
// End of in-line compare, call out to the compare stub. Don't include
// number comparison in the stub if it was inlined.
- CompareStub stub(cc, strict, nan_info, !inline_number_compare);
+ CompareFlags flags =
+ ComputeCompareFlags(nan_info, inline_number_compare);
+ CompareStub stub(cc, strict, flags);
Result answer = frame_->CallStub(&stub, &left_side, &right_side);
__ test(answer.reg(), Operand(answer.reg()));
answer.Unuse();
@@ -2994,7 +3012,6 @@
dest->false_target()->Branch(zero);
} else {
// Do the smi check, then the comparison.
- JumpTarget is_not_smi;
__ test(left_reg, Immediate(kSmiTagMask));
is_smi.Branch(zero, left_side, right_side);
}
@@ -3031,7 +3048,9 @@
}
// Setup and call the compare stub.
- CompareStub stub(cc, strict, kCantBothBeNaN);
+ CompareFlags flags =
+ static_cast<CompareFlags>(CANT_BOTH_BE_NAN | NO_SMI_CODE_IN_STUB);
+ CompareStub stub(cc, strict, flags);
Result result = frame_->CallStub(&stub, left_side, right_side);
result.ToRegister();
__ test(result.reg(), Operand(result.reg()));
@@ -8146,6 +8165,7 @@
GenericUnaryOpStub stub(
Token::SUB,
overwrite,
+ NO_UNARY_FLAGS,
no_negative_zero ? kIgnoreNegativeZero : kStrictNegativeZero);
Result operand = frame_->Pop();
Result answer = frame_->CallStub(&stub, &operand);
@@ -8173,7 +8193,9 @@
__ test(operand.reg(), Immediate(kSmiTagMask));
smi_label.Branch(zero, &operand, taken);
- GenericUnaryOpStub stub(Token::BIT_NOT, overwrite);
+ GenericUnaryOpStub stub(Token::BIT_NOT,
+ overwrite,
+ NO_UNARY_SMI_CODE_IN_STUB);
Result answer = frame_->CallStub(&stub, &operand);
continue_label.Jump(&answer);

Powered by Google App Engine
This is Rietveld 408576698