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

Unified Diff: runtime/vm/intrinsifier_x64.cc

Issue 10753018: Intrinsify a couple of x64 methods (fix performance regression on Mandelbrot). Need to investigate … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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: runtime/vm/intrinsifier_x64.cc
===================================================================
--- runtime/vm/intrinsifier_x64.cc (revision 9494)
+++ runtime/vm/intrinsifier_x64.cc (working copy)
@@ -495,6 +495,13 @@
bool Intrinsifier::Integer_subFromInteger(Assembler* assembler) {
+ Label fall_through;
+ TestBothArgumentsSmis(assembler, &fall_through);
siva 2012/07/10 01:03:00 probably document // RAX contains .... like the do
srdjan 2012/07/10 01:11:29 Done.
+ __ subq(RAX, Address(RSP, + 2 * kWordSize));
+ __ j(OVERFLOW, &fall_through, Assembler::kNearJump);
+ // Result is in RAX.
+ __ ret();
+ __ Bind(&fall_through);
return false;
}
@@ -594,28 +601,47 @@
}
-bool Intrinsifier::Integer_lessThan(Assembler* assembler) {
+static bool CompareIntegers(Assembler* assembler, Condition true_condition) {
+ Label fall_through, true_label;
+ const Bool& bool_true = Bool::ZoneHandle(Bool::True());
+ const Bool& bool_false = Bool::ZoneHandle(Bool::False());
+ TestBothArgumentsSmis(assembler, &fall_through);
+ // RAX contains the right argument.
+ __ cmpq(Address(RSP, + 2 * kWordSize), RAX);
+ __ j(true_condition, &true_label, Assembler::kNearJump);
+ __ LoadObject(RAX, bool_false);
+ __ ret();
+ __ Bind(&true_label);
+ __ LoadObject(RAX, bool_true);
+ __ ret();
+ __ Bind(&fall_through);
return false;
}
+
+bool Intrinsifier::Integer_lessThan(Assembler* assembler) {
+ return CompareIntegers(assembler, LESS);
+}
+
+
bool Intrinsifier::Integer_greaterThanFromInt(Assembler* assembler) {
- return false;
+ return CompareIntegers(assembler, LESS);
}
bool Intrinsifier::Integer_greaterThan(Assembler* assembler) {
- return false;
+ return CompareIntegers(assembler, GREATER);
}
bool Intrinsifier::Integer_lessEqualThan(Assembler* assembler) {
- return false;
+ return CompareIntegers(assembler, LESS_EQUAL);
}
bool Intrinsifier::Integer_greaterEqualThan(Assembler* assembler) {
- return false;
+ return CompareIntegers(assembler, GREATER_EQUAL);
}
« 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