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 2248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2259 if (instr->hydrogen()->RequiresHoleCheck()) { | 2259 if (instr->hydrogen()->RequiresHoleCheck()) { |
2260 __ ldr(scratch2, | 2260 __ ldr(scratch2, |
2261 FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); | 2261 FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); |
2262 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 2262 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
2263 __ cmp(scratch2, ip); | 2263 __ cmp(scratch2, ip); |
2264 DeoptimizeIf(eq, instr->environment()); | 2264 DeoptimizeIf(eq, instr->environment()); |
2265 } | 2265 } |
2266 | 2266 |
2267 // Store the value. | 2267 // Store the value. |
2268 __ str(value, FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); | 2268 __ str(value, FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); |
2269 | 2269 // Cells are always rescanned, so no write barrier here. |
2270 // Cells are always in the remembered set. | |
2271 if (instr->hydrogen()->NeedsWriteBarrier()) { | |
2272 HType type = instr->hydrogen()->value()->type(); | |
2273 SmiCheck check_needed = | |
2274 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | |
2275 __ RecordWriteField(scratch, | |
2276 JSGlobalPropertyCell::kValueOffset, | |
2277 value, | |
2278 scratch2, | |
2279 kLRHasBeenSaved, | |
2280 kSaveFPRegs, | |
2281 OMIT_REMEMBERED_SET, | |
2282 check_needed); | |
2283 } | |
2284 } | 2270 } |
2285 | 2271 |
2286 | 2272 |
2287 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { | 2273 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { |
2288 ASSERT(ToRegister(instr->global_object()).is(r1)); | 2274 ASSERT(ToRegister(instr->global_object()).is(r1)); |
2289 ASSERT(ToRegister(instr->value()).is(r0)); | 2275 ASSERT(ToRegister(instr->value()).is(r0)); |
2290 | 2276 |
2291 __ mov(r2, Operand(instr->name())); | 2277 __ mov(r2, Operand(instr->name())); |
2292 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) | 2278 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) |
2293 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 2279 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
(...skipping 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4702 ASSERT(osr_pc_offset_ == -1); | 4688 ASSERT(osr_pc_offset_ == -1); |
4703 osr_pc_offset_ = masm()->pc_offset(); | 4689 osr_pc_offset_ = masm()->pc_offset(); |
4704 } | 4690 } |
4705 | 4691 |
4706 | 4692 |
4707 | 4693 |
4708 | 4694 |
4709 #undef __ | 4695 #undef __ |
4710 | 4696 |
4711 } } // namespace v8::internal | 4697 } } // namespace v8::internal |
OLD | NEW |