OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3182 } | 3182 } |
3183 } | 3183 } |
3184 } | 3184 } |
3185 | 3185 |
3186 | 3186 |
3187 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) { | 3187 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) { |
3188 Register value = ToRegister(instr->value()); | 3188 Register value = ToRegister(instr->value()); |
3189 Register elements = ToRegister(instr->object()); | 3189 Register elements = ToRegister(instr->object()); |
3190 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg; | 3190 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg; |
3191 | 3191 |
| 3192 // This instruction cannot handle the FAST_SMI_ONLY_ELEMENTS -> FAST_ELEMENTS |
| 3193 // conversion, so it deopts in that case. |
| 3194 if (instr->hydrogen()->ValueNeedsSmiCheck()) { |
| 3195 __ test(value, Immediate(kSmiTagMask)); |
| 3196 DeoptimizeIf(not_zero, instr->environment()); |
| 3197 } |
| 3198 |
3192 // Do the store. | 3199 // Do the store. |
3193 if (instr->key()->IsConstantOperand()) { | 3200 if (instr->key()->IsConstantOperand()) { |
3194 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 3201 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
3195 LConstantOperand* const_operand = LConstantOperand::cast(instr->key()); | 3202 LConstantOperand* const_operand = LConstantOperand::cast(instr->key()); |
3196 int offset = | 3203 int offset = |
3197 ToInteger32(const_operand) * kPointerSize + FixedArray::kHeaderSize; | 3204 ToInteger32(const_operand) * kPointerSize + FixedArray::kHeaderSize; |
3198 __ mov(FieldOperand(elements, offset), value); | 3205 __ mov(FieldOperand(elements, offset), value); |
3199 } else { | 3206 } else { |
3200 __ mov(FieldOperand(elements, | 3207 __ mov(FieldOperand(elements, |
3201 key, | 3208 key, |
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4423 env->deoptimization_index()); | 4430 env->deoptimization_index()); |
4424 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4431 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
4425 } | 4432 } |
4426 | 4433 |
4427 | 4434 |
4428 #undef __ | 4435 #undef __ |
4429 | 4436 |
4430 } } // namespace v8::internal | 4437 } } // namespace v8::internal |
4431 | 4438 |
4432 #endif // V8_TARGET_ARCH_IA32 | 4439 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |