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

Unified Diff: src/x64/full-codegen-x64.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
« src/flag-definitions.h ('K') | « src/x64/codegen-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/full-codegen-x64.cc
===================================================================
--- src/x64/full-codegen-x64.cc (revision 5449)
+++ src/x64/full-codegen-x64.cc (working copy)
@@ -677,9 +677,10 @@
VisitForValue(clause->label(), kAccumulator);
// Perform the comparison as if via '==='.
- if (ShouldInlineSmiCase(Token::EQ_STRICT)) {
+ __ movq(rdx, Operand(rsp, 0)); // Switch value.
+ bool inline_smi_code = ShouldInlineSmiCase(Token::EQ_STRICT);
+ if (inline_smi_code) {
Label slow_case;
- __ movq(rdx, Operand(rsp, 0)); // Switch value.
__ JumpIfNotBothSmi(rdx, rax, &slow_case);
__ SmiCompare(rdx, rax);
__ j(not_equal, &next_test);
@@ -688,7 +689,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);
__ testq(rax, rax);
__ j(not_equal, &next_test);
@@ -2954,7 +2958,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 rax.
VisitForValue(expr->expression(), kAccumulator);
@@ -2969,7 +2973,8 @@
// in the accumulator register rax.
VisitForValue(expr->expression(), kAccumulator);
Label done;
- if (ShouldInlineSmiCase(expr->op())) {
+ bool inline_smi_case = ShouldInlineSmiCase(expr->op());
+ if (inline_smi_case) {
Label call_stub;
__ JumpIfNotSmi(rax, &call_stub);
__ SmiNot(rax, rax);
@@ -2979,7 +2984,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_, rax);
@@ -3361,7 +3369,8 @@
UNREACHABLE();
}
- if (ShouldInlineSmiCase(op)) {
+ bool inline_smi_code = ShouldInlineSmiCase(op);
+ if (inline_smi_code) {
Label slow_case;
__ JumpIfNotBothSmi(rax, rdx, &slow_case);
__ SmiCompare(rdx, rax);
@@ -3369,7 +3378,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);
__ testq(rax, rax);
Split(cc, if_true, if_false, fall_through);
« src/flag-definitions.h ('K') | « src/x64/codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698