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 2153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2164 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2164 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2165 Register context = ToRegister(instr->context()); | 2165 Register context = ToRegister(instr->context()); |
2166 Register result = ToRegister(instr->result()); | 2166 Register result = ToRegister(instr->result()); |
2167 __ mov(result, ContextOperand(context, instr->slot_index())); | 2167 __ mov(result, ContextOperand(context, instr->slot_index())); |
2168 } | 2168 } |
2169 | 2169 |
2170 | 2170 |
2171 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2171 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
2172 Register context = ToRegister(instr->context()); | 2172 Register context = ToRegister(instr->context()); |
2173 Register value = ToRegister(instr->value()); | 2173 Register value = ToRegister(instr->value()); |
| 2174 |
| 2175 Label skip_assignment; |
| 2176 |
| 2177 if (instr->needs_is_hole_check()) { |
| 2178 __ cmp(ContextOperand(context, instr->slot_index()), |
| 2179 factory()->the_hole_value()); |
| 2180 __ j(not_equal, &skip_assignment, Label::kNear); |
| 2181 } |
| 2182 |
2174 __ mov(ContextOperand(context, instr->slot_index()), value); | 2183 __ mov(ContextOperand(context, instr->slot_index()), value); |
2175 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2184 if (instr->hydrogen()->NeedsWriteBarrier()) { |
2176 HType type = instr->hydrogen()->value()->type(); | 2185 HType type = instr->hydrogen()->value()->type(); |
2177 SmiCheck check_needed = | 2186 SmiCheck check_needed = |
2178 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2187 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
2179 Register temp = ToRegister(instr->TempAt(0)); | 2188 Register temp = ToRegister(instr->TempAt(0)); |
2180 int offset = Context::SlotOffset(instr->slot_index()); | 2189 int offset = Context::SlotOffset(instr->slot_index()); |
2181 __ RecordWriteContextSlot(context, | 2190 __ RecordWriteContextSlot(context, |
2182 offset, | 2191 offset, |
2183 value, | 2192 value, |
2184 temp, | 2193 temp, |
2185 kSaveFPRegs, | 2194 kSaveFPRegs, |
2186 EMIT_REMEMBERED_SET, | 2195 EMIT_REMEMBERED_SET, |
2187 check_needed); | 2196 check_needed); |
2188 } | 2197 } |
| 2198 |
| 2199 __ bind(&skip_assignment); |
2189 } | 2200 } |
2190 | 2201 |
2191 | 2202 |
2192 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2203 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
2193 Register object = ToRegister(instr->object()); | 2204 Register object = ToRegister(instr->object()); |
2194 Register result = ToRegister(instr->result()); | 2205 Register result = ToRegister(instr->result()); |
2195 if (instr->hydrogen()->is_in_object()) { | 2206 if (instr->hydrogen()->is_in_object()) { |
2196 __ mov(result, FieldOperand(object, instr->hydrogen()->offset())); | 2207 __ mov(result, FieldOperand(object, instr->hydrogen()->offset())); |
2197 } else { | 2208 } else { |
2198 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 2209 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); |
(...skipping 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4608 this, pointers, Safepoint::kLazyDeopt); | 4619 this, pointers, Safepoint::kLazyDeopt); |
4609 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4620 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
4610 } | 4621 } |
4611 | 4622 |
4612 | 4623 |
4613 #undef __ | 4624 #undef __ |
4614 | 4625 |
4615 } } // namespace v8::internal | 4626 } } // namespace v8::internal |
4616 | 4627 |
4617 #endif // V8_TARGET_ARCH_IA32 | 4628 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |