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 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 // been deleted from the property dictionary. In that case, we need | 2042 // been deleted from the property dictionary. In that case, we need |
2043 // to update the property details in the property dictionary to mark | 2043 // to update the property details in the property dictionary to mark |
2044 // it as no longer deleted. We deoptimize in that case. | 2044 // it as no longer deleted. We deoptimize in that case. |
2045 if (instr->hydrogen()->RequiresHoleCheck()) { | 2045 if (instr->hydrogen()->RequiresHoleCheck()) { |
2046 __ CompareRoot(Operand(address, 0), Heap::kTheHoleValueRootIndex); | 2046 __ CompareRoot(Operand(address, 0), Heap::kTheHoleValueRootIndex); |
2047 DeoptimizeIf(equal, instr->environment()); | 2047 DeoptimizeIf(equal, instr->environment()); |
2048 } | 2048 } |
2049 | 2049 |
2050 // Store the value. | 2050 // Store the value. |
2051 __ movq(Operand(address, 0), value); | 2051 __ movq(Operand(address, 0), value); |
2052 | 2052 // Cells are always rescanned, so no write barrier here. |
2053 if (instr->hydrogen()->NeedsWriteBarrier()) { | |
2054 Label smi_store; | |
2055 HType type = instr->hydrogen()->value()->type(); | |
2056 if (!type.IsHeapNumber() && !type.IsString() && !type.IsNonPrimitive()) { | |
2057 __ JumpIfSmi(value, &smi_store, Label::kNear); | |
2058 } | |
2059 | |
2060 int offset = JSGlobalPropertyCell::kValueOffset - kHeapObjectTag; | |
2061 __ lea(object, Operand(address, -offset)); | |
2062 // Cells are always in the remembered set. | |
2063 __ RecordWrite(object, | |
2064 address, | |
2065 value, | |
2066 kSaveFPRegs, | |
2067 OMIT_REMEMBERED_SET, | |
2068 OMIT_SMI_CHECK); | |
2069 __ bind(&smi_store); | |
2070 } | |
2071 } | 2053 } |
2072 | 2054 |
2073 | 2055 |
2074 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { | 2056 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { |
2075 ASSERT(ToRegister(instr->global_object()).is(rdx)); | 2057 ASSERT(ToRegister(instr->global_object()).is(rdx)); |
2076 ASSERT(ToRegister(instr->value()).is(rax)); | 2058 ASSERT(ToRegister(instr->value()).is(rax)); |
2077 | 2059 |
2078 __ Move(rcx, instr->name()); | 2060 __ Move(rcx, instr->name()); |
2079 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) | 2061 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) |
2080 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 2062 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
(...skipping 2232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4313 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 4295 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
4314 ASSERT(osr_pc_offset_ == -1); | 4296 ASSERT(osr_pc_offset_ == -1); |
4315 osr_pc_offset_ = masm()->pc_offset(); | 4297 osr_pc_offset_ = masm()->pc_offset(); |
4316 } | 4298 } |
4317 | 4299 |
4318 #undef __ | 4300 #undef __ |
4319 | 4301 |
4320 } } // namespace v8::internal | 4302 } } // namespace v8::internal |
4321 | 4303 |
4322 #endif // V8_TARGET_ARCH_X64 | 4304 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |