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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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 | « src/arm/lithium-codegen-arm.cc ('k') | src/x64/lithium-codegen-x64.h » ('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 3815 matching lines...) Expand 10 before | Expand all | Expand 10 after
3826 ASSERT(instr->value()->Equals(instr->result())); 3826 ASSERT(instr->value()->Equals(instr->result()));
3827 Representation r = instr->hydrogen()->value()->representation(); 3827 Representation r = instr->hydrogen()->value()->representation();
3828 3828
3829 CpuFeatureScope scope(masm(), SSE2); 3829 CpuFeatureScope scope(masm(), SSE2);
3830 if (r.IsDouble()) { 3830 if (r.IsDouble()) {
3831 XMMRegister scratch = xmm0; 3831 XMMRegister scratch = xmm0;
3832 XMMRegister input_reg = ToDoubleRegister(instr->value()); 3832 XMMRegister input_reg = ToDoubleRegister(instr->value());
3833 __ xorps(scratch, scratch); 3833 __ xorps(scratch, scratch);
3834 __ subsd(scratch, input_reg); 3834 __ subsd(scratch, input_reg);
3835 __ pand(input_reg, scratch); 3835 __ pand(input_reg, scratch);
3836 } else if (r.IsInteger32()) { 3836 } else if (r.IsSmiOrInteger32()) {
3837 EmitIntegerMathAbs(instr); 3837 EmitIntegerMathAbs(instr);
3838 } else { // Tagged case. 3838 } else { // Tagged case.
3839 DeferredMathAbsTaggedHeapNumber* deferred = 3839 DeferredMathAbsTaggedHeapNumber* deferred =
3840 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr); 3840 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr);
3841 Register input_reg = ToRegister(instr->value()); 3841 Register input_reg = ToRegister(instr->value());
3842 // Smi check. 3842 // Smi check.
3843 __ JumpIfNotSmi(input_reg, deferred->entry()); 3843 __ JumpIfNotSmi(input_reg, deferred->entry());
3844 EmitIntegerMathAbs(instr); 3844 EmitIntegerMathAbs(instr);
3845 __ bind(deferred->exit()); 3845 __ bind(deferred->exit());
3846 } 3846 }
(...skipping 2678 matching lines...) Expand 10 before | Expand all | Expand 10 after
6525 FixedArray::kHeaderSize - kPointerSize)); 6525 FixedArray::kHeaderSize - kPointerSize));
6526 __ bind(&done); 6526 __ bind(&done);
6527 } 6527 }
6528 6528
6529 6529
6530 #undef __ 6530 #undef __
6531 6531
6532 } } // namespace v8::internal 6532 } } // namespace v8::internal
6533 6533
6534 #endif // V8_TARGET_ARCH_IA32 6534 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/x64/lithium-codegen-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698