OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 2306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2317 } | 2317 } |
2318 } else if (left->IsConstantOperand()) { | 2318 } else if (left->IsConstantOperand()) { |
2319 int32_t value = ToInteger32(LConstantOperand::cast(left)); | 2319 int32_t value = ToInteger32(LConstantOperand::cast(left)); |
2320 if (instr->hydrogen_value()->representation().IsSmi()) { | 2320 if (instr->hydrogen_value()->representation().IsSmi()) { |
2321 cmp_left = ToRegister(right); | 2321 cmp_left = ToRegister(right); |
2322 cmp_right = Operand(Smi::FromInt(value)); | 2322 cmp_right = Operand(Smi::FromInt(value)); |
2323 } else { | 2323 } else { |
2324 cmp_left = ToRegister(right); | 2324 cmp_left = ToRegister(right); |
2325 cmp_right = Operand(value); | 2325 cmp_right = Operand(value); |
2326 } | 2326 } |
2327 // We transposed the operands. Reverse the condition. | 2327 // We commuted the operands, so commute the condition. |
2328 cond = ReverseCondition(cond); | 2328 cond = CommuteCondition(cond); |
2329 } else { | 2329 } else { |
2330 cmp_left = ToRegister(left); | 2330 cmp_left = ToRegister(left); |
2331 cmp_right = Operand(ToRegister(right)); | 2331 cmp_right = Operand(ToRegister(right)); |
2332 } | 2332 } |
2333 | 2333 |
2334 EmitBranch(instr, cond, cmp_left, cmp_right); | 2334 EmitBranch(instr, cond, cmp_left, cmp_right); |
2335 } | 2335 } |
2336 } | 2336 } |
2337 } | 2337 } |
2338 | 2338 |
(...skipping 1796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4135 } | 4135 } |
4136 | 4136 |
4137 | 4137 |
4138 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4138 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4139 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 4139 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; |
4140 Operand operand(0); | 4140 Operand operand(0); |
4141 Register reg; | 4141 Register reg; |
4142 if (instr->index()->IsConstantOperand()) { | 4142 if (instr->index()->IsConstantOperand()) { |
4143 operand = ToOperand(instr->index()); | 4143 operand = ToOperand(instr->index()); |
4144 reg = ToRegister(instr->length()); | 4144 reg = ToRegister(instr->length()); |
4145 cc = ReverseCondition(cc); | 4145 cc = CommuteCondition(cc); |
4146 } else { | 4146 } else { |
4147 reg = ToRegister(instr->index()); | 4147 reg = ToRegister(instr->index()); |
4148 operand = ToOperand(instr->length()); | 4148 operand = ToOperand(instr->length()); |
4149 } | 4149 } |
4150 if (FLAG_debug_code && instr->hydrogen()->skip_check()) { | 4150 if (FLAG_debug_code && instr->hydrogen()->skip_check()) { |
4151 Label done; | 4151 Label done; |
4152 __ Branch(&done, NegateCondition(cc), reg, operand); | 4152 __ Branch(&done, NegateCondition(cc), reg, operand); |
4153 __ stop("eliminated bounds check failed"); | 4153 __ stop("eliminated bounds check failed"); |
4154 __ bind(&done); | 4154 __ bind(&done); |
4155 } else { | 4155 } else { |
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5870 __ lw(result, FieldMemOperand(scratch, | 5870 __ lw(result, FieldMemOperand(scratch, |
5871 FixedArray::kHeaderSize - kPointerSize)); | 5871 FixedArray::kHeaderSize - kPointerSize)); |
5872 __ bind(deferred->exit()); | 5872 __ bind(deferred->exit()); |
5873 __ bind(&done); | 5873 __ bind(&done); |
5874 } | 5874 } |
5875 | 5875 |
5876 | 5876 |
5877 #undef __ | 5877 #undef __ |
5878 | 5878 |
5879 } } // namespace v8::internal | 5879 } } // namespace v8::internal |
OLD | NEW |