OLD | NEW |
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 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2040 // jump to false block label. | 2040 // jump to false block label. |
2041 __ BranchF(NULL, chunk_->GetAssemblyLabel(false_block), eq, | 2041 __ BranchF(NULL, chunk_->GetAssemblyLabel(false_block), eq, |
2042 left_reg, right_reg); | 2042 left_reg, right_reg); |
2043 | 2043 |
2044 EmitBranchF(true_block, false_block, cond, left_reg, right_reg); | 2044 EmitBranchF(true_block, false_block, cond, left_reg, right_reg); |
2045 } else { | 2045 } else { |
2046 Register cmp_left; | 2046 Register cmp_left; |
2047 Operand cmp_right = Operand(0); | 2047 Operand cmp_right = Operand(0); |
2048 | 2048 |
2049 if (right->IsConstantOperand()) { | 2049 if (right->IsConstantOperand()) { |
2050 cmp_left = ToRegister(left); | 2050 int32_t value = ToInteger32(LConstantOperand::cast(right)); |
2051 cmp_right = Operand(ToInteger32(LConstantOperand::cast(right))); | 2051 if (instr->hydrogen_value()->representation().IsSmi()) { |
| 2052 cmp_left = ToRegister(left); |
| 2053 cmp_right = Operand(Smi::FromInt(value)); |
| 2054 } else { |
| 2055 cmp_left = ToRegister(left); |
| 2056 cmp_right = Operand(value); |
| 2057 } |
2052 } else if (left->IsConstantOperand()) { | 2058 } else if (left->IsConstantOperand()) { |
2053 cmp_left = ToRegister(right); | 2059 int32_t value = ToInteger32(LConstantOperand::cast(left)); |
2054 cmp_right = Operand(ToInteger32(LConstantOperand::cast(left))); | 2060 if (instr->hydrogen_value()->representation().IsSmi()) { |
| 2061 cmp_left = ToRegister(right); |
| 2062 cmp_right = Operand(Smi::FromInt(value)); |
| 2063 } else { |
| 2064 cmp_left = ToRegister(right); |
| 2065 cmp_right = Operand(value); |
| 2066 } |
2055 // We transposed the operands. Reverse the condition. | 2067 // We transposed the operands. Reverse the condition. |
2056 cond = ReverseCondition(cond); | 2068 cond = ReverseCondition(cond); |
2057 } else { | 2069 } else { |
2058 cmp_left = ToRegister(left); | 2070 cmp_left = ToRegister(left); |
2059 cmp_right = Operand(ToRegister(right)); | 2071 cmp_right = Operand(ToRegister(right)); |
2060 } | 2072 } |
2061 | 2073 |
2062 EmitBranch(true_block, false_block, cond, cmp_left, cmp_right); | 2074 EmitBranch(true_block, false_block, cond, cmp_left, cmp_right); |
2063 } | 2075 } |
2064 } | 2076 } |
(...skipping 3673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5738 __ Subu(scratch, result, scratch); | 5750 __ Subu(scratch, result, scratch); |
5739 __ lw(result, FieldMemOperand(scratch, | 5751 __ lw(result, FieldMemOperand(scratch, |
5740 FixedArray::kHeaderSize - kPointerSize)); | 5752 FixedArray::kHeaderSize - kPointerSize)); |
5741 __ bind(&done); | 5753 __ bind(&done); |
5742 } | 5754 } |
5743 | 5755 |
5744 | 5756 |
5745 #undef __ | 5757 #undef __ |
5746 | 5758 |
5747 } } // namespace v8::internal | 5759 } } // namespace v8::internal |
OLD | NEW |