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 2285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2296 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 2296 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
2297 : isolate()->builtins()->StoreIC_Initialize(); | 2297 : isolate()->builtins()->StoreIC_Initialize(); |
2298 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); | 2298 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); |
2299 } | 2299 } |
2300 | 2300 |
2301 | 2301 |
2302 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2302 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2303 Register context = ToRegister(instr->context()); | 2303 Register context = ToRegister(instr->context()); |
2304 Register result = ToRegister(instr->result()); | 2304 Register result = ToRegister(instr->result()); |
2305 __ ldr(result, ContextOperand(context, instr->slot_index())); | 2305 __ ldr(result, ContextOperand(context, instr->slot_index())); |
| 2306 if (instr->RequiresHoleCheck()) { |
| 2307 Label is_not_hole; |
| 2308 __ cmp(result, Operand(factory()->the_hole_value())); |
| 2309 __ b(ne, &is_not_hole); |
| 2310 |
| 2311 __ mov(result, Operand(factory()->undefined_value())); |
| 2312 |
| 2313 __ bind(&is_not_hole); |
| 2314 } |
2306 } | 2315 } |
2307 | 2316 |
2308 | 2317 |
2309 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2318 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
2310 Register context = ToRegister(instr->context()); | 2319 Register context = ToRegister(instr->context()); |
2311 Register value = ToRegister(instr->value()); | 2320 Register value = ToRegister(instr->value()); |
| 2321 Register scratch = scratch0(); |
2312 MemOperand target = ContextOperand(context, instr->slot_index()); | 2322 MemOperand target = ContextOperand(context, instr->slot_index()); |
| 2323 |
| 2324 Label skip_assignment; |
| 2325 |
| 2326 if (instr->RequiresHoleCheck()) { |
| 2327 __ ldr(scratch, target); |
| 2328 __ cmp(scratch, Operand(factory()->the_hole_value())); |
| 2329 __ b(ne, &skip_assignment); |
| 2330 } |
| 2331 |
2313 __ str(value, target); | 2332 __ str(value, target); |
2314 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2333 if (instr->hydrogen()->NeedsWriteBarrier()) { |
2315 HType type = instr->hydrogen()->value()->type(); | 2334 HType type = instr->hydrogen()->value()->type(); |
2316 SmiCheck check_needed = | 2335 SmiCheck check_needed = |
2317 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2336 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
2318 __ RecordWriteContextSlot(context, | 2337 __ RecordWriteContextSlot(context, |
2319 target.offset(), | 2338 target.offset(), |
2320 value, | 2339 value, |
2321 scratch0(), | 2340 scratch, |
2322 kLRHasBeenSaved, | 2341 kLRHasBeenSaved, |
2323 kSaveFPRegs, | 2342 kSaveFPRegs, |
2324 EMIT_REMEMBERED_SET, | 2343 EMIT_REMEMBERED_SET, |
2325 check_needed); | 2344 check_needed); |
2326 } | 2345 } |
| 2346 |
| 2347 __ bind(&skip_assignment); |
2327 } | 2348 } |
2328 | 2349 |
2329 | 2350 |
2330 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2351 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
2331 Register object = ToRegister(instr->InputAt(0)); | 2352 Register object = ToRegister(instr->InputAt(0)); |
2332 Register result = ToRegister(instr->result()); | 2353 Register result = ToRegister(instr->result()); |
2333 if (instr->hydrogen()->is_in_object()) { | 2354 if (instr->hydrogen()->is_in_object()) { |
2334 __ ldr(result, FieldMemOperand(object, instr->hydrogen()->offset())); | 2355 __ ldr(result, FieldMemOperand(object, instr->hydrogen()->offset())); |
2335 } else { | 2356 } else { |
2336 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 2357 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
(...skipping 2365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4702 ASSERT(osr_pc_offset_ == -1); | 4723 ASSERT(osr_pc_offset_ == -1); |
4703 osr_pc_offset_ = masm()->pc_offset(); | 4724 osr_pc_offset_ = masm()->pc_offset(); |
4704 } | 4725 } |
4705 | 4726 |
4706 | 4727 |
4707 | 4728 |
4708 | 4729 |
4709 #undef __ | 4730 #undef __ |
4710 | 4731 |
4711 } } // namespace v8::internal | 4732 } } // namespace v8::internal |
OLD | NEW |