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 3350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3361 CallRuntime(instr->function(), instr->arity(), instr); | 3361 CallRuntime(instr->function(), instr->arity(), instr); |
3362 } | 3362 } |
3363 | 3363 |
3364 | 3364 |
3365 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { | 3365 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
3366 Register object = ToRegister(instr->object()); | 3366 Register object = ToRegister(instr->object()); |
3367 Register value = ToRegister(instr->value()); | 3367 Register value = ToRegister(instr->value()); |
3368 int offset = instr->offset(); | 3368 int offset = instr->offset(); |
3369 | 3369 |
3370 if (!instr->transition().is_null()) { | 3370 if (!instr->transition().is_null()) { |
3371 __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); | 3371 if (!instr->hydrogen()->NeedsWriteBarrierForMap()) { |
| 3372 __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); |
| 3373 } else { |
| 3374 Register temp = ToRegister(instr->TempAt(0)); |
| 3375 Register temp_map = ToRegister(instr->TempAt(1)); |
| 3376 __ mov(temp_map, instr->transition()); |
| 3377 __ mov(FieldOperand(object, HeapObject::kMapOffset), temp_map); |
| 3378 // Update the write barrier for the map field. |
| 3379 __ RecordWriteField(object, |
| 3380 HeapObject::kMapOffset, |
| 3381 temp_map, |
| 3382 temp, |
| 3383 kSaveFPRegs, |
| 3384 OMIT_REMEMBERED_SET, |
| 3385 OMIT_SMI_CHECK); |
| 3386 } |
3372 } | 3387 } |
3373 | 3388 |
3374 // Do the store. | 3389 // Do the store. |
3375 HType type = instr->hydrogen()->value()->type(); | 3390 HType type = instr->hydrogen()->value()->type(); |
3376 SmiCheck check_needed = | 3391 SmiCheck check_needed = |
3377 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 3392 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
3378 if (instr->is_in_object()) { | 3393 if (instr->is_in_object()) { |
3379 __ mov(FieldOperand(object, offset), value); | 3394 __ mov(FieldOperand(object, offset), value); |
3380 if (instr->hydrogen()->NeedsWriteBarrier()) { | 3395 if (instr->hydrogen()->NeedsWriteBarrier()) { |
3381 Register temp = ToRegister(instr->TempAt(0)); | 3396 Register temp = ToRegister(instr->TempAt(0)); |
(...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5080 FixedArray::kHeaderSize - kPointerSize)); | 5095 FixedArray::kHeaderSize - kPointerSize)); |
5081 __ bind(&done); | 5096 __ bind(&done); |
5082 } | 5097 } |
5083 | 5098 |
5084 | 5099 |
5085 #undef __ | 5100 #undef __ |
5086 | 5101 |
5087 } } // namespace v8::internal | 5102 } } // namespace v8::internal |
5088 | 5103 |
5089 #endif // V8_TARGET_ARCH_IA32 | 5104 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |