| 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 2143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2154 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 2154 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
| 2155 : isolate()->builtins()->StoreIC_Initialize(); | 2155 : isolate()->builtins()->StoreIC_Initialize(); |
| 2156 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); | 2156 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); |
| 2157 } | 2157 } |
| 2158 | 2158 |
| 2159 | 2159 |
| 2160 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2160 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| 2161 Register context = ToRegister(instr->context()); | 2161 Register context = ToRegister(instr->context()); |
| 2162 Register result = ToRegister(instr->result()); | 2162 Register result = ToRegister(instr->result()); |
| 2163 __ lw(result, ContextOperand(context, instr->slot_index())); | 2163 __ lw(result, ContextOperand(context, instr->slot_index())); |
| 2164 if (instr->RequiresHoleCheck()) { |
| 2165 Label is_not_hole; |
| 2166 __ Branch(&is_not_hole, ne, result, Operand(factory()->the_hole_value())); |
| 2167 |
| 2168 __ li(result, Operand(factory()->undefined_value())); |
| 2169 |
| 2170 __ bind(&is_not_hole); |
| 2171 } |
| 2164 } | 2172 } |
| 2165 | 2173 |
| 2166 | 2174 |
| 2167 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2175 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| 2168 Register context = ToRegister(instr->context()); | 2176 Register context = ToRegister(instr->context()); |
| 2169 Register value = ToRegister(instr->value()); | 2177 Register value = ToRegister(instr->value()); |
| 2178 Register scratch = scratch0(); |
| 2170 MemOperand target = ContextOperand(context, instr->slot_index()); | 2179 MemOperand target = ContextOperand(context, instr->slot_index()); |
| 2180 |
| 2181 Label skip_assignment; |
| 2182 |
| 2183 if (instr->RequiresHoleCheck()) { |
| 2184 __ lw(scratch, target); |
| 2185 __ Branch(&skip_assignment, ne, scratch, |
| 2186 Operand(factory()->the_hole_value())); |
| 2187 } |
| 2188 |
| 2171 __ sw(value, target); | 2189 __ sw(value, target); |
| 2172 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2190 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 2173 HType type = instr->hydrogen()->value()->type(); | 2191 HType type = instr->hydrogen()->value()->type(); |
| 2174 SmiCheck check_needed = | 2192 SmiCheck check_needed = |
| 2175 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2193 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
| 2176 __ RecordWriteContextSlot(context, | 2194 __ RecordWriteContextSlot(context, |
| 2177 target.offset(), | 2195 target.offset(), |
| 2178 value, | 2196 value, |
| 2179 scratch0(), | 2197 scratch0(), |
| 2180 kRAHasBeenSaved, | 2198 kRAHasBeenSaved, |
| 2181 kSaveFPRegs, | 2199 kSaveFPRegs, |
| 2182 EMIT_REMEMBERED_SET, | 2200 EMIT_REMEMBERED_SET, |
| 2183 check_needed); | 2201 check_needed); |
| 2184 } | 2202 } |
| 2203 |
| 2204 __ bind(&skip_assignment); |
| 2185 } | 2205 } |
| 2186 | 2206 |
| 2187 | 2207 |
| 2188 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2208 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
| 2189 Register object = ToRegister(instr->InputAt(0)); | 2209 Register object = ToRegister(instr->InputAt(0)); |
| 2190 Register result = ToRegister(instr->result()); | 2210 Register result = ToRegister(instr->result()); |
| 2191 if (instr->hydrogen()->is_in_object()) { | 2211 if (instr->hydrogen()->is_in_object()) { |
| 2192 __ lw(result, FieldMemOperand(object, instr->hydrogen()->offset())); | 2212 __ lw(result, FieldMemOperand(object, instr->hydrogen()->offset())); |
| 2193 } else { | 2213 } else { |
| 2194 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 2214 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| (...skipping 2453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4648 ASSERT(!environment->HasBeenRegistered()); | 4668 ASSERT(!environment->HasBeenRegistered()); |
| 4649 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 4669 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
| 4650 ASSERT(osr_pc_offset_ == -1); | 4670 ASSERT(osr_pc_offset_ == -1); |
| 4651 osr_pc_offset_ = masm()->pc_offset(); | 4671 osr_pc_offset_ = masm()->pc_offset(); |
| 4652 } | 4672 } |
| 4653 | 4673 |
| 4654 | 4674 |
| 4655 #undef __ | 4675 #undef __ |
| 4656 | 4676 |
| 4657 } } // namespace v8::internal | 4677 } } // namespace v8::internal |
| OLD | NEW |