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

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

Issue 21903003: MIPS: Avoid redundant smi check for Math.abs (Closed) Base URL: https://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 | no next file » | 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 3634 matching lines...) Expand 10 before | Expand all | Expand 10 after
3645 virtual LInstruction* instr() { return instr_; } 3645 virtual LInstruction* instr() { return instr_; }
3646 private: 3646 private:
3647 LMathAbs* instr_; 3647 LMathAbs* instr_;
3648 }; 3648 };
3649 3649
3650 Representation r = instr->hydrogen()->value()->representation(); 3650 Representation r = instr->hydrogen()->value()->representation();
3651 if (r.IsDouble()) { 3651 if (r.IsDouble()) {
3652 FPURegister input = ToDoubleRegister(instr->value()); 3652 FPURegister input = ToDoubleRegister(instr->value());
3653 FPURegister result = ToDoubleRegister(instr->result()); 3653 FPURegister result = ToDoubleRegister(instr->result());
3654 __ abs_d(result, input); 3654 __ abs_d(result, input);
3655 } else if (r.IsInteger32()) { 3655 } else if (r.IsSmiOrInteger32()) {
3656 EmitIntegerMathAbs(instr); 3656 EmitIntegerMathAbs(instr);
3657 } else { 3657 } else {
3658 // Representation is tagged. 3658 // Representation is tagged.
3659 DeferredMathAbsTaggedHeapNumber* deferred = 3659 DeferredMathAbsTaggedHeapNumber* deferred =
3660 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr); 3660 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr);
3661 Register input = ToRegister(instr->value()); 3661 Register input = ToRegister(instr->value());
3662 // Smi check. 3662 // Smi check.
3663 __ JumpIfNotSmi(input, deferred->entry()); 3663 __ JumpIfNotSmi(input, deferred->entry());
3664 // If smi, handle it directly. 3664 // If smi, handle it directly.
3665 EmitIntegerMathAbs(instr); 3665 EmitIntegerMathAbs(instr);
(...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after
5842 __ Subu(scratch, result, scratch); 5842 __ Subu(scratch, result, scratch);
5843 __ lw(result, FieldMemOperand(scratch, 5843 __ lw(result, FieldMemOperand(scratch,
5844 FixedArray::kHeaderSize - kPointerSize)); 5844 FixedArray::kHeaderSize - kPointerSize));
5845 __ bind(&done); 5845 __ bind(&done);
5846 } 5846 }
5847 5847
5848 5848
5849 #undef __ 5849 #undef __
5850 5850
5851 } } // namespace v8::internal 5851 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698