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 3346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3357 if (key->IsConstantOperand()) { | 3357 if (key->IsConstantOperand()) { |
3358 int constant_value = ToInteger32(LConstantOperand::cast(key)); | 3358 int constant_value = ToInteger32(LConstantOperand::cast(key)); |
3359 if (constant_value & 0xF0000000) { | 3359 if (constant_value & 0xF0000000) { |
3360 Abort("array index constant value too big"); | 3360 Abort("array index constant value too big"); |
3361 } | 3361 } |
3362 return Operand(elements_pointer_reg, | 3362 return Operand(elements_pointer_reg, |
3363 ((constant_value + additional_index) << shift_size) | 3363 ((constant_value + additional_index) << shift_size) |
3364 + offset); | 3364 + offset); |
3365 } else { | 3365 } else { |
3366 // Take the tag bit into account while computing the shift size. | 3366 // Take the tag bit into account while computing the shift size. |
3367 if (key_representation.IsTagged() && (shift_size >= 1)) { | 3367 if (key_representation.IsSmi() && (shift_size >= 1)) { |
3368 shift_size -= kSmiTagSize; | 3368 shift_size -= kSmiTagSize; |
3369 } | 3369 } |
3370 ScaleFactor scale_factor = static_cast<ScaleFactor>(shift_size); | 3370 ScaleFactor scale_factor = static_cast<ScaleFactor>(shift_size); |
3371 return Operand(elements_pointer_reg, | 3371 return Operand(elements_pointer_reg, |
3372 ToRegister(key), | 3372 ToRegister(key), |
3373 scale_factor, | 3373 scale_factor, |
3374 offset + (additional_index << element_shift_size)); | 3374 offset + (additional_index << element_shift_size)); |
3375 } | 3375 } |
3376 } | 3376 } |
3377 | 3377 |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4352 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4352 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4353 } | 4353 } |
4354 | 4354 |
4355 | 4355 |
4356 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4356 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4357 if (instr->hydrogen()->skip_check()) return; | 4357 if (instr->hydrogen()->skip_check()) return; |
4358 | 4358 |
4359 if (instr->index()->IsConstantOperand()) { | 4359 if (instr->index()->IsConstantOperand()) { |
4360 int constant_index = | 4360 int constant_index = |
4361 ToInteger32(LConstantOperand::cast(instr->index())); | 4361 ToInteger32(LConstantOperand::cast(instr->index())); |
4362 if (instr->hydrogen()->length()->representation().IsTagged()) { | 4362 if (instr->hydrogen()->length()->representation().IsSmi()) { |
4363 __ cmp(ToOperand(instr->length()), | 4363 __ cmp(ToOperand(instr->length()), |
4364 Immediate(Smi::FromInt(constant_index))); | 4364 Immediate(Smi::FromInt(constant_index))); |
4365 } else { | 4365 } else { |
4366 __ cmp(ToOperand(instr->length()), Immediate(constant_index)); | 4366 __ cmp(ToOperand(instr->length()), Immediate(constant_index)); |
4367 } | 4367 } |
4368 DeoptimizeIf(below_equal, instr->environment()); | 4368 DeoptimizeIf(below_equal, instr->environment()); |
4369 } else { | 4369 } else { |
4370 __ cmp(ToRegister(instr->index()), ToOperand(instr->length())); | 4370 __ cmp(ToRegister(instr->index()), ToOperand(instr->length())); |
4371 DeoptimizeIf(above_equal, instr->environment()); | 4371 DeoptimizeIf(above_equal, instr->environment()); |
4372 } | 4372 } |
(...skipping 2221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6594 FixedArray::kHeaderSize - kPointerSize)); | 6594 FixedArray::kHeaderSize - kPointerSize)); |
6595 __ bind(&done); | 6595 __ bind(&done); |
6596 } | 6596 } |
6597 | 6597 |
6598 | 6598 |
6599 #undef __ | 6599 #undef __ |
6600 | 6600 |
6601 } } // namespace v8::internal | 6601 } } // namespace v8::internal |
6602 | 6602 |
6603 #endif // V8_TARGET_ARCH_IA32 | 6603 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |