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

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

Issue 151163006: A64: Implement LShiftS (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/a64/lithium-a64.h ('k') | src/a64/lithium-codegen-a64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/lithium-a64.cc
diff --git a/src/a64/lithium-a64.cc b/src/a64/lithium-a64.cc
index 1b82b33962deec3a4b7dae5ed5ed6d43df1e1dbb..b1ff84d926e1453d1c8f39a2d9c75d94473ad1ca 100644
--- a/src/a64/lithium-a64.cc
+++ b/src/a64/lithium-a64.cc
@@ -2010,18 +2010,22 @@ LInstruction* LChunkBuilder::DoSeqStringSetChar(HSeqStringSetChar* instr) {
LInstruction* LChunkBuilder::DoShift(Token::Value op,
HBitwiseBinaryOperation* instr) {
- // TODO(jbramley): Support smis inline, like integers.
- if (instr->representation().IsSmiOrTagged()) {
+ if (instr->representation().IsTagged()) {
return DoArithmeticT(op, instr);
}
- ASSERT(instr->representation().IsInteger32());
+ ASSERT(instr->representation().IsInteger32() ||
+ instr->representation().IsSmi());
ASSERT(instr->left()->representation().Equals(instr->representation()));
ASSERT(instr->right()->representation().Equals(instr->representation()));
- LOperand* left = UseRegisterAtStart(instr->left());
+
+ LOperand* left = instr->representation().IsSmi()
+ ? UseRegister(instr->left())
+ : UseRegisterAtStart(instr->left());
HValue* right_value = instr->right();
LOperand* right = NULL;
+ LOperand* temp = NULL;
int constant_value = 0;
if (right_value->IsConstant()) {
right = UseConstant(right_value);
@@ -2029,6 +2033,9 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
constant_value = constant->Integer32Value() & 0x1f;
} else {
right = UseRegisterAtStart(right_value);
+ if (op == Token::ROR) {
+ temp = TempRegister();
+ }
}
// Shift operations can only deoptimize if we do a logical shift by 0 and the
@@ -2042,8 +2049,15 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
}
}
- LInstruction* result =
- DefineAsRegister(new(zone()) LShiftI(op, left, right, does_deopt));
+ LInstruction* result;
+ if (instr->representation().IsInteger32()) {
+ result = DefineAsRegister(new(zone()) LShiftI(op, left, right, does_deopt));
+ } else {
+ ASSERT(instr->representation().IsSmi());
+ result = DefineAsRegister(
+ new(zone()) LShiftS(op, left, right, temp, does_deopt));
+ }
+
return does_deopt ? AssignEnvironment(result) : result;
}
« no previous file with comments | « src/a64/lithium-a64.h ('k') | src/a64/lithium-codegen-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698