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 2056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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->hydrogen()->RequiresHoleCheck()) { | 2070 if (instr->hydrogen()->RequiresHoleCheck()) { |
2071 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | 2071 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
2072 if (instr->hydrogen()->DeoptimizesOnHole()) { | 2072 if (instr->hydrogen()->DeoptimizesOnHole()) { |
2073 DeoptimizeIf(equal, instr->environment()); | 2073 DeoptimizeIf(equal, instr->environment()); |
2074 } else { | 2074 } else { |
2075 Label is_not_hole; | 2075 Label is_not_hole; |
2076 __ j(not_equal, &is_not_hole, Label::kNear); | 2076 __ j(not_equal, &is_not_hole, Label::kNear); |
2077 __ movq(result, factory()->undefined_value(), RelocInfo::NONE); | 2077 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
2078 __ bind(&is_not_hole); | 2078 __ bind(&is_not_hole); |
2079 } | 2079 } |
2080 } | 2080 } |
2081 } | 2081 } |
2082 | 2082 |
2083 | 2083 |
2084 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2084 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
2085 Register context = ToRegister(instr->context()); | 2085 Register context = ToRegister(instr->context()); |
2086 Register value = ToRegister(instr->value()); | 2086 Register value = ToRegister(instr->value()); |
2087 | 2087 |
2088 Operand target = ContextOperand(context, instr->slot_index()); | 2088 Operand target = ContextOperand(context, instr->slot_index()); |
2089 | 2089 |
2090 Label skip_assignment; | 2090 Label skip_assignment; |
2091 if (instr->hydrogen()->RequiresHoleCheck()) { | 2091 if (instr->hydrogen()->RequiresHoleCheck()) { |
2092 __ CompareRoot(target, Heap::kTheHoleValueRootIndex); | 2092 __ CompareRoot(target, Heap::kTheHoleValueRootIndex); |
2093 if (instr->hydrogen()->DeoptimizesOnHole()) { | 2093 if (instr->hydrogen()->DeoptimizesOnHole()) { |
2094 DeoptimizeIf(equal, instr->environment()); | 2094 DeoptimizeIf(equal, instr->environment()); |
2095 } else { | 2095 } else { |
2096 __ j(not_equal, &skip_assignment, Label::kNear); | 2096 __ j(not_equal, &skip_assignment); |
2097 } | 2097 } |
2098 } | 2098 } |
2099 __ movq(target, value); | 2099 __ movq(target, value); |
2100 | 2100 |
2101 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2101 if (instr->hydrogen()->NeedsWriteBarrier()) { |
2102 HType type = instr->hydrogen()->value()->type(); | 2102 HType type = instr->hydrogen()->value()->type(); |
2103 SmiCheck check_needed = | 2103 SmiCheck check_needed = |
2104 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2104 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
2105 int offset = Context::SlotOffset(instr->slot_index()); | 2105 int offset = Context::SlotOffset(instr->slot_index()); |
2106 Register scratch = ToRegister(instr->TempAt(0)); | 2106 Register scratch = ToRegister(instr->TempAt(0)); |
(...skipping 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4334 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 4334 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
4335 ASSERT(osr_pc_offset_ == -1); | 4335 ASSERT(osr_pc_offset_ == -1); |
4336 osr_pc_offset_ = masm()->pc_offset(); | 4336 osr_pc_offset_ = masm()->pc_offset(); |
4337 } | 4337 } |
4338 | 4338 |
4339 #undef __ | 4339 #undef __ |
4340 | 4340 |
4341 } } // namespace v8::internal | 4341 } } // namespace v8::internal |
4342 | 4342 |
4343 #endif // V8_TARGET_ARCH_X64 | 4343 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |