[vm] Update lingering references to RawObject.
TEST=ci Change-Id: If01ff0f7a9b10dc4e6f6d3139bd421df9ecc9855 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316528 Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
committed by
Commit Queue
parent
5cf55de409
commit
f2611b7c8e
+2
-2
@@ -84,7 +84,7 @@ With the mutator and marker running concurrently, the mutator could write a poin
|
||||
The barrier is equivalent to
|
||||
|
||||
```c++
|
||||
StorePoint(RawObject* source, RawObject** slot, RawObject* target) {
|
||||
StorePointer(ObjectPtr source, ObjectPtr* slot, ObjectPtr target) {
|
||||
*slot = target;
|
||||
if (target->IsSmi()) return;
|
||||
if (source->IsOldObject() && !source->IsRemembered() && target->IsNewObject()) {
|
||||
@@ -116,7 +116,7 @@ static constexpr intptr_t kBarrierOverlapShift = 2;
|
||||
COMPILE_ASSERT(kOldAndNotMarkedBit + kBarrierOverlapShift == kOldBit);
|
||||
COMPILE_ASSERT(kNewBit + kBarrierOverlapShift == kOldAndNotRememberedBit);
|
||||
|
||||
StorePointer(RawObject* source, RawObject** slot, RawObject* target) {
|
||||
StorePointer(ObjectPtr source, ObjectPtr* slot, ObjectPtr target) {
|
||||
*slot = target;
|
||||
if (target->IsSmi()) return;
|
||||
if ((source->header() >> kBarrierOverlapShift) &&
|
||||
|
||||
@@ -126,7 +126,7 @@ DEFINE_NATIVE_ENTRY(SendPort_sendInternal_, 0, 2) {
|
||||
class UntaggedObjectPtrSetTraits {
|
||||
public:
|
||||
static bool ReportStats() { return false; }
|
||||
static const char* Name() { return "RawObjectPtrSetTraits"; }
|
||||
static const char* Name() { return "UntaggedObjectPtrSetTraits"; }
|
||||
|
||||
static bool IsMatch(const ObjectPtr a, const ObjectPtr b) { return a == b; }
|
||||
|
||||
|
||||
@@ -550,10 +550,11 @@ class Place : public ValueObject {
|
||||
const intptr_t index_value = Smi::Cast(index_constant->value()).Value();
|
||||
const ElementSize size = ElementSizeFor(class_id);
|
||||
const bool is_typed_access = (size != kNoSize);
|
||||
// Indexing into [RawTypedDataView]/[RawExternalTypedData happens via a
|
||||
// untagged load of the `_data` field (which points to C memory).
|
||||
// Indexing into [UntaggedTypedDataView]/[UntaggedExternalTypedData
|
||||
// happens via a untagged load of the `_data` field (which points to C
|
||||
// memory).
|
||||
//
|
||||
// Indexing into dart:ffi's [RawPointer] happens via loading of the
|
||||
// Indexing into dart:ffi's [UntaggedPointer] happens via loading of the
|
||||
// `c_memory_address_`, converting it to an integer, doing some arithmetic
|
||||
// and finally using IntConverterInstr to convert to a untagged
|
||||
// representation.
|
||||
|
||||
@@ -230,7 +230,7 @@ class Slot : public ZoneAllocated {
|
||||
// A slot used to store type arguments.
|
||||
kTypeArguments,
|
||||
|
||||
// A slot at a specific [index] in a [RawTypeArgument] vector.
|
||||
// A slot at a specific [index] in a [UntaggedTypeArgument] vector.
|
||||
kTypeArgumentsIndex,
|
||||
|
||||
// A slot corresponding to an array element at given offset.
|
||||
@@ -260,7 +260,7 @@ class Slot : public ZoneAllocated {
|
||||
// so disambiguating type arguments fields does not improve alias analysis.
|
||||
static const Slot& GetTypeArgumentsSlotFor(Thread* thread, const Class& cls);
|
||||
|
||||
// Returns a slot at a specific [index] in a [RawTypeArgument] vector.
|
||||
// Returns a slot at a specific [index] in a [UntaggedTypeArgument] vector.
|
||||
static const Slot& GetTypeArgumentsIndexSlot(Thread* thread, intptr_t index);
|
||||
|
||||
// Returns a slot corresponding to an array element at [offset_in_bytes].
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
namespace dart {
|
||||
|
||||
// This class handles translation of certain RawObjects to CObjects for
|
||||
// This class handles translation of certain ObjectPtrs to CObjects for
|
||||
// NativeMessageHandlers.
|
||||
//
|
||||
// TODO(zra): Expand to support not only null, but also other VM heap objects
|
||||
|
||||
@@ -637,7 +637,7 @@ typedef DeoptIntInstr<DeoptInstr::kMint,
|
||||
template <DeoptInstr::Kind K,
|
||||
CatchEntryMove::SourceKind slot_kind,
|
||||
typename Type,
|
||||
typename RawObjectType>
|
||||
typename PtrType>
|
||||
class DeoptFpuInstr : public DeoptInstr {
|
||||
public:
|
||||
explicit DeoptFpuInstr(intptr_t source_index) : source_(source_index) {}
|
||||
@@ -651,9 +651,8 @@ class DeoptFpuInstr : public DeoptInstr {
|
||||
|
||||
void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
|
||||
*dest_addr = Smi::RawValue(0);
|
||||
deopt_context->DeferMaterialization(
|
||||
source_.Value<Type>(deopt_context),
|
||||
reinterpret_cast<RawObjectType*>(dest_addr));
|
||||
deopt_context->DeferMaterialization(source_.Value<Type>(deopt_context),
|
||||
reinterpret_cast<PtrType*>(dest_addr));
|
||||
}
|
||||
|
||||
CatchEntryMove ToCatchEntryMove(DeoptContext* deopt_context,
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace dart {
|
||||
#if !defined(PRODUCT)
|
||||
|
||||
DART_EXPORT
|
||||
void _printRawObject(ObjectPtr object) {
|
||||
void _printObjectPtr(ObjectPtr object) {
|
||||
OS::PrintErr("%s\n", Object::Handle(object).ToCString());
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ class ForwardingCorpse {
|
||||
};
|
||||
|
||||
private:
|
||||
// This layout mirrors the layout of RawObject.
|
||||
// This layout mirrors the layout of UntaggedObject.
|
||||
RelaxedAtomic<uword> tags_;
|
||||
RelaxedAtomic<ObjectPtr> target_;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ class FreeListElement {
|
||||
};
|
||||
|
||||
private:
|
||||
// This layout mirrors the layout of RawObject.
|
||||
// This layout mirrors the layout of UntaggedObject.
|
||||
RelaxedAtomic<uword> tags_;
|
||||
RelaxedAtomic<FreeListElement*> next_;
|
||||
|
||||
|
||||
@@ -24,11 +24,11 @@ class Page;
|
||||
class Thread;
|
||||
|
||||
// The class GCMarker is used to mark reachable old generation objects as part
|
||||
// of the mark-sweep collection. The marking bit used is defined in RawObject.
|
||||
// Instances have a lifetime that spans from the beginning of concurrent
|
||||
// marking (or stop-the-world marking) until marking is complete. In particular,
|
||||
// an instance may be created and destroyed on different threads if the isolate
|
||||
// is exited during concurrent marking.
|
||||
// of the mark-sweep collection. The marking bit used is defined in
|
||||
// UntaggedObject. Instances have a lifetime that spans from the beginning of
|
||||
// concurrent marking (or stop-the-world marking) until marking is complete. In
|
||||
// particular, an instance may be created and destroyed on different threads if
|
||||
// the isolate is exited during concurrent marking.
|
||||
class GCMarker {
|
||||
public:
|
||||
GCMarker(IsolateGroup* isolate_group, Heap* heap);
|
||||
|
||||
@@ -55,7 +55,7 @@ class Message {
|
||||
MessageFinalizableData* finalizable_data,
|
||||
Priority priority);
|
||||
|
||||
// Message objects can also carry RawObject pointers for Smis and objects in
|
||||
// Message objects can also carry raw ObjectPtr for Smis and objects in
|
||||
// the VM heap. This is indicated by setting the len_ field to 0.
|
||||
Message(Dart_Port dest_port, ObjectPtr raw_obj, Priority priority);
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ class NativeArguments {
|
||||
friend class NativeEntry;
|
||||
friend class Simulator;
|
||||
|
||||
// Since this function is passed a RawObject directly, we need to be
|
||||
// Since this function is passed an ObjectPtr directly, we need to be
|
||||
// exceedingly careful when we use it. If there are any other side
|
||||
// effects in the statement that may cause GC, it could lead to
|
||||
// bugs.
|
||||
|
||||
@@ -26125,7 +26125,7 @@ TypedDataViewPtr TypedDataBase::ViewFromTo(intptr_t start,
|
||||
}
|
||||
|
||||
const char* TypedDataBase::ToCString() const {
|
||||
// There are no instances of RawTypedDataBase.
|
||||
// There are no instances of UntaggedTypedDataBase.
|
||||
UNREACHABLE();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
+1
-1
@@ -760,7 +760,7 @@ class Object {
|
||||
// Start of field mutator guards.
|
||||
//
|
||||
// All writes to heap objects should ultimately pass through one of the
|
||||
// methods below or their counterparts in RawObject, to ensure that the
|
||||
// methods below or their counterparts in UntaggedObject, to ensure that the
|
||||
// write barrier is correctly applied.
|
||||
|
||||
template <typename type, std::memory_order order = std::memory_order_relaxed>
|
||||
|
||||
@@ -2664,8 +2664,8 @@ class ObjectGraphCopier : public StackResource {
|
||||
Handlify(&fast_object_copy_.fast_forward_map_.raw_expandos_to_rehash_,
|
||||
&slow_object_copy_.slow_forward_map_.expandos_to_rehash_);
|
||||
}
|
||||
template <typename RawType, typename HandleType>
|
||||
void Handlify(GrowableArray<RawType>* from,
|
||||
template <typename PtrType, typename HandleType>
|
||||
void Handlify(GrowableArray<PtrType>* from,
|
||||
GrowableArray<const HandleType*>* to) {
|
||||
const auto length = from->length();
|
||||
if (length > 0) {
|
||||
|
||||
+14
-13
@@ -155,9 +155,9 @@ enum TypedDataElementType {
|
||||
friend class ObjectCopy; \
|
||||
friend class Pass2Visitor;
|
||||
|
||||
// RawObject is the base class of all raw objects; even though it carries the
|
||||
// tags_ field not all raw objects are allocated in the heap and thus cannot
|
||||
// be dereferenced (e.g. RawSmi).
|
||||
// UntaggedObject is the base class of all raw objects; even though it carries
|
||||
// the tags_ field not all raw objects are allocated in the heap and thus cannot
|
||||
// be dereferenced (e.g. UntaggedSmi).
|
||||
class UntaggedObject {
|
||||
public:
|
||||
// The tags field which is a part of the object header uses the following
|
||||
@@ -3026,8 +3026,8 @@ class UntaggedTwoByteString : public UntaggedString {
|
||||
friend class StringSerializationCluster;
|
||||
};
|
||||
|
||||
// Abstract base class for RawTypedData/RawExternalTypedData/RawTypedDataView/
|
||||
// Pointer.
|
||||
// Abstract base class for UntaggedTypedData/UntaggedExternalTypedData/
|
||||
// UntaggedTypedDataView/Pointer.
|
||||
//
|
||||
// TypedData extends this with a length field, while Pointer extends this with
|
||||
// TypeArguments field.
|
||||
@@ -3038,11 +3038,11 @@ class UntaggedPointerBase : public UntaggedInstance {
|
||||
protected:
|
||||
// The contents of [data_] depends on what concrete subclass is used:
|
||||
//
|
||||
// - RawTypedData: Start of the payload.
|
||||
// - RawExternalTypedData: Start of the C-heap payload.
|
||||
// - RawTypedDataView: The [data_] field of the backing store for the view
|
||||
// plus the [offset_in_bytes_] the view has.
|
||||
// - RawPointer: Pointer into C memory (no length specified).
|
||||
// - UntaggedTypedData: Start of the payload.
|
||||
// - UntaggedExternalTypedData: Start of the C-heap payload.
|
||||
// - UntaggedTypedDataView: The [data_] field of the backing store for the
|
||||
// view plus the [offset_in_bytes_] the view has.
|
||||
// - UntaggedPointer: Pointer into C memory (no length specified).
|
||||
//
|
||||
// During allocation or snapshot reading the [data_] can be temporarily
|
||||
// nullptr (which is the case for views which just got created but haven't
|
||||
@@ -3060,7 +3060,8 @@ class UntaggedPointerBase : public UntaggedInstance {
|
||||
RAW_HEAP_OBJECT_IMPLEMENTATION(PointerBase);
|
||||
};
|
||||
|
||||
// Abstract base class for RawTypedData/RawExternalTypedData/RawTypedDataView.
|
||||
// Abstract base class for UntaggedTypedData/UntaggedExternalTypedData/
|
||||
// UntaggedTypedDataView.
|
||||
class UntaggedTypedDataBase : public UntaggedPointerBase {
|
||||
protected:
|
||||
#if defined(DART_COMPRESSED_POINTERS)
|
||||
@@ -3159,13 +3160,13 @@ class UntaggedTypedDataView : public UntaggedTypedDataBase {
|
||||
// The view object must have gotten just initialized.
|
||||
if (data_ != nullptr || RawSmiValue(offset_in_bytes()) != 0 ||
|
||||
RawSmiValue(length()) != 0) {
|
||||
FATAL("RawTypedDataView has invalid inner pointer.");
|
||||
FATAL("TypedDataView has invalid inner pointer.");
|
||||
}
|
||||
} else {
|
||||
const intptr_t offset_in_bytes = RawSmiValue(this->offset_in_bytes());
|
||||
uint8_t* payload = typed_data()->untag()->data_;
|
||||
if ((payload + offset_in_bytes) != data_) {
|
||||
FATAL("RawTypedDataView has invalid inner pointer.");
|
||||
FATAL("TypedDataView has invalid inner pointer.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user