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

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 7218012: Make ToBooleanStub more consistent across platforms. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 6 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 __ li(a0, Operand(Smi::FromInt(ncr))); 1711 __ li(a0, Operand(Smi::FromInt(ncr)));
1712 __ push(a0); 1712 __ push(a0);
1713 } 1713 }
1714 1714
1715 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) 1715 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater)
1716 // tagged as a small integer. 1716 // tagged as a small integer.
1717 __ InvokeBuiltin(native, JUMP_FUNCTION); 1717 __ InvokeBuiltin(native, JUMP_FUNCTION);
1718 } 1718 }
1719 1719
1720 1720
1721 // This stub does not handle the inlined cases (Smis, Booleans, undefined).
1722 // The stub returns zero for false, and a non-zero value for true. 1721 // The stub returns zero for false, and a non-zero value for true.
1723 void ToBooleanStub::Generate(MacroAssembler* masm) { 1722 void ToBooleanStub::Generate(MacroAssembler* masm) {
1724 // This stub uses FPU instructions. 1723 // This stub uses FPU instructions.
1725 CpuFeatures::Scope scope(FPU); 1724 CpuFeatures::Scope scope(FPU);
1726 1725
1727 Label false_result; 1726 Label false_result;
1728 Label not_heap_number; 1727 Label not_heap_number;
1729 Register scratch0 = t5.is(tos_) ? t3 : t5; 1728 Register scratch0 = t5.is(tos_) ? t3 : t5;
1730 1729
1731 // undefined -> false 1730 // undefined -> false
(...skipping 5156 matching lines...) Expand 10 before | Expand all | Expand 10 after
6888 __ mov(result, zero_reg); 6887 __ mov(result, zero_reg);
6889 __ Ret(); 6888 __ Ret();
6890 } 6889 }
6891 6890
6892 6891
6893 #undef __ 6892 #undef __
6894 6893
6895 } } // namespace v8::internal 6894 } } // namespace v8::internal
6896 6895
6897 #endif // V8_TARGET_ARCH_MIPS 6896 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698