OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2264 ASSERT(!needs_write_barrier_for_map); | 2264 ASSERT(!needs_write_barrier_for_map); |
2265 obj = UseRegisterOrConstant(instr->object()); | 2265 obj = UseRegisterOrConstant(instr->object()); |
2266 } else { | 2266 } else { |
2267 obj = needs_write_barrier_for_map | 2267 obj = needs_write_barrier_for_map |
2268 ? UseRegister(instr->object()) | 2268 ? UseRegister(instr->object()) |
2269 : UseRegisterAtStart(instr->object()); | 2269 : UseRegisterAtStart(instr->object()); |
2270 } | 2270 } |
2271 | 2271 |
2272 bool can_be_constant = instr->value()->IsConstant() && | 2272 bool can_be_constant = instr->value()->IsConstant() && |
2273 HConstant::cast(instr->value())->NotInNewSpace() && | 2273 HConstant::cast(instr->value())->NotInNewSpace() && |
2274 !(FLAG_track_double_fields && instr->field_representation().IsDouble()); | 2274 !instr->field_representation().IsDouble(); |
2275 | 2275 |
2276 LOperand* val; | 2276 LOperand* val; |
2277 if (instr->field_representation().IsInteger8() || | 2277 if (instr->field_representation().IsInteger8() || |
2278 instr->field_representation().IsUInteger8()) { | 2278 instr->field_representation().IsUInteger8()) { |
2279 // mov_b requires a byte register (i.e. any of eax, ebx, ecx, edx). | 2279 // mov_b requires a byte register (i.e. any of eax, ebx, ecx, edx). |
2280 // Just force the value to be in eax and we're safe here. | 2280 // Just force the value to be in eax and we're safe here. |
2281 val = UseFixed(instr->value(), eax); | 2281 val = UseFixed(instr->value(), eax); |
2282 } else if (needs_write_barrier) { | 2282 } else if (needs_write_barrier) { |
2283 val = UseTempRegister(instr->value()); | 2283 val = UseTempRegister(instr->value()); |
2284 } else if (can_be_constant) { | 2284 } else if (can_be_constant) { |
2285 val = UseRegisterOrConstant(instr->value()); | 2285 val = UseRegisterOrConstant(instr->value()); |
2286 } else if (FLAG_track_fields && instr->field_representation().IsSmi()) { | 2286 } else if (instr->field_representation().IsSmi()) { |
2287 val = UseTempRegister(instr->value()); | 2287 val = UseTempRegister(instr->value()); |
2288 } else if (FLAG_track_double_fields && | 2288 } else if (instr->field_representation().IsDouble()) { |
2289 instr->field_representation().IsDouble()) { | |
2290 val = UseRegisterAtStart(instr->value()); | 2289 val = UseRegisterAtStart(instr->value()); |
2291 } else { | 2290 } else { |
2292 val = UseRegister(instr->value()); | 2291 val = UseRegister(instr->value()); |
2293 } | 2292 } |
2294 | 2293 |
2295 // We only need a scratch register if we have a write barrier or we | 2294 // We only need a scratch register if we have a write barrier or we |
2296 // have a store into the properties array (not in-object-property). | 2295 // have a store into the properties array (not in-object-property). |
2297 LOperand* temp = (!is_in_object || needs_write_barrier || | 2296 LOperand* temp = (!is_in_object || needs_write_barrier || |
2298 needs_write_barrier_for_map) ? TempRegister() : NULL; | 2297 needs_write_barrier_for_map) ? TempRegister() : NULL; |
2299 | 2298 |
2300 // We need a temporary register for write barrier of the map field. | 2299 // We need a temporary register for write barrier of the map field. |
2301 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL; | 2300 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL; |
2302 | 2301 |
2303 LStoreNamedField* result = | 2302 LStoreNamedField* result = |
2304 new(zone()) LStoreNamedField(obj, val, temp, temp_map); | 2303 new(zone()) LStoreNamedField(obj, val, temp, temp_map); |
2305 if (FLAG_track_heap_object_fields && | 2304 if (instr->field_representation().IsHeapObject()) { |
2306 instr->field_representation().IsHeapObject()) { | |
2307 if (!instr->value()->type().IsHeapObject()) { | 2305 if (!instr->value()->type().IsHeapObject()) { |
2308 return AssignEnvironment(result); | 2306 return AssignEnvironment(result); |
2309 } | 2307 } |
2310 } | 2308 } |
2311 return result; | 2309 return result; |
2312 } | 2310 } |
2313 | 2311 |
2314 | 2312 |
2315 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 2313 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
2316 LOperand* context = UseFixed(instr->context(), esi); | 2314 LOperand* context = UseFixed(instr->context(), esi); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2590 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2588 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2591 LOperand* object = UseRegister(instr->object()); | 2589 LOperand* object = UseRegister(instr->object()); |
2592 LOperand* index = UseTempRegister(instr->index()); | 2590 LOperand* index = UseTempRegister(instr->index()); |
2593 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2591 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2594 } | 2592 } |
2595 | 2593 |
2596 | 2594 |
2597 } } // namespace v8::internal | 2595 } } // namespace v8::internal |
2598 | 2596 |
2599 #endif // V8_TARGET_ARCH_IA32 | 2597 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |