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

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

Issue 9110008: Inline Math.max and Math.min in crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 12 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 | « src/ia32/lithium-ia32.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-ia32.cc
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc
index 5cd276f3001b2f08d12df41d37d2ba50b7a82c82..71ee8e8f6adabb15a989d4a0175e967f8916e4e8 100644
--- a/src/ia32/lithium-ia32.cc
+++ b/src/ia32/lithium-ia32.cc
@@ -1456,6 +1456,30 @@ LInstruction* LChunkBuilder::DoPower(HPower* instr) {
}
+LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) {
+ ASSERT(instr->representation().Equals(instr->left()->representation()));
+ ASSERT(instr->representation().Equals(instr->right()->representation()));
+ LOperand* left = UseRegister(instr->left());
+ LOperand* right = UseRegister(instr->right());
+ LOperand* temp0 = NULL;
+ LOperand* temp1 = NULL;
+ LOperand* temp2 = NULL;
+ if (instr->representation().IsTagged()) {
+ // Both arguments are tagged.
+ temp0 = TempRegister();
+ temp1 = FixedTemp(xmm1);
+ temp2 = FixedTemp(xmm2);
+ } else if (instr->representation().IsDouble()) {
+ // Both arguments are unboxed doubles.
+ temp0 = TempRegister();
+ temp1 = FixedTemp(xmm1);
+ } // Else: both arguments are untagged integers.
+ LMathMinMax* minmax =
+ new(zone()) LMathMinMax(left, right, temp0, temp1, temp2, instr->op());
+ return AssignEnvironment(DefineSameAsFirst(minmax));
+}
+
+
LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
ASSERT(instr->left()->representation().IsTagged());
ASSERT(instr->right()->representation().IsTagged());
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698