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 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2060 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 2060 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
2061 : isolate()->builtins()->StoreIC_Initialize(); | 2061 : isolate()->builtins()->StoreIC_Initialize(); |
2062 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); | 2062 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); |
2063 } | 2063 } |
2064 | 2064 |
2065 | 2065 |
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 if (instr->RequiresHoleCheck()) { |
| 2071 Label is_not_hole; |
| 2072 __ Cmp(result, factory()->the_hole_value()); |
| 2073 __ j(not_equal, &is_not_hole, Label::kNear); |
| 2074 |
| 2075 __ movq(result, factory()->undefined_value(), RelocInfo::NONE); |
| 2076 |
| 2077 __ bind(&is_not_hole); |
| 2078 } |
2070 } | 2079 } |
2071 | 2080 |
2072 | 2081 |
2073 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2082 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
2074 Register context = ToRegister(instr->context()); | 2083 Register context = ToRegister(instr->context()); |
2075 Register value = ToRegister(instr->value()); | 2084 Register value = ToRegister(instr->value()); |
| 2085 |
| 2086 Label skip_assignment; |
| 2087 |
| 2088 if (instr->RequiresHoleCheck()) { |
| 2089 __ Cmp(ContextOperand(context, instr->slot_index()), |
| 2090 factory()->the_hole_value()); |
| 2091 __ j(not_equal, &skip_assignment, Label::kNear); |
| 2092 } |
| 2093 |
2076 __ movq(ContextOperand(context, instr->slot_index()), value); | 2094 __ movq(ContextOperand(context, instr->slot_index()), value); |
2077 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2095 if (instr->hydrogen()->NeedsWriteBarrier()) { |
2078 HType type = instr->hydrogen()->value()->type(); | 2096 HType type = instr->hydrogen()->value()->type(); |
2079 SmiCheck check_needed = | 2097 SmiCheck check_needed = |
2080 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2098 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
2081 int offset = Context::SlotOffset(instr->slot_index()); | 2099 int offset = Context::SlotOffset(instr->slot_index()); |
2082 Register scratch = ToRegister(instr->TempAt(0)); | 2100 Register scratch = ToRegister(instr->TempAt(0)); |
2083 __ RecordWriteContextSlot(context, | 2101 __ RecordWriteContextSlot(context, |
2084 offset, | 2102 offset, |
2085 value, | 2103 value, |
2086 scratch, | 2104 scratch, |
2087 kSaveFPRegs, | 2105 kSaveFPRegs, |
2088 EMIT_REMEMBERED_SET, | 2106 EMIT_REMEMBERED_SET, |
2089 check_needed); | 2107 check_needed); |
2090 } | 2108 } |
| 2109 |
| 2110 __ bind(&skip_assignment); |
2091 } | 2111 } |
2092 | 2112 |
2093 | 2113 |
2094 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2114 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
2095 Register object = ToRegister(instr->InputAt(0)); | 2115 Register object = ToRegister(instr->InputAt(0)); |
2096 Register result = ToRegister(instr->result()); | 2116 Register result = ToRegister(instr->result()); |
2097 if (instr->hydrogen()->is_in_object()) { | 2117 if (instr->hydrogen()->is_in_object()) { |
2098 __ movq(result, FieldOperand(object, instr->hydrogen()->offset())); | 2118 __ movq(result, FieldOperand(object, instr->hydrogen()->offset())); |
2099 } else { | 2119 } else { |
2100 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 2120 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); |
(...skipping 2207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4308 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 4328 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
4309 ASSERT(osr_pc_offset_ == -1); | 4329 ASSERT(osr_pc_offset_ == -1); |
4310 osr_pc_offset_ = masm()->pc_offset(); | 4330 osr_pc_offset_ = masm()->pc_offset(); |
4311 } | 4331 } |
4312 | 4332 |
4313 #undef __ | 4333 #undef __ |
4314 | 4334 |
4315 } } // namespace v8::internal | 4335 } } // namespace v8::internal |
4316 | 4336 |
4317 #endif // V8_TARGET_ARCH_X64 | 4337 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |