| 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 2204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2215 RelocInfo::CODE_TARGET_CONTEXT; | 2215 RelocInfo::CODE_TARGET_CONTEXT; |
| 2216 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); | 2216 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); |
| 2217 CallCode(ic, mode, instr, CONTEXT_ADJUSTED); | 2217 CallCode(ic, mode, instr, CONTEXT_ADJUSTED); |
| 2218 } | 2218 } |
| 2219 | 2219 |
| 2220 | 2220 |
| 2221 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 2221 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
| 2222 Register object = ToRegister(instr->TempAt(0)); | 2222 Register object = ToRegister(instr->TempAt(0)); |
| 2223 Register address = ToRegister(instr->TempAt(1)); | 2223 Register address = ToRegister(instr->TempAt(1)); |
| 2224 Register value = ToRegister(instr->InputAt(0)); | 2224 Register value = ToRegister(instr->InputAt(0)); |
| 2225 ASSERT(!value.is(object)); |
| 2225 Handle<JSGlobalPropertyCell> cell_handle(instr->hydrogen()->cell()); | 2226 Handle<JSGlobalPropertyCell> cell_handle(instr->hydrogen()->cell()); |
| 2226 | 2227 |
| 2228 int offset = JSGlobalPropertyCell::kValueOffset; |
| 2229 __ mov(object, Immediate(cell_handle)); |
| 2230 |
| 2227 // If the cell we are storing to contains the hole it could have | 2231 // If the cell we are storing to contains the hole it could have |
| 2228 // been deleted from the property dictionary. In that case, we need | 2232 // been deleted from the property dictionary. In that case, we need |
| 2229 // to update the property details in the property dictionary to mark | 2233 // to update the property details in the property dictionary to mark |
| 2230 // it as no longer deleted. We deoptimize in that case. | 2234 // it as no longer deleted. We deoptimize in that case. |
| 2231 if (instr->hydrogen()->check_hole_value()) { | 2235 if (instr->hydrogen()->check_hole_value()) { |
| 2232 __ cmp(Operand::Cell(cell_handle), factory()->the_hole_value()); | 2236 __ cmp(FieldOperand(object, offset), factory()->the_hole_value()); |
| 2233 DeoptimizeIf(equal, instr->environment()); | 2237 DeoptimizeIf(equal, instr->environment()); |
| 2234 } | 2238 } |
| 2235 | 2239 |
| 2236 // Store the value. | 2240 // Store the value. |
| 2237 __ mov(object, Immediate(cell_handle)); | 2241 __ mov(FieldOperand(object, offset), value); |
| 2238 __ lea(address, FieldOperand(object, JSGlobalPropertyCell::kValueOffset)); | |
| 2239 __ mov(Operand(address, 0), value); | |
| 2240 | |
| 2241 | 2242 |
| 2242 // Cells are always in the remembered set. | 2243 // Cells are always in the remembered set. |
| 2243 __ RecordWriteField(object, | 2244 __ RecordWriteField(object, |
| 2244 JSGlobalPropertyCell::kValueOffset, | 2245 offset, |
| 2245 value, | 2246 value, |
| 2246 address, | 2247 address, |
| 2247 kSaveFPRegs, | 2248 kSaveFPRegs, |
| 2248 OMIT_REMEMBERED_SET, | 2249 OMIT_REMEMBERED_SET); |
| 2249 INLINE_SMI_CHECK); | |
| 2250 } | 2250 } |
| 2251 | 2251 |
| 2252 | 2252 |
| 2253 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { | 2253 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { |
| 2254 ASSERT(ToRegister(instr->context()).is(esi)); | 2254 ASSERT(ToRegister(instr->context()).is(esi)); |
| 2255 ASSERT(ToRegister(instr->global_object()).is(edx)); | 2255 ASSERT(ToRegister(instr->global_object()).is(edx)); |
| 2256 ASSERT(ToRegister(instr->value()).is(eax)); | 2256 ASSERT(ToRegister(instr->value()).is(eax)); |
| 2257 | 2257 |
| 2258 __ mov(ecx, instr->name()); | 2258 __ mov(ecx, instr->name()); |
| 2259 Handle<Code> ic = instr->strict_mode() | 2259 Handle<Code> ic = instr->strict_mode() |
| (...skipping 2207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4467 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 4467 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 4468 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4468 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
| 4469 } | 4469 } |
| 4470 | 4470 |
| 4471 | 4471 |
| 4472 #undef __ | 4472 #undef __ |
| 4473 | 4473 |
| 4474 } } // namespace v8::internal | 4474 } } // namespace v8::internal |
| 4475 | 4475 |
| 4476 #endif // V8_TARGET_ARCH_IA32 | 4476 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |