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 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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->hydrogen()->RequiresHoleCheck()) { | 2306 if (instr->hydrogen()->RequiresHoleCheck()) { |
2307 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 2307 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
2308 __ cmp(result, ip); | 2308 __ cmp(result, ip); |
2309 DeoptimizeIf(eq, instr->environment()); | 2309 if (instr->hydrogen()->DeoptimizesOnHole()) { |
| 2310 DeoptimizeIf(eq, instr->environment()); |
| 2311 } else { |
| 2312 __ mov(result, Operand(factory()->undefined_value()), LeaveCC, eq); |
| 2313 } |
2310 } | 2314 } |
2311 } | 2315 } |
2312 | 2316 |
2313 | 2317 |
2314 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2318 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
2315 Register context = ToRegister(instr->context()); | 2319 Register context = ToRegister(instr->context()); |
2316 Register value = ToRegister(instr->value()); | 2320 Register value = ToRegister(instr->value()); |
| 2321 Register scratch = scratch0(); |
2317 MemOperand target = ContextOperand(context, instr->slot_index()); | 2322 MemOperand target = ContextOperand(context, instr->slot_index()); |
| 2323 |
| 2324 Label skip_assignment; |
| 2325 |
2318 if (instr->hydrogen()->RequiresHoleCheck()) { | 2326 if (instr->hydrogen()->RequiresHoleCheck()) { |
2319 Register scratch = scratch0(); | |
2320 __ ldr(scratch, target); | 2327 __ ldr(scratch, target); |
2321 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 2328 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
2322 __ cmp(scratch, ip); | 2329 __ cmp(scratch, ip); |
2323 DeoptimizeIf(eq, instr->environment()); | 2330 if (instr->hydrogen()->DeoptimizesOnHole()) { |
| 2331 DeoptimizeIf(eq, instr->environment()); |
| 2332 } else { |
| 2333 __ b(ne, &skip_assignment); |
| 2334 } |
2324 } | 2335 } |
| 2336 |
2325 __ str(value, target); | 2337 __ str(value, target); |
2326 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2338 if (instr->hydrogen()->NeedsWriteBarrier()) { |
2327 HType type = instr->hydrogen()->value()->type(); | 2339 HType type = instr->hydrogen()->value()->type(); |
2328 SmiCheck check_needed = | 2340 SmiCheck check_needed = |
2329 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2341 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
2330 __ RecordWriteContextSlot(context, | 2342 __ RecordWriteContextSlot(context, |
2331 target.offset(), | 2343 target.offset(), |
2332 value, | 2344 value, |
2333 scratch0(), | 2345 scratch, |
2334 kLRHasBeenSaved, | 2346 kLRHasBeenSaved, |
2335 kSaveFPRegs, | 2347 kSaveFPRegs, |
2336 EMIT_REMEMBERED_SET, | 2348 EMIT_REMEMBERED_SET, |
2337 check_needed); | 2349 check_needed); |
2338 } | 2350 } |
| 2351 |
| 2352 __ bind(&skip_assignment); |
2339 } | 2353 } |
2340 | 2354 |
2341 | 2355 |
2342 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2356 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
2343 Register object = ToRegister(instr->InputAt(0)); | 2357 Register object = ToRegister(instr->InputAt(0)); |
2344 Register result = ToRegister(instr->result()); | 2358 Register result = ToRegister(instr->result()); |
2345 if (instr->hydrogen()->is_in_object()) { | 2359 if (instr->hydrogen()->is_in_object()) { |
2346 __ ldr(result, FieldMemOperand(object, instr->hydrogen()->offset())); | 2360 __ ldr(result, FieldMemOperand(object, instr->hydrogen()->offset())); |
2347 } else { | 2361 } else { |
2348 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 2362 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
(...skipping 2365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4714 ASSERT(osr_pc_offset_ == -1); | 4728 ASSERT(osr_pc_offset_ == -1); |
4715 osr_pc_offset_ = masm()->pc_offset(); | 4729 osr_pc_offset_ = masm()->pc_offset(); |
4716 } | 4730 } |
4717 | 4731 |
4718 | 4732 |
4719 | 4733 |
4720 | 4734 |
4721 #undef __ | 4735 #undef __ |
4722 | 4736 |
4723 } } // namespace v8::internal | 4737 } } // namespace v8::internal |
OLD | NEW |