Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_RAW_OBJECT_H_ | 5 #ifndef VM_RAW_OBJECT_H_ |
| 6 #define VM_RAW_OBJECT_H_ | 6 #define VM_RAW_OBJECT_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/atomic.h" | 9 #include "vm/atomic.h" |
| 10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 490 | 490 |
| 491 // All writes to heap objects should ultimately pass through one of the | 491 // All writes to heap objects should ultimately pass through one of the |
| 492 // methods below or their counterparts in Object, to ensure that the | 492 // methods below or their counterparts in Object, to ensure that the |
| 493 // write barrier is correctly applied. | 493 // write barrier is correctly applied. |
| 494 | 494 |
| 495 template<typename type> | 495 template<typename type> |
| 496 void StorePointer(type const* addr, type value) { | 496 void StorePointer(type const* addr, type value) { |
| 497 #if defined(DEBUG) | 497 #if defined(DEBUG) |
| 498 ValidateOverwrittenPointer(*addr); | 498 ValidateOverwrittenPointer(*addr); |
| 499 #endif // DEBUG | 499 #endif // DEBUG |
| 500 // Ensure that this object contains the addr. | |
| 501 ASSERT(Contains(reinterpret_cast<uword>(addr))); | |
|
koda
2015/01/28 18:52:33
This is fine for now; it's unlikely to catch any b
| |
| 502 VerifiedMemory::Write(const_cast<type*>(addr), value); | 500 VerifiedMemory::Write(const_cast<type*>(addr), value); |
| 503 // Filter stores based on source and target. | 501 // Filter stores based on source and target. |
| 504 if (!value->IsHeapObject()) return; | 502 if (!value->IsHeapObject()) return; |
| 505 if (value->IsNewObject() && this->IsOldObject() && | 503 if (value->IsNewObject() && this->IsOldObject() && |
| 506 !this->IsRemembered()) { | 504 !this->IsRemembered()) { |
| 507 this->SetRememberedBit(); | 505 this->SetRememberedBit(); |
| 508 Isolate::Current()->store_buffer()->AddObject(this); | 506 Isolate::Current()->store_buffer()->AddObject(this); |
| 509 } | 507 } |
| 510 } | 508 } |
| 511 | 509 |
| (...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2159 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2157 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
| 2160 kTypedDataInt8ArrayViewCid + 15); | 2158 kTypedDataInt8ArrayViewCid + 15); |
| 2161 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2159 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
| 2162 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2160 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
| 2163 return (kNullCid - kTypedDataInt8ArrayCid); | 2161 return (kNullCid - kTypedDataInt8ArrayCid); |
| 2164 } | 2162 } |
| 2165 | 2163 |
| 2166 } // namespace dart | 2164 } // namespace dart |
| 2167 | 2165 |
| 2168 #endif // VM_RAW_OBJECT_H_ | 2166 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |