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

Side by Side Diff: src/x64/lithium-x64.cc

Issue 186593003: x64: Fix LMathMinMax for constant Smi right-hand operands (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-349079.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 } else { 1428 } else {
1429 return DoArithmeticT(Token::ADD, instr); 1429 return DoArithmeticT(Token::ADD, instr);
1430 } 1430 }
1431 return NULL; 1431 return NULL;
1432 } 1432 }
1433 1433
1434 1434
1435 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { 1435 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) {
1436 LOperand* left = NULL; 1436 LOperand* left = NULL;
1437 LOperand* right = NULL; 1437 LOperand* right = NULL;
1438 if (instr->representation().IsSmiOrInteger32()) { 1438 ASSERT(instr->left()->representation().Equals(instr->representation()));
1439 ASSERT(instr->left()->representation().Equals(instr->representation())); 1439 ASSERT(instr->right()->representation().Equals(instr->representation()));
1440 ASSERT(instr->right()->representation().Equals(instr->representation())); 1440 if (instr->representation().IsSmi()) {
1441 left = UseRegisterAtStart(instr->BetterLeftOperand());
1442 right = UseAtStart(instr->BetterRightOperand());
1443 } else if (instr->representation().IsInteger32()) {
1441 left = UseRegisterAtStart(instr->BetterLeftOperand()); 1444 left = UseRegisterAtStart(instr->BetterLeftOperand());
1442 right = UseOrConstantAtStart(instr->BetterRightOperand()); 1445 right = UseOrConstantAtStart(instr->BetterRightOperand());
1443 } else { 1446 } else {
1444 ASSERT(instr->representation().IsDouble()); 1447 ASSERT(instr->representation().IsDouble());
1445 ASSERT(instr->left()->representation().IsDouble());
1446 ASSERT(instr->right()->representation().IsDouble());
1447 left = UseRegisterAtStart(instr->left()); 1448 left = UseRegisterAtStart(instr->left());
1448 right = UseRegisterAtStart(instr->right()); 1449 right = UseRegisterAtStart(instr->right());
1449 } 1450 }
1450 LMathMinMax* minmax = new(zone()) LMathMinMax(left, right); 1451 LMathMinMax* minmax = new(zone()) LMathMinMax(left, right);
1451 return DefineSameAsFirst(minmax); 1452 return DefineSameAsFirst(minmax);
1452 } 1453 }
1453 1454
1454 1455
1455 LInstruction* LChunkBuilder::DoPower(HPower* instr) { 1456 LInstruction* LChunkBuilder::DoPower(HPower* instr) {
1456 ASSERT(instr->representation().IsDouble()); 1457 ASSERT(instr->representation().IsDouble());
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
2435 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2436 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2436 LOperand* object = UseRegister(instr->object()); 2437 LOperand* object = UseRegister(instr->object());
2437 LOperand* index = UseTempRegister(instr->index()); 2438 LOperand* index = UseTempRegister(instr->index());
2438 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2439 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2439 } 2440 }
2440 2441
2441 2442
2442 } } // namespace v8::internal 2443 } } // namespace v8::internal
2443 2444
2444 #endif // V8_TARGET_ARCH_X64 2445 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-349079.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698