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

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

Issue 217083003: Smi immediates are not supported on x64. Do not use it. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: m8 x64.debug.check Created 6 years, 8 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 | « src/x64/lithium-codegen-x64.cc ('k') | test/mjsunit/regress/regress-358059.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 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 if (instr->representation().IsSmiOrInteger32()) { 1525 if (instr->representation().IsSmiOrInteger32()) {
1526 // Check to see if it would be advantageous to use an lea instruction rather 1526 // Check to see if it would be advantageous to use an lea instruction rather
1527 // than an add. This is the case when no overflow check is needed and there 1527 // than an add. This is the case when no overflow check is needed and there
1528 // are multiple uses of the add's inputs, so using a 3-register add will 1528 // are multiple uses of the add's inputs, so using a 3-register add will
1529 // preserve all input values for later uses. 1529 // preserve all input values for later uses.
1530 bool use_lea = LAddI::UseLea(instr); 1530 bool use_lea = LAddI::UseLea(instr);
1531 ASSERT(instr->left()->representation().Equals(instr->representation())); 1531 ASSERT(instr->left()->representation().Equals(instr->representation()));
1532 ASSERT(instr->right()->representation().Equals(instr->representation())); 1532 ASSERT(instr->right()->representation().Equals(instr->representation()));
1533 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); 1533 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand());
1534 HValue* right_candidate = instr->BetterRightOperand(); 1534 HValue* right_candidate = instr->BetterRightOperand();
1535 LOperand* right = use_lea 1535 LOperand* right;
1536 ? UseRegisterOrConstantAtStart(right_candidate) 1536 if (instr->representation().IsSmi()) {
1537 : UseOrConstantAtStart(right_candidate); 1537 // We cannot add a tagged immediate to a tagged value,
1538 // so we request it in a register.
1539 right = UseRegisterAtStart(right_candidate);
1540 } else {
1541 right = use_lea ? UseRegisterOrConstantAtStart(right_candidate)
1542 : UseOrConstantAtStart(right_candidate);
1543 }
1538 LAddI* add = new(zone()) LAddI(left, right); 1544 LAddI* add = new(zone()) LAddI(left, right);
1539 bool can_overflow = instr->CheckFlag(HValue::kCanOverflow); 1545 bool can_overflow = instr->CheckFlag(HValue::kCanOverflow);
1540 LInstruction* result = use_lea 1546 LInstruction* result = use_lea ? DefineAsRegister(add)
1541 ? DefineAsRegister(add) 1547 : DefineSameAsFirst(add);
1542 : DefineSameAsFirst(add);
1543 if (can_overflow) { 1548 if (can_overflow) {
1544 result = AssignEnvironment(result); 1549 result = AssignEnvironment(result);
1545 } 1550 }
1546 return result; 1551 return result;
1547 } else if (instr->representation().IsExternal()) { 1552 } else if (instr->representation().IsExternal()) {
1548 ASSERT(instr->left()->representation().IsExternal()); 1553 ASSERT(instr->left()->representation().IsExternal());
1549 ASSERT(instr->right()->representation().IsInteger32()); 1554 ASSERT(instr->right()->representation().IsInteger32());
1550 ASSERT(!instr->CheckFlag(HValue::kCanOverflow)); 1555 ASSERT(!instr->CheckFlag(HValue::kCanOverflow));
1551 bool use_lea = LAddI::UseLea(instr); 1556 bool use_lea = LAddI::UseLea(instr);
1552 LOperand* left = UseRegisterAtStart(instr->left()); 1557 LOperand* left = UseRegisterAtStart(instr->left());
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
2598 LOperand* index = UseTempRegister(instr->index()); 2603 LOperand* index = UseTempRegister(instr->index());
2599 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); 2604 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
2600 LInstruction* result = DefineSameAsFirst(load); 2605 LInstruction* result = DefineSameAsFirst(load);
2601 return AssignPointerMap(result); 2606 return AssignPointerMap(result);
2602 } 2607 }
2603 2608
2604 2609
2605 } } // namespace v8::internal 2610 } } // namespace v8::internal
2606 2611
2607 #endif // V8_TARGET_ARCH_X64 2612 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | test/mjsunit/regress/regress-358059.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698