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

Unified Diff: runtime/vm/intrinsifier_x64.cc

Issue 1823123002: VM: Intrinsify double arithmetic operations with a smi rhs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
« runtime/vm/intrinsifier_mips.cc ('K') | « runtime/vm/intrinsifier_mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_x64.cc
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index 5fd3ad77999a4aca7f45751b15ae97ba0aa70a8e..80b7395b9ff338b58d8904b746bd8d1bbf9e4d17 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -1295,10 +1295,11 @@ void Intrinsifier::Double_lessEqualThan(Assembler* assembler) {
// Expects left argument to be double (receiver). Right argument is unknown.
// Both arguments are on stack.
static void DoubleArithmeticOperations(Assembler* assembler, Token::Kind kind) {
- Label fall_through;
- TestLastArgumentIsDouble(assembler, &fall_through, &fall_through);
+ Label fall_through, is_smi, double_op;
+ TestLastArgumentIsDouble(assembler, &is_smi, &fall_through);
// Both arguments are double, right operand is in RAX.
__ movsd(XMM1, FieldAddress(RAX, Double::value_offset()));
+ __ Bind(&double_op);
__ movq(RAX, Address(RSP, + 2 * kWordSize)); // Left argument.
__ movsd(XMM0, FieldAddress(RAX, Double::value_offset()));
switch (kind) {
@@ -1317,6 +1318,10 @@ static void DoubleArithmeticOperations(Assembler* assembler, Token::Kind kind) {
R13);
__ movsd(FieldAddress(RAX, Double::value_offset()), XMM0);
__ ret();
+ __ Bind(&is_smi);
+ __ SmiUntag(RAX);
+ __ cvtsi2sdq(XMM1, RAX);
+ __ jmp(&double_op);
__ Bind(&fall_through);
}
« runtime/vm/intrinsifier_mips.cc ('K') | « runtime/vm/intrinsifier_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698