| 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 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } | 2164 } |
| 2165 | 2165 |
| 2166 | 2166 |
| 2167 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2167 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| 2168 Register context = ToRegister(instr->context()); | 2168 Register context = ToRegister(instr->context()); |
| 2169 Register value = ToRegister(instr->value()); | 2169 Register value = ToRegister(instr->value()); |
| 2170 Register scratch = scratch0(); |
| 2170 MemOperand target = ContextOperand(context, instr->slot_index()); | 2171 MemOperand target = ContextOperand(context, instr->slot_index()); |
| 2172 |
| 2173 Label skip_assignment; |
| 2174 |
| 2175 if (instr->RequiresHoleCheck()) { |
| 2176 __ lw(scratch, target); |
| 2177 __ Branch(&skip_assignment, ne, scratch, |
| 2178 Operand(factory()->the_hole_value())); |
| 2179 } |
| 2180 |
| 2171 __ sw(value, target); | 2181 __ sw(value, target); |
| 2172 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2182 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 2173 HType type = instr->hydrogen()->value()->type(); | 2183 HType type = instr->hydrogen()->value()->type(); |
| 2174 SmiCheck check_needed = | 2184 SmiCheck check_needed = |
| 2175 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2185 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
| 2176 __ RecordWriteContextSlot(context, | 2186 __ RecordWriteContextSlot(context, |
| 2177 target.offset(), | 2187 target.offset(), |
| 2178 value, | 2188 value, |
| 2179 scratch0(), | 2189 scratch0(), |
| 2180 kRAHasBeenSaved, | 2190 kRAHasBeenSaved, |
| 2181 kSaveFPRegs, | 2191 kSaveFPRegs, |
| 2182 EMIT_REMEMBERED_SET, | 2192 EMIT_REMEMBERED_SET, |
| 2183 check_needed); | 2193 check_needed); |
| 2184 } | 2194 } |
| 2195 |
| 2196 __ bind(&skip_assignment); |
| 2185 } | 2197 } |
| 2186 | 2198 |
| 2187 | 2199 |
| 2188 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2200 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
| 2189 Register object = ToRegister(instr->InputAt(0)); | 2201 Register object = ToRegister(instr->InputAt(0)); |
| 2190 Register result = ToRegister(instr->result()); | 2202 Register result = ToRegister(instr->result()); |
| 2191 if (instr->hydrogen()->is_in_object()) { | 2203 if (instr->hydrogen()->is_in_object()) { |
| 2192 __ lw(result, FieldMemOperand(object, instr->hydrogen()->offset())); | 2204 __ lw(result, FieldMemOperand(object, instr->hydrogen()->offset())); |
| 2193 } else { | 2205 } else { |
| 2194 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 2206 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| (...skipping 2453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4648 ASSERT(!environment->HasBeenRegistered()); | 4660 ASSERT(!environment->HasBeenRegistered()); |
| 4649 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 4661 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
| 4650 ASSERT(osr_pc_offset_ == -1); | 4662 ASSERT(osr_pc_offset_ == -1); |
| 4651 osr_pc_offset_ = masm()->pc_offset(); | 4663 osr_pc_offset_ = masm()->pc_offset(); |
| 4652 } | 4664 } |
| 4653 | 4665 |
| 4654 | 4666 |
| 4655 #undef __ | 4667 #undef __ |
| 4656 | 4668 |
| 4657 } } // namespace v8::internal | 4669 } } // namespace v8::internal |
| OLD | NEW |