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 4242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4253 | 4253 |
4254 // Name is always in r2. | 4254 // Name is always in r2. |
4255 __ mov(r2, Operand(instr->name())); | 4255 __ mov(r2, Operand(instr->name())); |
4256 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) | 4256 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) |
4257 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 4257 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
4258 : isolate()->builtins()->StoreIC_Initialize(); | 4258 : isolate()->builtins()->StoreIC_Initialize(); |
4259 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 4259 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
4260 } | 4260 } |
4261 | 4261 |
4262 | 4262 |
| 4263 void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) { |
| 4264 if (FLAG_debug_code && check->hydrogen()->skip_check()) { |
| 4265 Label done; |
| 4266 __ b(NegateCondition(cc), &done); |
| 4267 __ stop("eliminated bounds check failed"); |
| 4268 __ bind(&done); |
| 4269 } else { |
| 4270 DeoptimizeIf(cc, check->environment()); |
| 4271 } |
| 4272 } |
| 4273 |
| 4274 |
4263 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4275 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4264 if (instr->hydrogen()->skip_check()) return; | 4276 if (instr->hydrogen()->skip_check()) return; |
4265 | 4277 |
4266 if (instr->index()->IsConstantOperand()) { | 4278 if (instr->index()->IsConstantOperand()) { |
4267 int constant_index = | 4279 int constant_index = |
4268 ToInteger32(LConstantOperand::cast(instr->index())); | 4280 ToInteger32(LConstantOperand::cast(instr->index())); |
4269 if (instr->hydrogen()->length()->representation().IsSmi()) { | 4281 if (instr->hydrogen()->length()->representation().IsSmi()) { |
4270 __ mov(ip, Operand(Smi::FromInt(constant_index))); | 4282 __ mov(ip, Operand(Smi::FromInt(constant_index))); |
4271 } else { | 4283 } else { |
4272 __ mov(ip, Operand(constant_index)); | 4284 __ mov(ip, Operand(constant_index)); |
4273 } | 4285 } |
4274 __ cmp(ip, ToRegister(instr->length())); | 4286 __ cmp(ip, ToRegister(instr->length())); |
4275 } else { | 4287 } else { |
4276 __ cmp(ToRegister(instr->index()), ToRegister(instr->length())); | 4288 __ cmp(ToRegister(instr->index()), ToRegister(instr->length())); |
4277 } | 4289 } |
4278 DeoptimizeIf(hs, instr->environment()); | 4290 Condition condition = instr->hydrogen()->allow_equality() ? hi : hs; |
| 4291 ApplyCheckIf(condition, instr); |
4279 } | 4292 } |
4280 | 4293 |
4281 | 4294 |
4282 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { | 4295 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { |
4283 Register external_pointer = ToRegister(instr->elements()); | 4296 Register external_pointer = ToRegister(instr->elements()); |
4284 Register key = no_reg; | 4297 Register key = no_reg; |
4285 ElementsKind elements_kind = instr->elements_kind(); | 4298 ElementsKind elements_kind = instr->elements_kind(); |
4286 bool key_is_constant = instr->key()->IsConstantOperand(); | 4299 bool key_is_constant = instr->key()->IsConstantOperand(); |
4287 int constant_key = 0; | 4300 int constant_key = 0; |
4288 if (key_is_constant) { | 4301 if (key_is_constant) { |
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5824 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5837 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5825 __ ldr(result, FieldMemOperand(scratch, | 5838 __ ldr(result, FieldMemOperand(scratch, |
5826 FixedArray::kHeaderSize - kPointerSize)); | 5839 FixedArray::kHeaderSize - kPointerSize)); |
5827 __ bind(&done); | 5840 __ bind(&done); |
5828 } | 5841 } |
5829 | 5842 |
5830 | 5843 |
5831 #undef __ | 5844 #undef __ |
5832 | 5845 |
5833 } } // namespace v8::internal | 5846 } } // namespace v8::internal |
OLD | NEW |