| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1894 __ int3(); | 1894 __ int3(); |
| 1895 } | 1895 } |
| 1896 | 1896 |
| 1897 | 1897 |
| 1898 void LCodeGen::DoBranch(LBranch* instr) { | 1898 void LCodeGen::DoBranch(LBranch* instr) { |
| 1899 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1899 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 1900 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1900 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 1901 | 1901 |
| 1902 Representation r = instr->hydrogen()->value()->representation(); | 1902 Representation r = instr->hydrogen()->value()->representation(); |
| 1903 if (r.IsInteger32()) { | 1903 if (r.IsInteger32()) { |
| 1904 ASSERT(!info()->IsStub()); |
| 1904 Register reg = ToRegister(instr->value()); | 1905 Register reg = ToRegister(instr->value()); |
| 1905 __ testl(reg, reg); | 1906 __ testl(reg, reg); |
| 1906 EmitBranch(true_block, false_block, not_zero); | 1907 EmitBranch(true_block, false_block, not_zero); |
| 1907 } else if (r.IsSmi()) { | 1908 } else if (r.IsSmi()) { |
| 1909 ASSERT(!info()->IsStub()); |
| 1908 Register reg = ToRegister(instr->value()); | 1910 Register reg = ToRegister(instr->value()); |
| 1909 __ testq(reg, reg); | 1911 __ testq(reg, reg); |
| 1910 EmitBranch(true_block, false_block, not_zero); | 1912 EmitBranch(true_block, false_block, not_zero); |
| 1911 } else if (r.IsDouble()) { | 1913 } else if (r.IsDouble()) { |
| 1914 ASSERT(!info()->IsStub()); |
| 1912 XMMRegister reg = ToDoubleRegister(instr->value()); | 1915 XMMRegister reg = ToDoubleRegister(instr->value()); |
| 1913 __ xorps(xmm0, xmm0); | 1916 __ xorps(xmm0, xmm0); |
| 1914 __ ucomisd(reg, xmm0); | 1917 __ ucomisd(reg, xmm0); |
| 1915 EmitBranch(true_block, false_block, not_equal); | 1918 EmitBranch(true_block, false_block, not_equal); |
| 1916 } else { | 1919 } else { |
| 1917 ASSERT(r.IsTagged()); | 1920 ASSERT(r.IsTagged()); |
| 1918 Register reg = ToRegister(instr->value()); | 1921 Register reg = ToRegister(instr->value()); |
| 1919 HType type = instr->hydrogen()->value()->type(); | 1922 HType type = instr->hydrogen()->value()->type(); |
| 1920 if (type.IsBoolean()) { | 1923 if (type.IsBoolean()) { |
| 1924 ASSERT(!info()->IsStub()); |
| 1921 __ CompareRoot(reg, Heap::kTrueValueRootIndex); | 1925 __ CompareRoot(reg, Heap::kTrueValueRootIndex); |
| 1922 EmitBranch(true_block, false_block, equal); | 1926 EmitBranch(true_block, false_block, equal); |
| 1923 } else if (type.IsSmi()) { | 1927 } else if (type.IsSmi()) { |
| 1928 ASSERT(!info()->IsStub()); |
| 1924 __ SmiCompare(reg, Smi::FromInt(0)); | 1929 __ SmiCompare(reg, Smi::FromInt(0)); |
| 1925 EmitBranch(true_block, false_block, not_equal); | 1930 EmitBranch(true_block, false_block, not_equal); |
| 1926 } else { | 1931 } else { |
| 1927 Label* true_label = chunk_->GetAssemblyLabel(true_block); | 1932 Label* true_label = chunk_->GetAssemblyLabel(true_block); |
| 1928 Label* false_label = chunk_->GetAssemblyLabel(false_block); | 1933 Label* false_label = chunk_->GetAssemblyLabel(false_block); |
| 1929 | 1934 |
| 1930 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types(); | 1935 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types(); |
| 1931 // Avoid deopts in the case where we've never executed this path before. | 1936 // Avoid deopts in the case where we've never executed this path before. |
| 1932 if (expected.IsEmpty()) expected = ToBooleanStub::all_types(); | 1937 if (expected.IsEmpty()) expected = ToBooleanStub::all_types(); |
| 1933 | 1938 |
| (...skipping 3749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5683 FixedArray::kHeaderSize - kPointerSize)); | 5688 FixedArray::kHeaderSize - kPointerSize)); |
| 5684 __ bind(&done); | 5689 __ bind(&done); |
| 5685 } | 5690 } |
| 5686 | 5691 |
| 5687 | 5692 |
| 5688 #undef __ | 5693 #undef __ |
| 5689 | 5694 |
| 5690 } } // namespace v8::internal | 5695 } } // namespace v8::internal |
| 5691 | 5696 |
| 5692 #endif // V8_TARGET_ARCH_X64 | 5697 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |