File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -304,7 +304,7 @@ void Thread::AssertEmptyStackInvariants() {
304
304
void Thread::AssertEmptyThreadInvariants () {
305
305
AssertEmptyStackInvariants ();
306
306
307
- ASSERT (top_ == 0 );
307
+ ASSERT (top () == 0 );
308
308
ASSERT (end_ == 0 );
309
309
ASSERT (true_end_ == 0 );
310
310
ASSERT (isolate_ == nullptr );
Original file line number Diff line number Diff line change @@ -720,10 +720,10 @@ class Thread : public ThreadState {
720
720
// TLAB and end() is the chosen sampling boundary for the thread.
721
721
//
722
722
// When the heap sampling profiler is disabled, true_end() == end().
723
- uword top () const { return top_; }
723
+ uword top () const { return top_. load (std::memory_order_relaxed) ; }
724
724
uword end () const { return end_; }
725
725
uword true_end () const { return true_end_; }
726
- void set_top (uword top) { top_ = top; }
726
+ void set_top (uword top) { top_. store ( top, std::memory_order_relaxed) ; }
727
727
void set_end (uword end) { end_ = end; }
728
728
void set_true_end (uword true_end) { true_end_ = true_end; }
729
729
static intptr_t top_offset () { return OFFSET_OF (Thread, top_); }
@@ -1267,7 +1267,7 @@ class Thread : public ThreadState {
1267
1267
#if defined(DART_COMPRESSED_POINTERS)
1268
1268
uword heap_base_ = 0 ;
1269
1269
#endif
1270
- uword top_ = 0 ;
1270
+ std::atomic< uword> top_ = 0 ;
1271
1271
uword end_ = 0 ;
1272
1272
const uword* dispatch_table_array_ = nullptr ;
1273
1273
ObjectPtr* field_table_values_ = nullptr ;
You can’t perform that action at this time.
0 commit comments