| 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 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2158 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 2158 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
| 2159 : isolate()->builtins()->StoreIC_Initialize(); | 2159 : isolate()->builtins()->StoreIC_Initialize(); |
| 2160 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); | 2160 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); |
| 2161 } | 2161 } |
| 2162 | 2162 |
| 2163 | 2163 |
| 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 if (instr->RequiresHoleCheck()) { |
| 2169 Label is_not_hole; |
| 2170 __ cmp(result, factory()->the_hole_value()); |
| 2171 __ j(not_equal, &is_not_hole, Label::kNear); |
| 2172 |
| 2173 __ mov(result, factory()->undefined_value()); |
| 2174 |
| 2175 __ bind(&is_not_hole); |
| 2176 } |
| 2168 } | 2177 } |
| 2169 | 2178 |
| 2170 | 2179 |
| 2171 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2180 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| 2172 Register context = ToRegister(instr->context()); | 2181 Register context = ToRegister(instr->context()); |
| 2173 Register value = ToRegister(instr->value()); | 2182 Register value = ToRegister(instr->value()); |
| 2183 |
| 2184 Label skip_assignment; |
| 2185 |
| 2186 if (instr->RequiresHoleCheck()) { |
| 2187 __ cmp(ContextOperand(context, instr->slot_index()), |
| 2188 factory()->the_hole_value()); |
| 2189 __ j(not_equal, &skip_assignment, Label::kNear); |
| 2190 } |
| 2191 |
| 2174 __ mov(ContextOperand(context, instr->slot_index()), value); | 2192 __ mov(ContextOperand(context, instr->slot_index()), value); |
| 2175 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2193 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 2176 HType type = instr->hydrogen()->value()->type(); | 2194 HType type = instr->hydrogen()->value()->type(); |
| 2177 SmiCheck check_needed = | 2195 SmiCheck check_needed = |
| 2178 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2196 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
| 2179 Register temp = ToRegister(instr->TempAt(0)); | 2197 Register temp = ToRegister(instr->TempAt(0)); |
| 2180 int offset = Context::SlotOffset(instr->slot_index()); | 2198 int offset = Context::SlotOffset(instr->slot_index()); |
| 2181 __ RecordWriteContextSlot(context, | 2199 __ RecordWriteContextSlot(context, |
| 2182 offset, | 2200 offset, |
| 2183 value, | 2201 value, |
| 2184 temp, | 2202 temp, |
| 2185 kSaveFPRegs, | 2203 kSaveFPRegs, |
| 2186 EMIT_REMEMBERED_SET, | 2204 EMIT_REMEMBERED_SET, |
| 2187 check_needed); | 2205 check_needed); |
| 2188 } | 2206 } |
| 2207 |
| 2208 __ bind(&skip_assignment); |
| 2189 } | 2209 } |
| 2190 | 2210 |
| 2191 | 2211 |
| 2192 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2212 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
| 2193 Register object = ToRegister(instr->object()); | 2213 Register object = ToRegister(instr->object()); |
| 2194 Register result = ToRegister(instr->result()); | 2214 Register result = ToRegister(instr->result()); |
| 2195 if (instr->hydrogen()->is_in_object()) { | 2215 if (instr->hydrogen()->is_in_object()) { |
| 2196 __ mov(result, FieldOperand(object, instr->hydrogen()->offset())); | 2216 __ mov(result, FieldOperand(object, instr->hydrogen()->offset())); |
| 2197 } else { | 2217 } else { |
| 2198 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 2218 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); |
| (...skipping 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4608 this, pointers, Safepoint::kLazyDeopt); | 4628 this, pointers, Safepoint::kLazyDeopt); |
| 4609 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4629 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
| 4610 } | 4630 } |
| 4611 | 4631 |
| 4612 | 4632 |
| 4613 #undef __ | 4633 #undef __ |
| 4614 | 4634 |
| 4615 } } // namespace v8::internal | 4635 } } // namespace v8::internal |
| 4616 | 4636 |
| 4617 #endif // V8_TARGET_ARCH_IA32 | 4637 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |