| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 4006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4017 // context register, so we check that none of the clobbered | 4017 // context register, so we check that none of the clobbered |
| 4018 // registers are cp. | 4018 // registers are cp. |
| 4019 ASSERT(!address.is(cp) && !value.is(cp)); | 4019 ASSERT(!address.is(cp) && !value.is(cp)); |
| 4020 | 4020 |
| 4021 if (emit_debug_code()) { | 4021 if (emit_debug_code()) { |
| 4022 Ldr(Tmp0(), MemOperand(address)); | 4022 Ldr(Tmp0(), MemOperand(address)); |
| 4023 Cmp(Tmp0(), value); | 4023 Cmp(Tmp0(), value); |
| 4024 Check(eq, kWrongAddressOrValuePassedToRecordWrite); | 4024 Check(eq, kWrongAddressOrValuePassedToRecordWrite); |
| 4025 } | 4025 } |
| 4026 | 4026 |
| 4027 // Count number of write barriers in generated code. |
| 4028 isolate()->counters()->write_barriers_static()->Increment(); |
| 4029 // TODO(mstarzinger): Dynamic counter missing. |
| 4030 |
| 4031 // First, check if a write barrier is even needed. The tests below |
| 4032 // catch stores of smis and stores into the young generation. |
| 4027 Label done; | 4033 Label done; |
| 4028 | 4034 |
| 4029 if (smi_check == INLINE_SMI_CHECK) { | 4035 if (smi_check == INLINE_SMI_CHECK) { |
| 4030 ASSERT_EQ(0, kSmiTag); | 4036 ASSERT_EQ(0, kSmiTag); |
| 4031 JumpIfSmi(value, &done); | 4037 JumpIfSmi(value, &done); |
| 4032 } | 4038 } |
| 4033 | 4039 |
| 4034 CheckPageFlagClear(value, | 4040 CheckPageFlagClear(value, |
| 4035 value, // Used as scratch. | 4041 value, // Used as scratch. |
| 4036 MemoryChunk::kPointersToHereAreInterestingMask, | 4042 MemoryChunk::kPointersToHereAreInterestingMask, |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4830 } | 4836 } |
| 4831 } | 4837 } |
| 4832 | 4838 |
| 4833 | 4839 |
| 4834 #undef __ | 4840 #undef __ |
| 4835 | 4841 |
| 4836 | 4842 |
| 4837 } } // namespace v8::internal | 4843 } } // namespace v8::internal |
| 4838 | 4844 |
| 4839 #endif // V8_TARGET_ARCH_A64 | 4845 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |