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 2106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2117 | 2117 |
2118 __ mov(ecx, instr->name()); | 2118 __ mov(ecx, instr->name()); |
2119 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET : | 2119 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET : |
2120 RelocInfo::CODE_TARGET_CONTEXT; | 2120 RelocInfo::CODE_TARGET_CONTEXT; |
2121 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); | 2121 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); |
2122 CallCode(ic, mode, instr); | 2122 CallCode(ic, mode, instr); |
2123 } | 2123 } |
2124 | 2124 |
2125 | 2125 |
2126 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 2126 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
2127 Register object = ToRegister(instr->TempAt(0)); | 2127 Register value = ToRegister(instr->value()); |
2128 Register address = ToRegister(instr->TempAt(1)); | 2128 Handle<JSGlobalPropertyCell> cell_handle = instr->hydrogen()->cell(); |
2129 Register value = ToRegister(instr->InputAt(0)); | |
2130 ASSERT(!value.is(object)); | |
2131 Handle<JSGlobalPropertyCell> cell_handle(instr->hydrogen()->cell()); | |
2132 | |
2133 int offset = JSGlobalPropertyCell::kValueOffset; | |
2134 __ mov(object, Immediate(cell_handle)); | |
2135 | 2129 |
2136 // If the cell we are storing to contains the hole it could have | 2130 // If the cell we are storing to contains the hole it could have |
2137 // been deleted from the property dictionary. In that case, we need | 2131 // been deleted from the property dictionary. In that case, we need |
2138 // to update the property details in the property dictionary to mark | 2132 // to update the property details in the property dictionary to mark |
2139 // it as no longer deleted. We deoptimize in that case. | 2133 // it as no longer deleted. We deoptimize in that case. |
2140 if (instr->hydrogen()->RequiresHoleCheck()) { | 2134 if (instr->hydrogen()->RequiresHoleCheck()) { |
2141 __ cmp(FieldOperand(object, offset), factory()->the_hole_value()); | 2135 __ cmp(Operand::Cell(cell_handle), factory()->the_hole_value()); |
2142 DeoptimizeIf(equal, instr->environment()); | 2136 DeoptimizeIf(equal, instr->environment()); |
2143 } | 2137 } |
2144 | 2138 |
2145 // Store the value. | 2139 // Store the value. |
2146 __ mov(FieldOperand(object, offset), value); | 2140 __ mov(Operand::Cell(cell_handle), value); |
2147 // Cells are always rescanned, so no write barrier here. | 2141 // Cells are always rescanned, so no write barrier here. |
2148 } | 2142 } |
2149 | 2143 |
2150 | 2144 |
2151 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { | 2145 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { |
2152 ASSERT(ToRegister(instr->context()).is(esi)); | 2146 ASSERT(ToRegister(instr->context()).is(esi)); |
2153 ASSERT(ToRegister(instr->global_object()).is(edx)); | 2147 ASSERT(ToRegister(instr->global_object()).is(edx)); |
2154 ASSERT(ToRegister(instr->value()).is(eax)); | 2148 ASSERT(ToRegister(instr->value()).is(eax)); |
2155 | 2149 |
2156 __ mov(ecx, instr->name()); | 2150 __ mov(ecx, instr->name()); |
(...skipping 2478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4635 this, pointers, Safepoint::kLazyDeopt); | 4629 this, pointers, Safepoint::kLazyDeopt); |
4636 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4630 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
4637 } | 4631 } |
4638 | 4632 |
4639 | 4633 |
4640 #undef __ | 4634 #undef __ |
4641 | 4635 |
4642 } } // namespace v8::internal | 4636 } } // namespace v8::internal |
4643 | 4637 |
4644 #endif // V8_TARGET_ARCH_IA32 | 4638 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |