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 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2276 if (instr->hydrogen()->RequiresHoleCheck()) { | 2276 if (instr->hydrogen()->RequiresHoleCheck()) { |
2277 __ ldr(scratch2, | 2277 __ ldr(scratch2, |
2278 FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); | 2278 FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); |
2279 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 2279 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
2280 __ cmp(scratch2, ip); | 2280 __ cmp(scratch2, ip); |
2281 DeoptimizeIf(eq, instr->environment()); | 2281 DeoptimizeIf(eq, instr->environment()); |
2282 } | 2282 } |
2283 | 2283 |
2284 // Store the value. | 2284 // Store the value. |
2285 __ str(value, FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); | 2285 __ str(value, FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); |
2286 | 2286 // Cells are always rescanned, so no write barrier here. |
2287 // Cells are always in the remembered set. | |
2288 if (instr->hydrogen()->NeedsWriteBarrier()) { | |
2289 HType type = instr->hydrogen()->value()->type(); | |
2290 SmiCheck check_needed = | |
2291 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | |
2292 __ RecordWriteField(scratch, | |
2293 JSGlobalPropertyCell::kValueOffset, | |
2294 value, | |
2295 scratch2, | |
2296 kLRHasBeenSaved, | |
2297 kSaveFPRegs, | |
2298 OMIT_REMEMBERED_SET, | |
2299 check_needed); | |
2300 } | |
2301 } | 2287 } |
2302 | 2288 |
2303 | 2289 |
2304 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { | 2290 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { |
2305 ASSERT(ToRegister(instr->global_object()).is(r1)); | 2291 ASSERT(ToRegister(instr->global_object()).is(r1)); |
2306 ASSERT(ToRegister(instr->value()).is(r0)); | 2292 ASSERT(ToRegister(instr->value()).is(r0)); |
2307 | 2293 |
2308 __ mov(r2, Operand(instr->name())); | 2294 __ mov(r2, Operand(instr->name())); |
2309 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) | 2295 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) |
2310 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 2296 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
(...skipping 2432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4743 ASSERT(osr_pc_offset_ == -1); | 4729 ASSERT(osr_pc_offset_ == -1); |
4744 osr_pc_offset_ = masm()->pc_offset(); | 4730 osr_pc_offset_ = masm()->pc_offset(); |
4745 } | 4731 } |
4746 | 4732 |
4747 | 4733 |
4748 | 4734 |
4749 | 4735 |
4750 #undef __ | 4736 #undef __ |
4751 | 4737 |
4752 } } // namespace v8::internal | 4738 } } // namespace v8::internal |
OLD | NEW |