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 3300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3311 CallRuntime(instr->function(), instr->arity(), instr); | 3311 CallRuntime(instr->function(), instr->arity(), instr); |
3312 } | 3312 } |
3313 | 3313 |
3314 | 3314 |
3315 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { | 3315 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
3316 Register object = ToRegister(instr->object()); | 3316 Register object = ToRegister(instr->object()); |
3317 Register value = ToRegister(instr->value()); | 3317 Register value = ToRegister(instr->value()); |
3318 int offset = instr->offset(); | 3318 int offset = instr->offset(); |
3319 | 3319 |
3320 if (!instr->transition().is_null()) { | 3320 if (!instr->transition().is_null()) { |
3321 __ Move(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); | 3321 if (!instr->hydrogen()->NeedsWriteBarrierForMap()) { |
| 3322 __ Move(FieldOperand(object, HeapObject::kMapOffset), |
| 3323 instr->transition()); |
| 3324 } else { |
| 3325 Register temp = ToRegister(instr->TempAt(0)); |
| 3326 __ Move(kScratchRegister, instr->transition()); |
| 3327 __ movq(FieldOperand(object, HeapObject::kMapOffset), kScratchRegister); |
| 3328 // Update the write barrier for the map field. |
| 3329 __ RecordWriteField(object, |
| 3330 HeapObject::kMapOffset, |
| 3331 kScratchRegister, |
| 3332 temp, |
| 3333 kSaveFPRegs, |
| 3334 OMIT_REMEMBERED_SET, |
| 3335 OMIT_SMI_CHECK); |
| 3336 } |
3322 } | 3337 } |
3323 | 3338 |
3324 // Do the store. | 3339 // Do the store. |
3325 HType type = instr->hydrogen()->value()->type(); | 3340 HType type = instr->hydrogen()->value()->type(); |
3326 SmiCheck check_needed = | 3341 SmiCheck check_needed = |
3327 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 3342 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
3328 if (instr->is_in_object()) { | 3343 if (instr->is_in_object()) { |
3329 __ movq(FieldOperand(object, offset), value); | 3344 __ movq(FieldOperand(object, offset), value); |
3330 if (instr->hydrogen()->NeedsWriteBarrier()) { | 3345 if (instr->hydrogen()->NeedsWriteBarrier()) { |
3331 Register temp = ToRegister(instr->TempAt(0)); | 3346 Register temp = ToRegister(instr->TempAt(0)); |
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4879 FixedArray::kHeaderSize - kPointerSize)); | 4894 FixedArray::kHeaderSize - kPointerSize)); |
4880 __ bind(&done); | 4895 __ bind(&done); |
4881 } | 4896 } |
4882 | 4897 |
4883 | 4898 |
4884 #undef __ | 4899 #undef __ |
4885 | 4900 |
4886 } } // namespace v8::internal | 4901 } } // namespace v8::internal |
4887 | 4902 |
4888 #endif // V8_TARGET_ARCH_X64 | 4903 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |