| 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 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2174 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 2174 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
| 2175 : isolate()->builtins()->StoreIC_Initialize(); | 2175 : isolate()->builtins()->StoreIC_Initialize(); |
| 2176 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); | 2176 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); |
| 2177 } | 2177 } |
| 2178 | 2178 |
| 2179 | 2179 |
| 2180 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2180 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| 2181 Register context = ToRegister(instr->context()); | 2181 Register context = ToRegister(instr->context()); |
| 2182 Register result = ToRegister(instr->result()); | 2182 Register result = ToRegister(instr->result()); |
| 2183 __ lw(result, ContextOperand(context, instr->slot_index())); | 2183 __ lw(result, ContextOperand(context, instr->slot_index())); |
| 2184 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2185 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
| 2186 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); |
| 2187 } |
| 2184 } | 2188 } |
| 2185 | 2189 |
| 2186 | 2190 |
| 2187 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2191 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| 2188 Register context = ToRegister(instr->context()); | 2192 Register context = ToRegister(instr->context()); |
| 2189 Register value = ToRegister(instr->value()); | 2193 Register value = ToRegister(instr->value()); |
| 2190 MemOperand target = ContextOperand(context, instr->slot_index()); | 2194 MemOperand target = ContextOperand(context, instr->slot_index()); |
| 2195 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2196 Register scratch = scratch0(); |
| 2197 __ lw(scratch, target); |
| 2198 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
| 2199 DeoptimizeIf(eq, instr->environment(), scratch, Operand(at)); |
| 2200 } |
| 2191 __ sw(value, target); | 2201 __ sw(value, target); |
| 2192 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2202 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 2193 HType type = instr->hydrogen()->value()->type(); | 2203 HType type = instr->hydrogen()->value()->type(); |
| 2194 SmiCheck check_needed = | 2204 SmiCheck check_needed = |
| 2195 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2205 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
| 2196 __ RecordWriteContextSlot(context, | 2206 __ RecordWriteContextSlot(context, |
| 2197 target.offset(), | 2207 target.offset(), |
| 2198 value, | 2208 value, |
| 2199 scratch0(), | 2209 scratch0(), |
| 2200 kRAHasBeenSaved, | 2210 kRAHasBeenSaved, |
| (...skipping 2475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4676 ASSERT(!environment->HasBeenRegistered()); | 4686 ASSERT(!environment->HasBeenRegistered()); |
| 4677 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 4687 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
| 4678 ASSERT(osr_pc_offset_ == -1); | 4688 ASSERT(osr_pc_offset_ == -1); |
| 4679 osr_pc_offset_ = masm()->pc_offset(); | 4689 osr_pc_offset_ = masm()->pc_offset(); |
| 4680 } | 4690 } |
| 4681 | 4691 |
| 4682 | 4692 |
| 4683 #undef __ | 4693 #undef __ |
| 4684 | 4694 |
| 4685 } } // namespace v8::internal | 4695 } } // namespace v8::internal |
| OLD | NEW |