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 4309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4320 | 4320 |
4321 // Name is always in r2. | 4321 // Name is always in r2. |
4322 __ mov(r2, Operand(instr->name())); | 4322 __ mov(r2, Operand(instr->name())); |
4323 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) | 4323 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) |
4324 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 4324 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
4325 : isolate()->builtins()->StoreIC_Initialize(); | 4325 : isolate()->builtins()->StoreIC_Initialize(); |
4326 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 4326 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
4327 } | 4327 } |
4328 | 4328 |
4329 | 4329 |
4330 void LCodeGen::DeoptIfTaggedButNotSmi(LEnvironment* environment, | |
4331 HValue* value, | |
4332 LOperand* operand) { | |
4333 if (value->representation().IsTagged() && !value->type().IsSmi()) { | |
4334 if (operand->IsRegister()) { | |
4335 __ tst(ToRegister(operand), Operand(kSmiTagMask)); | |
4336 } else { | |
4337 __ mov(ip, ToOperand(operand)); | |
4338 __ tst(ip, Operand(kSmiTagMask)); | |
4339 } | |
4340 DeoptimizeIf(ne, environment); | |
4341 } | |
4342 } | |
4343 | |
4344 | |
4345 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4330 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4346 DeoptIfTaggedButNotSmi(instr->environment(), | 4331 if (instr->hydrogen()->skip_check()) return; |
4347 instr->hydrogen()->length(), | 4332 |
4348 instr->length()); | |
4349 DeoptIfTaggedButNotSmi(instr->environment(), | |
4350 instr->hydrogen()->index(), | |
4351 instr->index()); | |
4352 if (instr->index()->IsConstantOperand()) { | 4333 if (instr->index()->IsConstantOperand()) { |
4353 int constant_index = | 4334 int constant_index = |
4354 ToInteger32(LConstantOperand::cast(instr->index())); | 4335 ToInteger32(LConstantOperand::cast(instr->index())); |
4355 if (instr->hydrogen()->length()->representation().IsTagged()) { | 4336 if (instr->hydrogen()->length()->representation().IsTagged()) { |
4356 __ mov(ip, Operand(Smi::FromInt(constant_index))); | 4337 __ mov(ip, Operand(Smi::FromInt(constant_index))); |
4357 } else { | 4338 } else { |
4358 __ mov(ip, Operand(constant_index)); | 4339 __ mov(ip, Operand(constant_index)); |
4359 } | 4340 } |
4360 __ cmp(ip, ToRegister(instr->length())); | 4341 __ cmp(ip, ToRegister(instr->length())); |
4361 } else { | 4342 } else { |
(...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6316 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 6297 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
6317 __ ldr(result, FieldMemOperand(scratch, | 6298 __ ldr(result, FieldMemOperand(scratch, |
6318 FixedArray::kHeaderSize - kPointerSize)); | 6299 FixedArray::kHeaderSize - kPointerSize)); |
6319 __ bind(&done); | 6300 __ bind(&done); |
6320 } | 6301 } |
6321 | 6302 |
6322 | 6303 |
6323 #undef __ | 6304 #undef __ |
6324 | 6305 |
6325 } } // namespace v8::internal | 6306 } } // namespace v8::internal |
OLD | NEW |