22 ring->SetCapacityAndMaxSerial(capacity, max_serial);
26 EXPECT(ring->IsValidId(
id));
30 EXPECT(!ring->IsValidId(
id));
34 EXPECT_EQ(
id, ring->IdOfIndex(index));
38 EXPECT_EQ(-1, ring->IdOfIndex(index));
125 const char* kScriptChars =
127 " return [1, 2, 3];\n"
132 intptr_t list_length = 0;
137 EXPECT_EQ(3, list_length);
139 Isolate* isolate = thread->isolate();
147 EXPECT(raw_obj->IsNewObject());
150 EXPECT_EQ(0, raw_obj_id1);
152 EXPECT_EQ(raw_obj_id1,
156 EXPECT_EQ(1, raw_obj_id2);
158 EXPECT_EQ(raw_obj_id1,
171 GCTestHelper::CollectNewSpace();
188 EXPECT_EQ(raw_obj_id1,
195 EXPECT_EQ(3, list_length);
200 Isolate* isolate = thread->isolate();
204 intptr_t raw_obj_id1 = -1;
205 intptr_t raw_obj_id2 = -1;
210 EXPECT_EQ(3, str.
Length());
214 EXPECT(raw_obj->IsOldObject());
217 EXPECT_EQ(0, raw_obj_id1);
219 EXPECT_EQ(1, raw_obj_id2);
234 GCTestHelper::CollectOldSpace();
237 EXPECT(raw_object_moved1->IsOneByteString());
240 EXPECT(raw_object_moved2->IsOneByteString());
241 EXPECT_EQ(raw_object_moved1, raw_object_moved2);
256 EXPECT_EQ(obj.
ptr(), obj_lookup);
266 EXPECT_EQ(new_obj.
ptr(), new_obj_lookup);
272 EXPECT_NE(obj.
ptr(), obj_lookup);
static Dart_Handle NewHandle(Thread *thread, ObjectPtr raw)
static ObjectPtr UnwrapHandle(Dart_Handle object)
static Isolate * Current()
ObjectIdRing * EnsureObjectIdRing()
static void ExpectIndexId(ObjectIdRing *ring, intptr_t index, intptr_t id)
static ObjectPtr MakeString(const char *s)
static void ExpectIdIsValid(ObjectIdRing *ring, intptr_t id)
static void ExpectIdIsInvalid(ObjectIdRing *ring, intptr_t id)
static void ExpectString(ObjectPtr obj, const char *s)
static void SetCapacityAndMaxSerial(ObjectIdRing *ring, int32_t capacity, int32_t max_serial)
static void ExpectInvalidIndex(ObjectIdRing *ring, intptr_t index)
static constexpr int32_t kDefaultCapacity
ObjectPtr GetObjectForId(int32_t id, LookupResult *kind)
int32_t GetIdForObject(ObjectPtr raw_obj, IdPolicy policy=kAllocateId)
static ObjectPtr RawCast(ObjectPtr obj)
bool Equals(const String &str) const
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
static StringPtr New(Thread *thread, const char *cstr)
static Dart_Handle LoadTestScript(const char *script, Dart_NativeEntryResolver resolver, const char *lib_uri=RESOLVED_USER_TEST_URI, bool finalize=true, bool allow_compile_errors=false)
static Thread * Current()
static uword ToAddr(const UntaggedObject *raw_obj)
struct _Dart_Handle * Dart_Handle
DART_EXPORT Dart_Handle Dart_Invoke(Dart_Handle target, Dart_Handle name, int number_of_arguments, Dart_Handle *arguments)
ISOLATE_UNIT_TEST_CASE(StackAllocatedDestruction)
TEST_CASE(DirectoryCurrent)
Dart_Handle NewString(const char *str)
DART_EXPORT Dart_Handle Dart_ListLength(Dart_Handle list, intptr_t *len)
DART_EXPORT bool Dart_IsList(Dart_Handle object)
DART_EXPORT bool Dart_IsNull(Dart_Handle object)
#define EXPECT_VALID(handle)