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 2056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2067 } else { | 2067 } else { |
2068 if (instr->is_double()) { | 2068 if (instr->is_double()) { |
2069 // Don't base result on EFLAGS when a NaN is involved. Instead | 2069 // Don't base result on EFLAGS when a NaN is involved. Instead |
2070 // jump to the false block. | 2070 // jump to the false block. |
2071 __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right)); | 2071 __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right)); |
2072 __ j(parity_even, chunk_->GetAssemblyLabel(false_block)); | 2072 __ j(parity_even, chunk_->GetAssemblyLabel(false_block)); |
2073 } else { | 2073 } else { |
2074 int32_t value; | 2074 int32_t value; |
2075 if (right->IsConstantOperand()) { | 2075 if (right->IsConstantOperand()) { |
2076 value = ToInteger32(LConstantOperand::cast(right)); | 2076 value = ToInteger32(LConstantOperand::cast(right)); |
2077 __ cmpl(ToRegister(left), Immediate(value)); | 2077 if (instr->hydrogen_value()->representation().IsSmi()) { |
| 2078 __ Cmp(ToRegister(left), Smi::FromInt(value)); |
| 2079 } else { |
| 2080 __ cmpl(ToRegister(left), Immediate(value)); |
| 2081 } |
2078 } else if (left->IsConstantOperand()) { | 2082 } else if (left->IsConstantOperand()) { |
2079 value = ToInteger32(LConstantOperand::cast(left)); | 2083 value = ToInteger32(LConstantOperand::cast(left)); |
2080 if (right->IsRegister()) { | 2084 if (instr->hydrogen_value()->representation().IsSmi()) { |
| 2085 if (right->IsRegister()) { |
| 2086 __ Cmp(ToRegister(right), Smi::FromInt(value)); |
| 2087 } else { |
| 2088 __ Cmp(ToOperand(right), Smi::FromInt(value)); |
| 2089 } |
| 2090 } else if (right->IsRegister()) { |
2081 __ cmpl(ToRegister(right), Immediate(value)); | 2091 __ cmpl(ToRegister(right), Immediate(value)); |
2082 } else { | 2092 } else { |
2083 __ cmpl(ToOperand(right), Immediate(value)); | 2093 __ cmpl(ToOperand(right), Immediate(value)); |
2084 } | 2094 } |
2085 // We transposed the operands. Reverse the condition. | 2095 // We transposed the operands. Reverse the condition. |
2086 cc = ReverseCondition(cc); | 2096 cc = ReverseCondition(cc); |
| 2097 } else if (instr->hydrogen_value()->representation().IsSmi()) { |
| 2098 if (right->IsRegister()) { |
| 2099 __ cmpq(ToRegister(left), ToRegister(right)); |
| 2100 } else { |
| 2101 __ cmpq(ToRegister(left), ToOperand(right)); |
| 2102 } |
2087 } else { | 2103 } else { |
2088 if (right->IsRegister()) { | 2104 if (right->IsRegister()) { |
2089 __ cmpl(ToRegister(left), ToRegister(right)); | 2105 __ cmpl(ToRegister(left), ToRegister(right)); |
2090 } else { | 2106 } else { |
2091 __ cmpl(ToRegister(left), ToOperand(right)); | 2107 __ cmpl(ToRegister(left), ToOperand(right)); |
2092 } | 2108 } |
2093 } | 2109 } |
2094 } | 2110 } |
2095 EmitBranch(true_block, false_block, cc); | 2111 EmitBranch(true_block, false_block, cc); |
2096 } | 2112 } |
(...skipping 3565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5662 FixedArray::kHeaderSize - kPointerSize)); | 5678 FixedArray::kHeaderSize - kPointerSize)); |
5663 __ bind(&done); | 5679 __ bind(&done); |
5664 } | 5680 } |
5665 | 5681 |
5666 | 5682 |
5667 #undef __ | 5683 #undef __ |
5668 | 5684 |
5669 } } // namespace v8::internal | 5685 } } // namespace v8::internal |
5670 | 5686 |
5671 #endif // V8_TARGET_ARCH_X64 | 5687 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |