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

Side by Side Diff: src/x64/macro-assembler-x64.h

Issue 6812046: X64: Convert HeapNumbers that contain valid smi values to smis in binop-stub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments. Created 9 years, 8 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 void PositiveSmiTimesPowerOfTwoToInteger64(Register dst, 316 void PositiveSmiTimesPowerOfTwoToInteger64(Register dst,
317 Register src, 317 Register src,
318 int power); 318 int power);
319 319
320 // Divide a positive smi's integer value by a power of two. 320 // Divide a positive smi's integer value by a power of two.
321 // Provides result as 32-bit integer value. 321 // Provides result as 32-bit integer value.
322 void PositiveSmiDivPowerOfTwoToInteger32(Register dst, 322 void PositiveSmiDivPowerOfTwoToInteger32(Register dst,
323 Register src, 323 Register src,
324 int power); 324 int power);
325 325
326 // Perform the logical or of two smi values and return a smi value.
327 // If either argument is not a smi, jump to on_not_smis and retain
328 // the original values of source registers. The destination register
329 // may be changed if it's not one of the source registers.
330 template <typename LabelType>
331 void SmiOrIfSmis(Register dst,
332 Register src1,
333 Register src2,
334 LabelType* on_not_smis);
335
326 336
327 // Simple comparison of smis. Both sides must be known smis to use these, 337 // Simple comparison of smis. Both sides must be known smis to use these,
328 // otherwise use Cmp. 338 // otherwise use Cmp.
329 void SmiCompare(Register smi1, Register smi2); 339 void SmiCompare(Register smi1, Register smi2);
330 void SmiCompare(Register dst, Smi* src); 340 void SmiCompare(Register dst, Smi* src);
331 void SmiCompare(Register dst, const Operand& src); 341 void SmiCompare(Register dst, const Operand& src);
332 void SmiCompare(const Operand& dst, Register src); 342 void SmiCompare(const Operand& dst, Register src);
333 void SmiCompare(const Operand& dst, Smi* src); 343 void SmiCompare(const Operand& dst, Smi* src);
334 // Compare the int32 in src register to the value of the smi stored at dst. 344 // Compare the int32 in src register to the value of the smi stored at dst.
335 void SmiCompareInteger32(const Operand& dst, Register src); 345 void SmiCompareInteger32(const Operand& dst, Register src);
(...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1783 template <typename LabelType> 1793 template <typename LabelType>
1784 void MacroAssembler::JumpUnlessBothNonNegativeSmi(Register src1, 1794 void MacroAssembler::JumpUnlessBothNonNegativeSmi(Register src1,
1785 Register src2, 1795 Register src2,
1786 LabelType* on_not_both_smi) { 1796 LabelType* on_not_both_smi) {
1787 Condition both_smi = CheckBothNonNegativeSmi(src1, src2); 1797 Condition both_smi = CheckBothNonNegativeSmi(src1, src2);
1788 j(NegateCondition(both_smi), on_not_both_smi); 1798 j(NegateCondition(both_smi), on_not_both_smi);
1789 } 1799 }
1790 1800
1791 1801
1792 template <typename LabelType> 1802 template <typename LabelType>
1803 void MacroAssembler::SmiOrIfSmis(Register dst, Register src1, Register src2,
1804 LabelType* on_not_smis) {
1805 if (dst.is(src1) || dst.is(src2)) {
1806 ASSERT(!src1.is(kScratchRegister));
1807 ASSERT(!src2.is(kScratchRegister));
1808 movq(kScratchRegister, src1);
1809 or_(kScratchRegister, src2);
1810 JumpIfNotSmi(kScratchRegister, on_not_smis);
1811 movq(dst, kScratchRegister);
1812 } else {
1813 movq(dst, src1);
1814 or_(dst, src2);
1815 JumpIfNotSmi(dst, on_not_smis);
1816 }
1817 }
1818
1819
1820 template <typename LabelType>
1793 void MacroAssembler::JumpIfNotString(Register object, 1821 void MacroAssembler::JumpIfNotString(Register object,
1794 Register object_map, 1822 Register object_map,
1795 LabelType* not_string) { 1823 LabelType* not_string) {
1796 Condition is_smi = CheckSmi(object); 1824 Condition is_smi = CheckSmi(object);
1797 j(is_smi, not_string); 1825 j(is_smi, not_string);
1798 CmpObjectType(object, FIRST_NONSTRING_TYPE, object_map); 1826 CmpObjectType(object, FIRST_NONSTRING_TYPE, object_map);
1799 j(above_equal, not_string); 1827 j(above_equal, not_string);
1800 } 1828 }
1801 1829
1802 1830
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 Jump(adaptor, RelocInfo::CODE_TARGET); 2007 Jump(adaptor, RelocInfo::CODE_TARGET);
1980 } 2008 }
1981 bind(&invoke); 2009 bind(&invoke);
1982 } 2010 }
1983 } 2011 }
1984 2012
1985 2013
1986 } } // namespace v8::internal 2014 } } // namespace v8::internal
1987 2015
1988 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ 2016 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698