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

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

Issue 141593005: A64: Implement Smi support in MathAbs (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 | « no previous file | 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 d344b130159b01502124930f5b187952e88d5ca7..1b82b33962deec3a4b7dae5ed5ed6d43df1e1dbb 100644
--- a/src/a64/lithium-a64.cc
+++ b/src/a64/lithium-a64.cc
@@ -2377,8 +2377,7 @@ LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
switch (instr->op()) {
case kMathAbs: {
Representation r = instr->representation();
- // TODO(jbramley): Support smis in LMathAbs and use that.
- if (r.IsTagged() || r.IsSmi()) {
+ if (r.IsTagged()) {
// The tagged case might need to allocate a HeapNumber for the result,
// so it is handled by a separate LInstruction.
LOperand* input = UseRegister(instr->value());
@@ -2395,9 +2394,9 @@ LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
// The Double case can never fail so it doesn't need an environment.
return DefineAsRegister(result);
} else {
- ASSERT(r.IsInteger32());
- // The Integer32 case needs an environment because it can deoptimize
- // on INT_MIN.
+ ASSERT(r.IsInteger32() || r.IsSmi());
+ // The Integer32 and Smi cases need an environment because they can
+ // deoptimize on minimum representable number.
return AssignEnvironment(DefineAsRegister(result));
}
}
« no previous file with comments | « no previous file | src/a64/lithium-codegen-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698