| Index: dart/runtime/vm/object.h
|
| ===================================================================
|
| --- dart/runtime/vm/object.h (revision 29808)
|
| +++ dart/runtime/vm/object.h (working copy)
|
| @@ -201,6 +201,9 @@
|
| ASSERT(raw() != null()); \
|
| return raw()->ptr(); \
|
| } \
|
| + static intptr_t NextFieldOffset() { \
|
| + return -kWordSize; \
|
| + } \
|
| SNAPSHOT_READER_SUPPORT(object) \
|
| friend class Isolate; \
|
| friend class StackFrame; \
|
| @@ -528,6 +531,11 @@
|
| RawObject* raw_; // The raw object reference.
|
|
|
| private:
|
| + static intptr_t NextFieldOffset() {
|
| + // Indicates this class cannot be extended by dart code.
|
| + return -kWordSize;
|
| + }
|
| +
|
| static void InitializeObject(uword address, intptr_t id, intptr_t size);
|
|
|
| static void RegisterClass(const Class& cls,
|
| @@ -655,7 +663,8 @@
|
| set_next_field_offset_in_words(value_in_bytes / kWordSize);
|
| }
|
| void set_next_field_offset_in_words(intptr_t value) const {
|
| - ASSERT((Utils::IsAligned((value * kWordSize), kObjectAlignment) &&
|
| + ASSERT((value == -1) ||
|
| + (Utils::IsAligned((value * kWordSize), kObjectAlignment) &&
|
| (value == raw_ptr()->instance_size_in_words_)) ||
|
| (!Utils::IsAligned((value * kWordSize), kObjectAlignment) &&
|
| ((value + 1) == raw_ptr()->instance_size_in_words_)));
|
| @@ -1083,6 +1092,7 @@
|
| RawFunction* CreateInvocationDispatcher(const String& target_name,
|
| const Array& args_desc,
|
| RawFunction::Kind kind) const;
|
| +
|
| void CalculateFieldOffsets() const;
|
|
|
| // Initial value for the cached number of type arguments.
|
| @@ -1121,6 +1131,14 @@
|
| const AbstractTypeArguments& other_type_arguments,
|
| Error* bound_error) const;
|
|
|
| + static bool TypeTestNonRecursive(
|
| + const Class& cls,
|
| + TypeTestKind test_kind,
|
| + const AbstractTypeArguments& type_arguments,
|
| + const Class& other,
|
| + const AbstractTypeArguments& other_type_arguments,
|
| + Error* bound_error);
|
| +
|
| FINAL_HEAP_OBJECT_IMPLEMENTATION(Class, Object);
|
| friend class AbstractType;
|
| friend class Instance;
|
| @@ -1144,6 +1162,7 @@
|
| static intptr_t InstanceSize() {
|
| return RoundedAllocationSize(sizeof(RawUnresolvedClass));
|
| }
|
| +
|
| static RawUnresolvedClass* New(const LibraryPrefix& library_prefix,
|
| const String& ident,
|
| intptr_t token_pos);
|
| @@ -1384,6 +1403,7 @@
|
| const AbstractTypeArguments& value) const;
|
| void set_instantiator_type_arguments(
|
| const AbstractTypeArguments& value) const;
|
| +
|
| static RawInstantiatedTypeArguments* New();
|
|
|
| FINAL_HEAP_OBJECT_IMPLEMENTATION(InstantiatedTypeArguments,
|
| @@ -1408,6 +1428,7 @@
|
| private:
|
| void set_patched_class(const Class& value) const;
|
| void set_source_class(const Class& value) const;
|
| +
|
| static RawPatchClass* New();
|
|
|
| FINAL_HEAP_OBJECT_IMPLEMENTATION(PatchClass, Object);
|
| @@ -1859,7 +1880,6 @@
|
| return kind() == RawFunction::kSignatureFunction;
|
| }
|
|
|
| -
|
| static intptr_t InstanceSize() {
|
| return RoundedAllocationSize(sizeof(RawFunction));
|
| }
|
| @@ -1946,6 +1966,7 @@
|
| void set_num_optional_parameters(intptr_t value) const; // Encoded value.
|
| void set_kind_tag(intptr_t value) const;
|
| void set_data(const Object& value) const;
|
| +
|
| static RawFunction* New();
|
|
|
| void BuildSignatureParameters(bool instantiate,
|
| @@ -2212,6 +2233,7 @@
|
| void set_kind_bits(intptr_t value) const {
|
| raw_ptr()->kind_bits_ = static_cast<uint8_t>(value);
|
| }
|
| +
|
| static RawField* New();
|
|
|
| FINAL_HEAP_OBJECT_IMPLEMENTATION(Field, Object);
|
| @@ -2378,6 +2400,7 @@
|
| void set_source(const String& value) const;
|
| void set_kind(RawScript::Kind value) const;
|
| void set_tokens(const TokenStream& value) const;
|
| +
|
| static RawScript* New();
|
|
|
| FINAL_HEAP_OBJECT_IMPLEMENTATION(Script, Object);
|
| @@ -2592,6 +2615,7 @@
|
| private:
|
| static const int kInitialImportsCapacity = 4;
|
| static const int kImportsCapacityIncrement = 8;
|
| +
|
| static RawLibrary* New();
|
|
|
| void set_num_imports(intptr_t value) const {
|
| @@ -2654,6 +2678,7 @@
|
| void set_name(const String& value) const;
|
| void set_imports(const Array& value) const;
|
| void set_num_imports(intptr_t value) const;
|
| +
|
| static RawLibraryPrefix* New();
|
|
|
| FINAL_HEAP_OBJECT_IMPLEMENTATION(LibraryPrefix, Object);
|
| @@ -2679,6 +2704,7 @@
|
| static RawNamespace* New(const Library& library,
|
| const Array& show_names,
|
| const Array& hide_names);
|
| +
|
| private:
|
| static RawNamespace* New();
|
|
|
| @@ -2988,6 +3014,7 @@
|
| static const intptr_t kMaxHandlers = 1024 * 1024;
|
|
|
| void set_handled_types_data(const Array& value) const;
|
| +
|
| FINAL_HEAP_OBJECT_IMPLEMENTATION(ExceptionHandlers, Object);
|
| friend class Class;
|
| };
|
| @@ -3745,6 +3772,7 @@
|
|
|
| private:
|
| void set_message(const String& message) const;
|
| +
|
| static RawApiError* New();
|
|
|
| FINAL_HEAP_OBJECT_IMPLEMENTATION(ApiError, Error);
|
| @@ -3770,6 +3798,7 @@
|
|
|
| private:
|
| void set_message(const String& message) const;
|
| +
|
| static RawLanguageError* New();
|
|
|
| FINAL_HEAP_OBJECT_IMPLEMENTATION(LanguageError, Error);
|
| @@ -3913,10 +3942,16 @@
|
| }
|
| bool IsValidFieldOffset(int offset) const;
|
|
|
| + static intptr_t NextFieldOffset() {
|
| + return sizeof(RawInstance);
|
| + }
|
| +
|
| // TODO(iposva): Determine if this gets in the way of Smi.
|
| HEAP_OBJECT_IMPLEMENTATION(Instance, Object);
|
| friend class Class;
|
| friend class Closure;
|
| + friend class SnapshotWriter;
|
| + friend class StubCode;
|
| friend class TypedDataView;
|
| };
|
|
|
| @@ -4007,8 +4042,8 @@
|
| // Check if this type represents the 'Float32x4' type.
|
| bool IsFloat32x4Type() const;
|
|
|
| - // Check if this type represents the 'Uint32x4' type.
|
| - bool IsUint32x4Type() const;
|
| + // Check if this type represents the 'Int32x4' type.
|
| + bool IsInt32x4Type() const;
|
|
|
| // Check if this type represents the 'num' type.
|
| bool IsNumberType() const;
|
| @@ -4129,8 +4164,8 @@
|
| // The 'Float32x4' type.
|
| static RawType* Float32x4();
|
|
|
| - // The 'Uint32x4' type.
|
| - static RawType* Uint32x4();
|
| + // The 'Int32x4' type.
|
| + static RawType* Int32x4();
|
|
|
| // The 'num' type.
|
| static RawType* Number();
|
| @@ -4225,6 +4260,7 @@
|
| void set_name(const String& value) const;
|
| void set_token_pos(intptr_t token_pos) const;
|
| void set_type_state(int8_t state) const;
|
| +
|
| static RawTypeParameter* New();
|
|
|
| FINAL_HEAP_OBJECT_IMPLEMENTATION(TypeParameter, AbstractType);
|
| @@ -4478,11 +4514,17 @@
|
| }
|
|
|
| private:
|
| + static intptr_t NextFieldOffset() {
|
| + // Indicates this class cannot be extended by dart code.
|
| + return -kWordSize;
|
| + }
|
| +
|
| static intptr_t ValueFromRaw(uword raw_value) {
|
| intptr_t value = raw_value;
|
| ASSERT((value & kSmiTagMask) == kSmiTag);
|
| return (value >> kSmiTagShift);
|
| }
|
| +
|
| static cpp_vtable handle_vtable_;
|
|
|
| Smi() : Integer() {}
|
| @@ -5201,6 +5243,11 @@
|
| intptr_t tags,
|
| Snapshot::Kind kind);
|
|
|
| + static intptr_t NextFieldOffset() {
|
| + // Indicates this class cannot be extended by dart code.
|
| + return -kWordSize;
|
| + }
|
| +
|
| friend class Class;
|
| friend class String;
|
| friend class SnapshotReader;
|
| @@ -5267,6 +5314,11 @@
|
| intptr_t tags,
|
| Snapshot::Kind kind);
|
|
|
| + static intptr_t NextFieldOffset() {
|
| + // Indicates this class cannot be extended by dart code.
|
| + return -kWordSize;
|
| + }
|
| +
|
| friend class Class;
|
| friend class String;
|
| friend class SnapshotReader;
|
| @@ -5436,6 +5488,11 @@
|
| }
|
|
|
| private:
|
| + static intptr_t NextFieldOffset() {
|
| + // Indicates this class cannot be extended by dart code.
|
| + return -kWordSize;
|
| + }
|
| +
|
| static RawImmutableArray* raw(const Array& array) {
|
| return reinterpret_cast<RawImmutableArray*>(array.raw());
|
| }
|
| @@ -5594,36 +5651,36 @@
|
| };
|
|
|
|
|
| -class Uint32x4 : public Instance {
|
| +class Int32x4 : public Instance {
|
| public:
|
| - static RawUint32x4* New(uint32_t value0, uint32_t value1, uint32_t value2,
|
| - uint32_t value3, Heap::Space space = Heap::kNew);
|
| - static RawUint32x4* New(simd128_value_t value,
|
| + static RawInt32x4* New(int32_t value0, int32_t value1, int32_t value2,
|
| + int32_t value3, Heap::Space space = Heap::kNew);
|
| + static RawInt32x4* New(simd128_value_t value,
|
| Heap::Space space = Heap::kNew);
|
|
|
| - uint32_t x() const;
|
| - uint32_t y() const;
|
| - uint32_t z() const;
|
| - uint32_t w() const;
|
| + int32_t x() const;
|
| + int32_t y() const;
|
| + int32_t z() const;
|
| + int32_t w() const;
|
|
|
| - void set_x(uint32_t x) const;
|
| - void set_y(uint32_t y) const;
|
| - void set_z(uint32_t z) const;
|
| - void set_w(uint32_t w) const;
|
| + void set_x(int32_t x) const;
|
| + void set_y(int32_t y) const;
|
| + void set_z(int32_t z) const;
|
| + void set_w(int32_t w) const;
|
|
|
| simd128_value_t value() const;
|
| void set_value(simd128_value_t value) const;
|
|
|
| static intptr_t InstanceSize() {
|
| - return RoundedAllocationSize(sizeof(RawUint32x4));
|
| + return RoundedAllocationSize(sizeof(RawInt32x4));
|
| }
|
|
|
| static intptr_t value_offset() {
|
| - return OFFSET_OF(RawUint32x4, value_);
|
| + return OFFSET_OF(RawInt32x4, value_);
|
| }
|
|
|
| private:
|
| - FINAL_HEAP_OBJECT_IMPLEMENTATION(Uint32x4, Instance);
|
| + FINAL_HEAP_OBJECT_IMPLEMENTATION(Int32x4, Instance);
|
| friend class Class;
|
| };
|
|
|
| @@ -5675,7 +5732,7 @@
|
| TYPED_GETTER_SETTER(Float32, float)
|
| TYPED_GETTER_SETTER(Float64, double)
|
| TYPED_GETTER_SETTER(Float32x4, simd128_value_t)
|
| - TYPED_GETTER_SETTER(Uint32x4, simd128_value_t)
|
| + TYPED_GETTER_SETTER(Int32x4, simd128_value_t)
|
|
|
| #undef TYPED_GETTER_SETTER
|
|
|
| @@ -5809,7 +5866,7 @@
|
| TYPED_GETTER_SETTER(Float32, float)
|
| TYPED_GETTER_SETTER(Float64, double)
|
| TYPED_GETTER_SETTER(Float32x4, simd128_value_t)
|
| - TYPED_GETTER_SETTER(Uint32x4, simd128_value_t);
|
| + TYPED_GETTER_SETTER(Int32x4, simd128_value_t);
|
|
|
| #undef TYPED_GETTER_SETTER
|
|
|
| @@ -5907,7 +5964,7 @@
|
| }
|
|
|
| static intptr_t NumberOfFields() {
|
| - return (kLengthOffset - kTypeArguments);
|
| + return kLengthOffset;
|
| }
|
|
|
| static intptr_t data_offset() {
|
| @@ -5931,10 +5988,9 @@
|
|
|
| private:
|
| enum {
|
| - kTypeArguments = 1,
|
| - kDataOffset = 2,
|
| - kOffsetInBytesOffset = 3,
|
| - kLengthOffset = 4,
|
| + kDataOffset = 1,
|
| + kOffsetInBytesOffset = 2,
|
| + kLengthOffset = 3,
|
| };
|
| };
|
|
|
| @@ -6007,6 +6063,10 @@
|
| const Context& value) {
|
| closure.StorePointer(ContextAddr(closure), value.raw());
|
| }
|
| + static intptr_t NextFieldOffset() {
|
| + // Indicates this class cannot be extended by dart code.
|
| + return -kWordSize;
|
| + }
|
|
|
| friend class Class;
|
| };
|
|
|