Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: runtime/vm/object.h

Issue 2178693002: Revert "Add new atomic operations and use them in two places." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/atomic_win.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 // 639 //
640 // All writes to heap objects should ultimately pass through one of the 640 // All writes to heap objects should ultimately pass through one of the
641 // methods below or their counterparts in RawObject, to ensure that the 641 // methods below or their counterparts in RawObject, to ensure that the
642 // write barrier is correctly applied. 642 // write barrier is correctly applied.
643 643
644 template<typename type> 644 template<typename type>
645 void StorePointer(type const* addr, type value) const { 645 void StorePointer(type const* addr, type value) const {
646 raw()->StorePointer(addr, value); 646 raw()->StorePointer(addr, value);
647 } 647 }
648 648
649 template<typename type>
650 void AtomicStorePointer(type const* addr, type value) const {
651 raw()->AtomicStorePointer(addr, value);
652 }
653
654 // Store a range of pointers [from, from + count) into [to, to + count). 649 // Store a range of pointers [from, from + count) into [to, to + count).
655 // TODO(koda): Use this to fix Object::Clone's broken store buffer logic. 650 // TODO(koda): Use this to fix Object::Clone's broken store buffer logic.
656 void StorePointers(RawObject* const* to, 651 void StorePointers(RawObject* const* to,
657 RawObject* const* from, 652 RawObject* const* from,
658 intptr_t count) { 653 intptr_t count) {
659 ASSERT(Contains(reinterpret_cast<uword>(to))); 654 ASSERT(Contains(reinterpret_cast<uword>(to)));
660 if (raw()->IsNewObject()) { 655 if (raw()->IsNewObject()) {
661 memmove(const_cast<RawObject**>(to), from, count * kWordSize); 656 memmove(const_cast<RawObject**>(to), from, count * kWordSize);
662 } else { 657 } else {
663 for (intptr_t i = 0; i < count; ++i) { 658 for (intptr_t i = 0; i < count; ++i) {
(...skipping 7999 matching lines...) Expand 10 before | Expand all | Expand 10 after
8663 8658
8664 inline void TypeArguments::SetHash(intptr_t value) const { 8659 inline void TypeArguments::SetHash(intptr_t value) const {
8665 // This is only safe because we create a new Smi, which does not cause 8660 // This is only safe because we create a new Smi, which does not cause
8666 // heap allocation. 8661 // heap allocation.
8667 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8662 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8668 } 8663 }
8669 8664
8670 } // namespace dart 8665 } // namespace dart
8671 8666
8672 #endif // VM_OBJECT_H_ 8667 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/atomic_win.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698