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 3599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3610 | 3610 |
3611 | 3611 |
3612 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 3612 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
3613 if (instr->length()->IsRegister()) { | 3613 if (instr->length()->IsRegister()) { |
3614 Register reg = ToRegister(instr->length()); | 3614 Register reg = ToRegister(instr->length()); |
3615 if (FLAG_debug_code && | 3615 if (FLAG_debug_code && |
3616 !instr->hydrogen()->index()->representation().IsTagged()) { | 3616 !instr->hydrogen()->index()->representation().IsTagged()) { |
3617 __ AbortIfNotZeroExtended(reg); | 3617 __ AbortIfNotZeroExtended(reg); |
3618 } | 3618 } |
3619 if (instr->index()->IsConstantOperand()) { | 3619 if (instr->index()->IsConstantOperand()) { |
3620 __ cmpq(reg, | 3620 int constant_index = |
3621 Immediate(ToInteger32(LConstantOperand::cast(instr->index())))); | 3621 ToInteger32(LConstantOperand::cast(instr->index())); |
| 3622 if (instr->hydrogen()->length()->representation().IsTagged()) { |
| 3623 __ Cmp(reg, Smi::FromInt(constant_index)); |
| 3624 } else { |
| 3625 __ cmpq(reg, Immediate(constant_index)); |
| 3626 } |
3622 } else { | 3627 } else { |
3623 Register reg2 = ToRegister(instr->index()); | 3628 Register reg2 = ToRegister(instr->index()); |
3624 if (FLAG_debug_code && | 3629 if (FLAG_debug_code && |
3625 !instr->hydrogen()->index()->representation().IsTagged()) { | 3630 !instr->hydrogen()->index()->representation().IsTagged()) { |
3626 __ AbortIfNotZeroExtended(reg2); | 3631 __ AbortIfNotZeroExtended(reg2); |
3627 } | 3632 } |
3628 __ cmpq(reg, reg2); | 3633 __ cmpq(reg, reg2); |
3629 } | 3634 } |
3630 } else { | 3635 } else { |
3631 if (instr->index()->IsConstantOperand()) { | 3636 if (instr->index()->IsConstantOperand()) { |
(...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5077 FixedArray::kHeaderSize - kPointerSize)); | 5082 FixedArray::kHeaderSize - kPointerSize)); |
5078 __ bind(&done); | 5083 __ bind(&done); |
5079 } | 5084 } |
5080 | 5085 |
5081 | 5086 |
5082 #undef __ | 5087 #undef __ |
5083 | 5088 |
5084 } } // namespace v8::internal | 5089 } } // namespace v8::internal |
5085 | 5090 |
5086 #endif // V8_TARGET_ARCH_X64 | 5091 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |