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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 21180004: Avoid redundant smi check for Math.abs (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 4 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 | src/ia32/lithium-codegen-ia32.cc » ('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 3758 matching lines...) Expand 10 before | Expand all | Expand 10 after
3769 virtual LInstruction* instr() { return instr_; } 3769 virtual LInstruction* instr() { return instr_; }
3770 private: 3770 private:
3771 LMathAbs* instr_; 3771 LMathAbs* instr_;
3772 }; 3772 };
3773 3773
3774 Representation r = instr->hydrogen()->value()->representation(); 3774 Representation r = instr->hydrogen()->value()->representation();
3775 if (r.IsDouble()) { 3775 if (r.IsDouble()) {
3776 DwVfpRegister input = ToDoubleRegister(instr->value()); 3776 DwVfpRegister input = ToDoubleRegister(instr->value());
3777 DwVfpRegister result = ToDoubleRegister(instr->result()); 3777 DwVfpRegister result = ToDoubleRegister(instr->result());
3778 __ vabs(result, input); 3778 __ vabs(result, input);
3779 } else if (r.IsInteger32()) { 3779 } else if (r.IsSmiOrInteger32()) {
3780 EmitIntegerMathAbs(instr); 3780 EmitIntegerMathAbs(instr);
3781 } else { 3781 } else {
3782 // Representation is tagged. 3782 // Representation is tagged.
3783 DeferredMathAbsTaggedHeapNumber* deferred = 3783 DeferredMathAbsTaggedHeapNumber* deferred =
3784 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr); 3784 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr);
3785 Register input = ToRegister(instr->value()); 3785 Register input = ToRegister(instr->value());
3786 // Smi check. 3786 // Smi check.
3787 __ JumpIfNotSmi(input, deferred->entry()); 3787 __ JumpIfNotSmi(input, deferred->entry());
3788 // If smi, handle it directly. 3788 // If smi, handle it directly.
3789 EmitIntegerMathAbs(instr); 3789 EmitIntegerMathAbs(instr);
(...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after
5838 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5838 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5839 __ ldr(result, FieldMemOperand(scratch, 5839 __ ldr(result, FieldMemOperand(scratch,
5840 FixedArray::kHeaderSize - kPointerSize)); 5840 FixedArray::kHeaderSize - kPointerSize));
5841 __ bind(&done); 5841 __ bind(&done);
5842 } 5842 }
5843 5843
5844 5844
5845 #undef __ 5845 #undef __
5846 5846
5847 } } // namespace v8::internal 5847 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698