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 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2310 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 2310 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
2311 : isolate()->builtins()->StoreIC_Initialize(); | 2311 : isolate()->builtins()->StoreIC_Initialize(); |
2312 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); | 2312 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); |
2313 } | 2313 } |
2314 | 2314 |
2315 | 2315 |
2316 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2316 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2317 Register context = ToRegister(instr->context()); | 2317 Register context = ToRegister(instr->context()); |
2318 Register result = ToRegister(instr->result()); | 2318 Register result = ToRegister(instr->result()); |
2319 __ ldr(result, ContextOperand(context, instr->slot_index())); | 2319 __ ldr(result, ContextOperand(context, instr->slot_index())); |
| 2320 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2321 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| 2322 __ cmp(result, ip); |
| 2323 DeoptimizeIf(eq, instr->environment()); |
| 2324 } |
2320 } | 2325 } |
2321 | 2326 |
2322 | 2327 |
2323 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2328 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
2324 Register context = ToRegister(instr->context()); | 2329 Register context = ToRegister(instr->context()); |
2325 Register value = ToRegister(instr->value()); | 2330 Register value = ToRegister(instr->value()); |
2326 MemOperand target = ContextOperand(context, instr->slot_index()); | 2331 MemOperand target = ContextOperand(context, instr->slot_index()); |
| 2332 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2333 Register scratch = scratch0(); |
| 2334 __ ldr(scratch, target); |
| 2335 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| 2336 __ cmp(scratch, ip); |
| 2337 DeoptimizeIf(eq, instr->environment()); |
| 2338 } |
2327 __ str(value, target); | 2339 __ str(value, target); |
2328 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2340 if (instr->hydrogen()->NeedsWriteBarrier()) { |
2329 HType type = instr->hydrogen()->value()->type(); | 2341 HType type = instr->hydrogen()->value()->type(); |
2330 SmiCheck check_needed = | 2342 SmiCheck check_needed = |
2331 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2343 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
2332 __ RecordWriteContextSlot(context, | 2344 __ RecordWriteContextSlot(context, |
2333 target.offset(), | 2345 target.offset(), |
2334 value, | 2346 value, |
2335 scratch0(), | 2347 scratch0(), |
2336 kLRHasBeenSaved, | 2348 kLRHasBeenSaved, |
(...skipping 2406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4743 ASSERT(osr_pc_offset_ == -1); | 4755 ASSERT(osr_pc_offset_ == -1); |
4744 osr_pc_offset_ = masm()->pc_offset(); | 4756 osr_pc_offset_ = masm()->pc_offset(); |
4745 } | 4757 } |
4746 | 4758 |
4747 | 4759 |
4748 | 4760 |
4749 | 4761 |
4750 #undef __ | 4762 #undef __ |
4751 | 4763 |
4752 } } // namespace v8::internal | 4764 } } // namespace v8::internal |
OLD | NEW |