| 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 2067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2078 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 2078 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
| 2079 : isolate()->builtins()->StoreIC_Initialize(); | 2079 : isolate()->builtins()->StoreIC_Initialize(); |
| 2080 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); | 2080 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); |
| 2081 } | 2081 } |
| 2082 | 2082 |
| 2083 | 2083 |
| 2084 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2084 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| 2085 Register context = ToRegister(instr->context()); | 2085 Register context = ToRegister(instr->context()); |
| 2086 Register result = ToRegister(instr->result()); | 2086 Register result = ToRegister(instr->result()); |
| 2087 __ movq(result, ContextOperand(context, instr->slot_index())); | 2087 __ movq(result, ContextOperand(context, instr->slot_index())); |
| 2088 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2089 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
| 2090 DeoptimizeIf(equal, instr->environment()); |
| 2091 } |
| 2088 } | 2092 } |
| 2089 | 2093 |
| 2090 | 2094 |
| 2091 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2095 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| 2092 Register context = ToRegister(instr->context()); | 2096 Register context = ToRegister(instr->context()); |
| 2093 Register value = ToRegister(instr->value()); | 2097 Register value = ToRegister(instr->value()); |
| 2094 __ movq(ContextOperand(context, instr->slot_index()), value); | 2098 Operand target = ContextOperand(context, instr->slot_index()); |
| 2099 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2100 __ CompareRoot(target, Heap::kTheHoleValueRootIndex); |
| 2101 DeoptimizeIf(equal, instr->environment()); |
| 2102 } |
| 2103 __ movq(target, value); |
| 2095 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2104 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 2096 HType type = instr->hydrogen()->value()->type(); | 2105 HType type = instr->hydrogen()->value()->type(); |
| 2097 SmiCheck check_needed = | 2106 SmiCheck check_needed = |
| 2098 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2107 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
| 2099 int offset = Context::SlotOffset(instr->slot_index()); | 2108 int offset = Context::SlotOffset(instr->slot_index()); |
| 2100 Register scratch = ToRegister(instr->TempAt(0)); | 2109 Register scratch = ToRegister(instr->TempAt(0)); |
| 2101 __ RecordWriteContextSlot(context, | 2110 __ RecordWriteContextSlot(context, |
| 2102 offset, | 2111 offset, |
| 2103 value, | 2112 value, |
| 2104 scratch, | 2113 scratch, |
| (...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4345 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 4354 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
| 4346 ASSERT(osr_pc_offset_ == -1); | 4355 ASSERT(osr_pc_offset_ == -1); |
| 4347 osr_pc_offset_ = masm()->pc_offset(); | 4356 osr_pc_offset_ = masm()->pc_offset(); |
| 4348 } | 4357 } |
| 4349 | 4358 |
| 4350 #undef __ | 4359 #undef __ |
| 4351 | 4360 |
| 4352 } } // namespace v8::internal | 4361 } } // namespace v8::internal |
| 4353 | 4362 |
| 4354 #endif // V8_TARGET_ARCH_X64 | 4363 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |