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

Unified Diff: src/ia32/full-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/full-codegen-ia32.cc
===================================================================
--- src/ia32/full-codegen-ia32.cc (revision 5449)
+++ src/ia32/full-codegen-ia32.cc (working copy)
@@ -684,7 +684,8 @@
// Perform the comparison as if via '==='.
__ mov(edx, Operand(esp, 0)); // Switch value.
- if (ShouldInlineSmiCase(Token::EQ_STRICT)) {
+ bool inline_smi_code = ShouldInlineSmiCase(Token::EQ_STRICT);
+ if (inline_smi_code) {
Label slow_case;
__ mov(ecx, edx);
__ or_(ecx, Operand(eax));
@@ -697,7 +698,10 @@
__ bind(&slow_case);
}
- CompareStub stub(equal, true);
+ CompareFlags flags = inline_smi_code
+ ? NO_SMI_COMPARE_IN_STUB
+ : NO_COMPARE_FLAGS;
+ CompareStub stub(equal, true, flags);
__ CallStub(&stub);
__ test(eax, Operand(eax));
__ j(not_equal, &next_test);
@@ -3257,7 +3261,7 @@
bool can_overwrite = expr->expression()->ResultOverwriteAllowed();
UnaryOverwriteMode overwrite =
can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE;
- GenericUnaryOpStub stub(Token::SUB, overwrite);
+ GenericUnaryOpStub stub(Token::SUB, overwrite, NO_UNARY_FLAGS);
// GenericUnaryOpStub expects the argument to be in the
// accumulator register eax.
VisitForValue(expr->expression(), kAccumulator);
@@ -3272,7 +3276,8 @@
// in the accumulator register eax.
VisitForValue(expr->expression(), kAccumulator);
Label done;
- if (ShouldInlineSmiCase(expr->op())) {
+ bool inline_smi_case = ShouldInlineSmiCase(expr->op());
+ if (inline_smi_case) {
Label call_stub;
__ test(eax, Immediate(kSmiTagMask));
__ j(not_zero, &call_stub);
@@ -3284,7 +3289,10 @@
bool overwrite = expr->expression()->ResultOverwriteAllowed();
UnaryOverwriteMode mode =
overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE;
- GenericUnaryOpStub stub(Token::BIT_NOT, mode);
+ UnaryOpFlags flags = inline_smi_case
+ ? NO_UNARY_SMI_CODE_IN_STUB
+ : NO_UNARY_FLAGS;
+ GenericUnaryOpStub stub(Token::BIT_NOT, mode, flags);
__ CallStub(&stub);
__ bind(&done);
Apply(context_, eax);
@@ -3672,7 +3680,8 @@
UNREACHABLE();
}
- if (ShouldInlineSmiCase(op)) {
+ bool inline_smi_code = ShouldInlineSmiCase(op);
+ if (inline_smi_code) {
Label slow_case;
__ mov(ecx, Operand(edx));
__ or_(ecx, Operand(eax));
@@ -3683,7 +3692,10 @@
__ bind(&slow_case);
}
- CompareStub stub(cc, strict);
+ CompareFlags flags = inline_smi_code
+ ? NO_SMI_COMPARE_IN_STUB
+ : NO_COMPARE_FLAGS;
+ CompareStub stub(cc, strict, flags);
__ CallStub(&stub);
__ test(eax, Operand(eax));
Split(cc, if_true, if_false, fall_through);

Powered by Google App Engine
This is Rietveld 408576698