Skip to content

Commit e2b88ee

Browse files
rmacnak-googlecommit-bot@chromium.org
authored andcommitted
[vm] Fix gcc build.
TEST=local build Change-Id: Ia4c28bda4b353e9f353ddbbf854df085adf831c1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175562 Reviewed-by: Liam Appelbe <liama@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
1 parent fc80294 commit e2b88ee

File tree

2 files changed

+32
-41
lines changed

2 files changed

+32
-41
lines changed

runtime/vm/raw_object.h

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,38 @@ class ObjectLayout {
568568
}
569569
}
570570

571+
template <typename type, std::memory_order order = std::memory_order_relaxed>
572+
void StoreArrayPointer(type const* addr, type value) {
573+
reinterpret_cast<std::atomic<type>*>(const_cast<type*>(addr))
574+
->store(value, order);
575+
if (value->IsHeapObject()) {
576+
CheckArrayPointerStore(addr, value, Thread::Current());
577+
}
578+
}
579+
580+
template <typename type>
581+
void StoreArrayPointer(type const* addr, type value, Thread* thread) {
582+
*const_cast<type*>(addr) = value;
583+
if (value->IsHeapObject()) {
584+
CheckArrayPointerStore(addr, value, thread);
585+
}
586+
}
587+
588+
template <typename type, std::memory_order order = std::memory_order_relaxed>
589+
type LoadSmi(type const* addr) const {
590+
return reinterpret_cast<std::atomic<type>*>(const_cast<type*>(addr))
591+
->load(order);
592+
}
593+
// Use for storing into an explicitly Smi-typed field of an object
594+
// (i.e., both the previous and new value are Smis).
595+
template <std::memory_order order = std::memory_order_relaxed>
596+
void StoreSmi(SmiPtr const* addr, SmiPtr value) {
597+
// Can't use Contains, as array length is initialized through this method.
598+
ASSERT(reinterpret_cast<uword>(addr) >= ObjectLayout::ToAddr(this));
599+
reinterpret_cast<std::atomic<SmiPtr>*>(const_cast<SmiPtr*>(addr))
600+
->store(value, order);
601+
}
602+
571603
private:
572604
DART_FORCE_INLINE
573605
void CheckHeapPointerStore(ObjectPtr value, Thread* thread) {
@@ -597,23 +629,6 @@ class ObjectLayout {
597629
}
598630
}
599631

600-
template <typename type, std::memory_order order = std::memory_order_relaxed>
601-
void StoreArrayPointer(type const* addr, type value) {
602-
reinterpret_cast<std::atomic<type>*>(const_cast<type*>(addr))
603-
->store(value, order);
604-
if (value->IsHeapObject()) {
605-
CheckArrayPointerStore(addr, value, Thread::Current());
606-
}
607-
}
608-
609-
template <typename type>
610-
void StoreArrayPointer(type const* addr, type value, Thread* thread) {
611-
*const_cast<type*>(addr) = value;
612-
if (value->IsHeapObject()) {
613-
CheckArrayPointerStore(addr, value, thread);
614-
}
615-
}
616-
617632
template <typename type>
618633
DART_FORCE_INLINE void CheckArrayPointerStore(type const* addr,
619634
ObjectPtr value,
@@ -650,26 +665,9 @@ class ObjectLayout {
650665
}
651666
}
652667

653-
protected:
654-
template <typename type, std::memory_order order = std::memory_order_relaxed>
655-
type LoadSmi(type const* addr) const {
656-
return reinterpret_cast<std::atomic<type>*>(const_cast<type*>(addr))
657-
->load(order);
658-
}
659-
// Use for storing into an explicitly Smi-typed field of an object
660-
// (i.e., both the previous and new value are Smis).
661-
template <std::memory_order order = std::memory_order_relaxed>
662-
void StoreSmi(SmiPtr const* addr, SmiPtr value) {
663-
// Can't use Contains, as array length is initialized through this method.
664-
ASSERT(reinterpret_cast<uword>(addr) >= ObjectLayout::ToAddr(this));
665-
reinterpret_cast<std::atomic<SmiPtr>*>(const_cast<SmiPtr*>(addr))
666-
->store(value, order);
667-
}
668-
669668
friend class StoreBufferUpdateVisitor; // RememberCard
670669
void RememberCard(ObjectPtr const* slot);
671670

672-
private:
673671
friend class Array;
674672
friend class ByteBuffer;
675673
friend class CidRewriteVisitor;

runtime/vm/source_report.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -634,13 +634,6 @@ void SourceReport::CollectConstConstructorCoverageFromScripts(
634634
// Now output the wanted constant coverage.
635635
for (intptr_t i = 0; i < local_script_table_entries->length(); i++) {
636636
const Script* script = local_script_table_entries->At(i)->script;
637-
bool script_ok = true;
638-
if (script_ != NULL && !script_->IsNull()) {
639-
if (script->raw() != script_->raw()) {
640-
// This is the wrong script.
641-
script_ok = false;
642-
}
643-
}
644637

645638
// Whether we want *this* script or not we need to look at the constant
646639
// constructor coverage. Any of those could be in a script we *do* want.

0 commit comments

Comments
 (0)