| 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 2055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2066 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2066 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| 2067 Register context = ToRegister(instr->context()); | 2067 Register context = ToRegister(instr->context()); |
| 2068 Register result = ToRegister(instr->result()); | 2068 Register result = ToRegister(instr->result()); |
| 2069 __ movq(result, ContextOperand(context, instr->slot_index())); | 2069 __ movq(result, ContextOperand(context, instr->slot_index())); |
| 2070 } | 2070 } |
| 2071 | 2071 |
| 2072 | 2072 |
| 2073 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2073 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| 2074 Register context = ToRegister(instr->context()); | 2074 Register context = ToRegister(instr->context()); |
| 2075 Register value = ToRegister(instr->value()); | 2075 Register value = ToRegister(instr->value()); |
| 2076 |
| 2077 Label skip_assignment; |
| 2078 |
| 2079 if (instr->needs_is_hole_check()) { |
| 2080 __ Cmp(ContextOperand(context, instr->slot_index()), |
| 2081 factory()->the_hole_value()); |
| 2082 __ j(not_equal, &skip_assignment, Label::kNear); |
| 2083 } |
| 2084 |
| 2076 __ movq(ContextOperand(context, instr->slot_index()), value); | 2085 __ movq(ContextOperand(context, instr->slot_index()), value); |
| 2077 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2086 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 2078 HType type = instr->hydrogen()->value()->type(); | 2087 HType type = instr->hydrogen()->value()->type(); |
| 2079 SmiCheck check_needed = | 2088 SmiCheck check_needed = |
| 2080 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2089 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
| 2081 int offset = Context::SlotOffset(instr->slot_index()); | 2090 int offset = Context::SlotOffset(instr->slot_index()); |
| 2082 Register scratch = ToRegister(instr->TempAt(0)); | 2091 Register scratch = ToRegister(instr->TempAt(0)); |
| 2083 __ RecordWriteContextSlot(context, | 2092 __ RecordWriteContextSlot(context, |
| 2084 offset, | 2093 offset, |
| 2085 value, | 2094 value, |
| 2086 scratch, | 2095 scratch, |
| 2087 kSaveFPRegs, | 2096 kSaveFPRegs, |
| 2088 EMIT_REMEMBERED_SET, | 2097 EMIT_REMEMBERED_SET, |
| 2089 check_needed); | 2098 check_needed); |
| 2090 } | 2099 } |
| 2100 |
| 2101 __ bind(&skip_assignment); |
| 2091 } | 2102 } |
| 2092 | 2103 |
| 2093 | 2104 |
| 2094 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2105 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
| 2095 Register object = ToRegister(instr->InputAt(0)); | 2106 Register object = ToRegister(instr->InputAt(0)); |
| 2096 Register result = ToRegister(instr->result()); | 2107 Register result = ToRegister(instr->result()); |
| 2097 if (instr->hydrogen()->is_in_object()) { | 2108 if (instr->hydrogen()->is_in_object()) { |
| 2098 __ movq(result, FieldOperand(object, instr->hydrogen()->offset())); | 2109 __ movq(result, FieldOperand(object, instr->hydrogen()->offset())); |
| 2099 } else { | 2110 } else { |
| 2100 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 2111 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); |
| (...skipping 2207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4308 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 4319 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
| 4309 ASSERT(osr_pc_offset_ == -1); | 4320 ASSERT(osr_pc_offset_ == -1); |
| 4310 osr_pc_offset_ = masm()->pc_offset(); | 4321 osr_pc_offset_ = masm()->pc_offset(); |
| 4311 } | 4322 } |
| 4312 | 4323 |
| 4313 #undef __ | 4324 #undef __ |
| 4314 | 4325 |
| 4315 } } // namespace v8::internal | 4326 } } // namespace v8::internal |
| 4316 | 4327 |
| 4317 #endif // V8_TARGET_ARCH_X64 | 4328 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |