Version 2.10.0-133.0.dev
Merge commit '13aaaae1b2997b0a80b6cf33616045c797c999f5' into 'dev'
diff --git a/runtime/lib/typed_data.cc b/runtime/lib/typed_data.cc
index 2e3cf1c..b49b14e 100644
--- a/runtime/lib/typed_data.cc
+++ b/runtime/lib/typed_data.cc
@@ -177,6 +177,21 @@
return Bool::False().raw();
}
+// Native methods for typed data allocation are recognized and implemented
+// both in FlowGraphBuilder::BuildGraphOfRecognizedMethod and interpreter.
+// These bodies exist only to assert that they are not used.
+#define TYPED_DATA_NEW(name) \
+ DEFINE_NATIVE_ENTRY(TypedData_##name##_new, 0, 2) { \
+ UNREACHABLE(); \
+ return Object::null(); \
+ }
+
+#define TYPED_DATA_NEW_NATIVE(name) TYPED_DATA_NEW(name)
+
+CLASS_LIST_TYPED_DATA(TYPED_DATA_NEW_NATIVE)
+#undef TYPED_DATA_NEW_NATIVE
+#undef TYPED_DATA_NEW
+
// We check the length parameter against a possible maximum length for the
// array based on available physical addressable memory on the system.
//
@@ -188,28 +203,6 @@
// into a _Smi.
//
// Argument 0 is type arguments and is ignored.
-#define TYPED_DATA_NEW(name) \
- DEFINE_NATIVE_ENTRY(TypedData_##name##_new, 0, 2) { \
- GET_NON_NULL_NATIVE_ARGUMENT(Integer, length, arguments->NativeArgAt(1)); \
- const intptr_t cid = kTypedData##name##Cid; \
- const intptr_t max = TypedData::MaxElements(cid); \
- const int64_t len = length.AsInt64Value(); \
- if (len < 0) { \
- Exceptions::ThrowRangeError("length", length, 0, max); \
- } else if (len > max) { \
- const Instance& exception = Instance::Handle( \
- zone, thread->isolate()->object_store()->out_of_memory()); \
- Exceptions::Throw(thread, exception); \
- } \
- return TypedData::New(cid, static_cast<intptr_t>(len)); \
- }
-
-#define TYPED_DATA_NEW_NATIVE(name) TYPED_DATA_NEW(name)
-
-CLASS_LIST_TYPED_DATA(TYPED_DATA_NEW_NATIVE)
-#undef TYPED_DATA_NEW_NATIVE
-#undef TYPED_DATA_NEW
-
#define TYPED_DATA_VIEW_NEW(native_name, cid) \
DEFINE_NATIVE_ENTRY(native_name, 0, 4) { \
GET_NON_NULL_NATIVE_ARGUMENT(TypedDataBase, typed_data, \
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 002795d..3100658 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -304,9 +304,9 @@
dart_2/data_uri_spawn_test: Skip # Timeout
dart_2/kernel_determinism_test: SkipSlow
-[ $arch == arm || $arch == arm64 || $builder_tag == crossword || $builder_tag == crossword_ast || $compiler != dartkp ]
-dart/v8_snapshot_profile_writer_test: SkipByDesign # Only relevant for AOT. Doesn't work in cross-compilation (has to run on the host).
-dart_2/v8_snapshot_profile_writer_test: SkipByDesign # Only relevant for AOT. Doesn't work in cross-compilation (has to run on the host).
+[ $arch == arm || $arch == arm64 || $builder_tag == crossword || $builder_tag == crossword_ast || $compiler != dartkp || $system == linux && ($arch == simarm || $arch == simarm64) ]
+dart/v8_snapshot_profile_writer_test: SkipByDesign # Only relevant for AOT. Doesn't work in cross-compilation (has to run on the host). On Linux/simarm64 and Linux/simarm this test requires buildtools/clang which is not always available on testing shards.
+dart_2/v8_snapshot_profile_writer_test: SkipByDesign # Only relevant for AOT. Doesn't work in cross-compilation (has to run on the host). On Linux/simarm64 and Linux/simarm this test requires buildtools/clang which is not always available on testing shards.
[ $arch == arm || $arch == ia32 || $arch == simarm ]
cc/GenKernelKernelCombined: SkipByDesign # No interpreter support.
diff --git a/runtime/vm/compiler/asm_intrinsifier_arm.cc b/runtime/vm/compiler/asm_intrinsifier_arm.cc
index 7a5bd68..22eff5a 100644
--- a/runtime/vm/compiler/asm_intrinsifier_arm.cc
+++ b/runtime/vm/compiler/asm_intrinsifier_arm.cc
@@ -83,123 +83,6 @@
__ Bind(normal_ir_body);
}
-#define TYPED_ARRAY_ALLOCATION(cid, max_len, scale_shift) \
- Label fall_through; \
- const intptr_t kArrayLengthStackOffset = 0 * target::kWordSize; \
- NOT_IN_PRODUCT(__ LoadAllocationStatsAddress(R2, cid)); \
- NOT_IN_PRODUCT(__ MaybeTraceAllocation(R2, normal_ir_body)); \
- __ ldr(R2, Address(SP, kArrayLengthStackOffset)); /* Array length. */ \
- /* Check that length is a positive Smi. */ \
- /* R2: requested array length argument. */ \
- __ tst(R2, Operand(kSmiTagMask)); \
- __ b(normal_ir_body, NE); \
- __ CompareImmediate(R2, 0); \
- __ b(normal_ir_body, LT); \
- __ SmiUntag(R2); \
- /* Check for maximum allowed length. */ \
- /* R2: untagged array length. */ \
- __ CompareImmediate(R2, max_len); \
- __ b(normal_ir_body, GT); \
- __ mov(R2, Operand(R2, LSL, scale_shift)); \
- const intptr_t fixed_size_plus_alignment_padding = \
- target::TypedData::InstanceSize() + \
- target::ObjectAlignment::kObjectAlignment - 1; \
- __ AddImmediate(R2, fixed_size_plus_alignment_padding); \
- __ bic(R2, R2, Operand(target::ObjectAlignment::kObjectAlignment - 1)); \
- __ ldr(R0, Address(THR, target::Thread::top_offset())); \
- \
- /* R2: allocation size. */ \
- __ adds(R1, R0, Operand(R2)); \
- __ b(normal_ir_body, CS); /* Fail on unsigned overflow. */ \
- \
- /* Check if the allocation fits into the remaining space. */ \
- /* R0: potential new object start. */ \
- /* R1: potential next object start. */ \
- /* R2: allocation size. */ \
- __ ldr(IP, Address(THR, target::Thread::end_offset())); \
- __ cmp(R1, Operand(IP)); \
- __ b(normal_ir_body, CS); \
- \
- __ str(R1, Address(THR, target::Thread::top_offset())); \
- __ AddImmediate(R0, kHeapObjectTag); \
- /* Initialize the tags. */ \
- /* R0: new object start as a tagged pointer. */ \
- /* R1: new object end address. */ \
- /* R2: allocation size. */ \
- { \
- __ CompareImmediate(R2, target::ObjectLayout::kSizeTagMaxSizeTag); \
- __ mov(R3, \
- Operand(R2, LSL, \
- target::ObjectLayout::kTagBitsSizeTagPos - \
- target::ObjectAlignment::kObjectAlignmentLog2), \
- LS); \
- __ mov(R3, Operand(0), HI); \
- \
- /* Get the class index and insert it into the tags. */ \
- uint32_t tags = \
- target::MakeTagWordForNewSpaceObject(cid, /*instance_size=*/0); \
- __ LoadImmediate(TMP, tags); \
- __ orr(R3, R3, Operand(TMP)); \
- __ str(R3, FieldAddress(R0, target::Object::tags_offset())); /* Tags. */ \
- } \
- /* Set the length field. */ \
- /* R0: new object start as a tagged pointer. */ \
- /* R1: new object end address. */ \
- /* R2: allocation size. */ \
- __ ldr(R3, Address(SP, kArrayLengthStackOffset)); /* Array length. */ \
- __ StoreIntoObjectNoBarrier( \
- R0, FieldAddress(R0, target::TypedDataBase::length_offset()), R3); \
- /* Initialize all array elements to 0. */ \
- /* R0: new object start as a tagged pointer. */ \
- /* R1: new object end address. */ \
- /* R2: allocation size. */ \
- /* R3: iterator which initially points to the start of the variable */ \
- /* R8, R9: zero. */ \
- /* data area to be initialized. */ \
- __ LoadImmediate(R8, 0); \
- __ mov(R9, Operand(R8)); \
- __ AddImmediate(R3, R0, target::TypedData::InstanceSize() - 1); \
- __ StoreInternalPointer( \
- R0, FieldAddress(R0, target::TypedDataBase::data_field_offset()), R3); \
- Label init_loop; \
- __ Bind(&init_loop); \
- __ AddImmediate(R3, 2 * target::kWordSize); \
- __ cmp(R3, Operand(R1)); \
- __ strd(R8, R9, R3, -2 * target::kWordSize, LS); \
- __ b(&init_loop, CC); \
- __ str(R8, Address(R3, -2 * target::kWordSize), HI); \
- \
- __ Ret(); \
- __ Bind(normal_ir_body);
-
-static int GetScaleFactor(intptr_t size) {
- switch (size) {
- case 1:
- return 0;
- case 2:
- return 1;
- case 4:
- return 2;
- case 8:
- return 3;
- case 16:
- return 4;
- }
- UNREACHABLE();
- return -1;
-}
-
-#define TYPED_DATA_ALLOCATOR(clazz) \
- void AsmIntrinsifier::TypedData_##clazz##_factory(Assembler* assembler, \
- Label* normal_ir_body) { \
- intptr_t size = TypedDataElementSizeInBytes(kTypedData##clazz##Cid); \
- intptr_t max_len = TypedDataMaxNewSpaceElements(kTypedData##clazz##Cid); \
- int shift = GetScaleFactor(size); \
- TYPED_ARRAY_ALLOCATION(kTypedData##clazz##Cid, max_len, shift); \
- }
-CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATOR)
-#undef TYPED_DATA_ALLOCATOR
-
// Loads args from stack into R0 and R1
// Tests if they are smis, jumps to label not_smi if not.
static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) {
diff --git a/runtime/vm/compiler/asm_intrinsifier_arm64.cc b/runtime/vm/compiler/asm_intrinsifier_arm64.cc
index a6247f9..7552c3c 100644
--- a/runtime/vm/compiler/asm_intrinsifier_arm64.cc
+++ b/runtime/vm/compiler/asm_intrinsifier_arm64.cc
@@ -87,120 +87,6 @@
__ Bind(normal_ir_body);
}
-static int GetScaleFactor(intptr_t size) {
- switch (size) {
- case 1:
- return 0;
- case 2:
- return 1;
- case 4:
- return 2;
- case 8:
- return 3;
- case 16:
- return 4;
- }
- UNREACHABLE();
- return -1;
-}
-
-#define TYPED_ARRAY_ALLOCATION(cid, max_len, scale_shift) \
- Label fall_through; \
- const intptr_t kArrayLengthStackOffset = 0 * target::kWordSize; \
- NOT_IN_PRODUCT(__ MaybeTraceAllocation(cid, R2, normal_ir_body)); \
- __ ldr(R2, Address(SP, kArrayLengthStackOffset)); /* Array length. */ \
- /* Check that length is a positive Smi. */ \
- /* R2: requested array length argument. */ \
- __ BranchIfNotSmi(R2, normal_ir_body); \
- __ CompareRegisters(R2, ZR); \
- __ b(normal_ir_body, LT); \
- __ SmiUntag(R2); \
- /* Check for maximum allowed length. */ \
- /* R2: untagged array length. */ \
- __ CompareImmediate(R2, max_len); \
- __ b(normal_ir_body, GT); \
- __ LslImmediate(R2, R2, scale_shift); \
- const intptr_t fixed_size_plus_alignment_padding = \
- target::TypedData::InstanceSize() + \
- target::ObjectAlignment::kObjectAlignment - 1; \
- __ AddImmediate(R2, fixed_size_plus_alignment_padding); \
- __ andi(R2, R2, \
- Immediate(~(target::ObjectAlignment::kObjectAlignment - 1))); \
- __ ldr(R0, Address(THR, target::Thread::top_offset())); \
- \
- /* R2: allocation size. */ \
- __ adds(R1, R0, Operand(R2)); \
- __ b(normal_ir_body, CS); /* Fail on unsigned overflow. */ \
- \
- /* Check if the allocation fits into the remaining space. */ \
- /* R0: potential new object start. */ \
- /* R1: potential next object start. */ \
- /* R2: allocation size. */ \
- __ ldr(R6, Address(THR, target::Thread::end_offset())); \
- __ cmp(R1, Operand(R6)); \
- __ b(normal_ir_body, CS); \
- \
- /* Successfully allocated the object(s), now update top to point to */ \
- /* next object start and initialize the object. */ \
- __ str(R1, Address(THR, target::Thread::top_offset())); \
- __ AddImmediate(R0, kHeapObjectTag); \
- /* Initialize the tags. */ \
- /* R0: new object start as a tagged pointer. */ \
- /* R1: new object end address. */ \
- /* R2: allocation size. */ \
- { \
- __ CompareImmediate(R2, target::ObjectLayout::kSizeTagMaxSizeTag); \
- __ LslImmediate(R2, R2, \
- target::ObjectLayout::kTagBitsSizeTagPos - \
- target::ObjectAlignment::kObjectAlignmentLog2); \
- __ csel(R2, ZR, R2, HI); \
- \
- /* Get the class index and insert it into the tags. */ \
- uint32_t tags = \
- target::MakeTagWordForNewSpaceObject(cid, /*instance_size=*/0); \
- __ LoadImmediate(TMP, tags); \
- __ orr(R2, R2, Operand(TMP)); \
- __ str(R2, FieldAddress(R0, target::Object::tags_offset())); /* Tags. */ \
- } \
- /* Set the length field. */ \
- /* R0: new object start as a tagged pointer. */ \
- /* R1: new object end address. */ \
- __ ldr(R2, Address(SP, kArrayLengthStackOffset)); /* Array length. */ \
- __ StoreIntoObjectNoBarrier( \
- R0, FieldAddress(R0, target::TypedDataBase::length_offset()), R2); \
- /* Initialize all array elements to 0. */ \
- /* R0: new object start as a tagged pointer. */ \
- /* R1: new object end address. */ \
- /* R2: iterator which initially points to the start of the variable */ \
- /* R3: scratch register. */ \
- /* data area to be initialized. */ \
- __ mov(R3, ZR); \
- __ AddImmediate(R2, R0, target::TypedData::InstanceSize() - 1); \
- __ StoreInternalPointer( \
- R0, FieldAddress(R0, target::TypedDataBase::data_field_offset()), R2); \
- Label init_loop, done; \
- __ Bind(&init_loop); \
- __ cmp(R2, Operand(R1)); \
- __ b(&done, CS); \
- __ str(R3, Address(R2, 0)); \
- __ add(R2, R2, Operand(target::kWordSize)); \
- __ b(&init_loop); \
- __ Bind(&done); \
- \
- __ ret(); \
- __ Bind(normal_ir_body);
-
-#define TYPED_DATA_ALLOCATOR(clazz) \
- void AsmIntrinsifier::TypedData_##clazz##_factory(Assembler* assembler, \
- Label* normal_ir_body) { \
- intptr_t size = TypedDataElementSizeInBytes(kTypedData##clazz##Cid); \
- intptr_t max_len = TypedDataMaxNewSpaceElements(kTypedData##clazz##Cid); \
- int shift = GetScaleFactor(size); \
- TYPED_ARRAY_ALLOCATION(kTypedData##clazz##Cid, max_len, shift); \
- }
-CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATOR)
-#undef TYPED_DATA_ALLOCATOR
-
// Loads args from stack into R0 and R1
// Tests if they are smis, jumps to label not_smi if not.
static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) {
diff --git a/runtime/vm/compiler/asm_intrinsifier_ia32.cc b/runtime/vm/compiler/asm_intrinsifier_ia32.cc
index 47ba761..c1e0863 100644
--- a/runtime/vm/compiler/asm_intrinsifier_ia32.cc
+++ b/runtime/vm/compiler/asm_intrinsifier_ia32.cc
@@ -83,132 +83,6 @@
__ Bind(normal_ir_body);
}
-#define TYPED_ARRAY_ALLOCATION(cid, max_len, scale_factor) \
- const intptr_t kArrayLengthStackOffset = 1 * target::kWordSize; \
- NOT_IN_PRODUCT(__ MaybeTraceAllocation(cid, EDI, normal_ir_body, false)); \
- __ movl(EDI, Address(ESP, kArrayLengthStackOffset)); /* Array length. */ \
- /* Check that length is a positive Smi. */ \
- /* EDI: requested array length argument. */ \
- __ testl(EDI, Immediate(kSmiTagMask)); \
- __ j(NOT_ZERO, normal_ir_body); \
- __ cmpl(EDI, Immediate(0)); \
- __ j(LESS, normal_ir_body); \
- __ SmiUntag(EDI); \
- /* Check for maximum allowed length. */ \
- /* EDI: untagged array length. */ \
- __ cmpl(EDI, Immediate(max_len)); \
- __ j(GREATER, normal_ir_body); \
- /* Special case for scaling by 16. */ \
- if (scale_factor == TIMES_16) { \
- /* double length of array. */ \
- __ addl(EDI, EDI); \
- /* only scale by 8. */ \
- scale_factor = TIMES_8; \
- } \
- const intptr_t fixed_size_plus_alignment_padding = \
- target::TypedData::InstanceSize() + \
- target::ObjectAlignment::kObjectAlignment - 1; \
- __ leal(EDI, Address(EDI, scale_factor, fixed_size_plus_alignment_padding)); \
- __ andl(EDI, Immediate(-target::ObjectAlignment::kObjectAlignment)); \
- __ movl(EAX, Address(THR, target::Thread::top_offset())); \
- __ movl(EBX, EAX); \
- \
- /* EDI: allocation size. */ \
- __ addl(EBX, EDI); \
- __ j(CARRY, normal_ir_body); \
- \
- /* Check if the allocation fits into the remaining space. */ \
- /* EAX: potential new object start. */ \
- /* EBX: potential next object start. */ \
- /* EDI: allocation size. */ \
- __ cmpl(EBX, Address(THR, target::Thread::end_offset())); \
- __ j(ABOVE_EQUAL, normal_ir_body); \
- \
- /* Successfully allocated the object(s), now update top to point to */ \
- /* next object start and initialize the object. */ \
- __ movl(Address(THR, target::Thread::top_offset()), EBX); \
- __ addl(EAX, Immediate(kHeapObjectTag)); \
- \
- /* Initialize the tags. */ \
- /* EAX: new object start as a tagged pointer. */ \
- /* EBX: new object end address. */ \
- /* EDI: allocation size. */ \
- { \
- Label size_tag_overflow, done; \
- __ cmpl(EDI, Immediate(target::ObjectLayout::kSizeTagMaxSizeTag)); \
- __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); \
- __ shll(EDI, Immediate(target::ObjectLayout::kTagBitsSizeTagPos - \
- target::ObjectAlignment::kObjectAlignmentLog2)); \
- __ jmp(&done, Assembler::kNearJump); \
- \
- __ Bind(&size_tag_overflow); \
- __ movl(EDI, Immediate(0)); \
- __ Bind(&done); \
- \
- /* Get the class index and insert it into the tags. */ \
- uint32_t tags = \
- target::MakeTagWordForNewSpaceObject(cid, /*instance_size=*/0); \
- __ orl(EDI, Immediate(tags)); \
- __ movl(FieldAddress(EAX, target::Object::tags_offset()), \
- EDI); /* Tags. */ \
- } \
- /* Set the length field. */ \
- /* EAX: new object start as a tagged pointer. */ \
- /* EBX: new object end address. */ \
- __ movl(EDI, Address(ESP, kArrayLengthStackOffset)); /* Array length. */ \
- __ StoreIntoObjectNoBarrier( \
- EAX, FieldAddress(EAX, target::TypedDataBase::length_offset()), EDI); \
- /* Initialize all array elements to 0. */ \
- /* EAX: new object start as a tagged pointer. */ \
- /* EBX: new object end address. */ \
- /* EDI: iterator which initially points to the start of the variable */ \
- /* ECX: scratch register. */ \
- /* data area to be initialized. */ \
- __ xorl(ECX, ECX); /* Zero. */ \
- __ leal(EDI, FieldAddress(EAX, target::TypedData::InstanceSize())); \
- __ StoreInternalPointer( \
- EAX, FieldAddress(EAX, target::TypedDataBase::data_field_offset()), \
- EDI); \
- Label done, init_loop; \
- __ Bind(&init_loop); \
- __ cmpl(EDI, EBX); \
- __ j(ABOVE_EQUAL, &done, Assembler::kNearJump); \
- __ movl(Address(EDI, 0), ECX); \
- __ addl(EDI, Immediate(target::kWordSize)); \
- __ jmp(&init_loop, Assembler::kNearJump); \
- __ Bind(&done); \
- \
- __ ret(); \
- __ Bind(normal_ir_body);
-
-static ScaleFactor GetScaleFactor(intptr_t size) {
- switch (size) {
- case 1:
- return TIMES_1;
- case 2:
- return TIMES_2;
- case 4:
- return TIMES_4;
- case 8:
- return TIMES_8;
- case 16:
- return TIMES_16;
- }
- UNREACHABLE();
- return static_cast<ScaleFactor>(0);
-}
-
-#define TYPED_DATA_ALLOCATOR(clazz) \
- void AsmIntrinsifier::TypedData_##clazz##_factory(Assembler* assembler, \
- Label* normal_ir_body) { \
- intptr_t size = TypedDataElementSizeInBytes(kTypedData##clazz##Cid); \
- intptr_t max_len = TypedDataMaxNewSpaceElements(kTypedData##clazz##Cid); \
- ScaleFactor scale = GetScaleFactor(size); \
- TYPED_ARRAY_ALLOCATION(kTypedData##clazz##Cid, max_len, scale); \
- }
-CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATOR)
-#undef TYPED_DATA_ALLOCATOR
-
// Tests if two top most arguments are smis, jumps to label not_smi if not.
// Topmost argument is in EAX.
static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) {
diff --git a/runtime/vm/compiler/asm_intrinsifier_x64.cc b/runtime/vm/compiler/asm_intrinsifier_x64.cc
index 003c256..9ee661c 100644
--- a/runtime/vm/compiler/asm_intrinsifier_x64.cc
+++ b/runtime/vm/compiler/asm_intrinsifier_x64.cc
@@ -84,133 +84,6 @@
__ Bind(normal_ir_body);
}
-#define TYPED_ARRAY_ALLOCATION(cid, max_len, scale_factor) \
- Label fall_through; \
- const intptr_t kArrayLengthStackOffset = 1 * target::kWordSize; \
- NOT_IN_PRODUCT(__ MaybeTraceAllocation(cid, normal_ir_body, false)); \
- __ movq(RDI, Address(RSP, kArrayLengthStackOffset)); /* Array length. */ \
- /* Check that length is a positive Smi. */ \
- /* RDI: requested array length argument. */ \
- __ testq(RDI, Immediate(kSmiTagMask)); \
- __ j(NOT_ZERO, normal_ir_body); \
- __ cmpq(RDI, Immediate(0)); \
- __ j(LESS, normal_ir_body); \
- __ SmiUntag(RDI); \
- /* Check for maximum allowed length. */ \
- /* RDI: untagged array length. */ \
- __ cmpq(RDI, Immediate(max_len)); \
- __ j(GREATER, normal_ir_body); \
- /* Special case for scaling by 16. */ \
- if (scale_factor == TIMES_16) { \
- /* double length of array. */ \
- __ addq(RDI, RDI); \
- /* only scale by 8. */ \
- scale_factor = TIMES_8; \
- } \
- const intptr_t fixed_size_plus_alignment_padding = \
- target::TypedData::InstanceSize() + \
- target::ObjectAlignment::kObjectAlignment - 1; \
- __ leaq(RDI, Address(RDI, scale_factor, fixed_size_plus_alignment_padding)); \
- __ andq(RDI, Immediate(-target::ObjectAlignment::kObjectAlignment)); \
- __ movq(RAX, Address(THR, target::Thread::top_offset())); \
- __ movq(RCX, RAX); \
- \
- /* RDI: allocation size. */ \
- __ addq(RCX, RDI); \
- __ j(CARRY, normal_ir_body); \
- \
- /* Check if the allocation fits into the remaining space. */ \
- /* RAX: potential new object start. */ \
- /* RCX: potential next object start. */ \
- /* RDI: allocation size. */ \
- __ cmpq(RCX, Address(THR, target::Thread::end_offset())); \
- __ j(ABOVE_EQUAL, normal_ir_body); \
- \
- /* Successfully allocated the object(s), now update top to point to */ \
- /* next object start and initialize the object. */ \
- __ movq(Address(THR, target::Thread::top_offset()), RCX); \
- __ addq(RAX, Immediate(kHeapObjectTag)); \
- /* Initialize the tags. */ \
- /* RAX: new object start as a tagged pointer. */ \
- /* RCX: new object end address. */ \
- /* RDI: allocation size. */ \
- /* R13: scratch register. */ \
- { \
- Label size_tag_overflow, done; \
- __ cmpq(RDI, Immediate(target::ObjectLayout::kSizeTagMaxSizeTag)); \
- __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); \
- __ shlq(RDI, Immediate(target::ObjectLayout::kTagBitsSizeTagPos - \
- target::ObjectAlignment::kObjectAlignmentLog2)); \
- __ jmp(&done, Assembler::kNearJump); \
- \
- __ Bind(&size_tag_overflow); \
- __ LoadImmediate(RDI, Immediate(0)); \
- __ Bind(&done); \
- \
- /* Get the class index and insert it into the tags. */ \
- uint32_t tags = \
- target::MakeTagWordForNewSpaceObject(cid, /*instance_size=*/0); \
- __ orq(RDI, Immediate(tags)); \
- __ movq(FieldAddress(RAX, target::Object::tags_offset()), \
- RDI); /* Tags. */ \
- } \
- /* Set the length field. */ \
- /* RAX: new object start as a tagged pointer. */ \
- /* RCX: new object end address. */ \
- __ movq(RDI, Address(RSP, kArrayLengthStackOffset)); /* Array length. */ \
- __ StoreIntoObjectNoBarrier( \
- RAX, FieldAddress(RAX, target::TypedDataBase::length_offset()), RDI); \
- /* Initialize all array elements to 0. */ \
- /* RAX: new object start as a tagged pointer. */ \
- /* RCX: new object end address. */ \
- /* RDI: iterator which initially points to the start of the variable */ \
- /* RBX: scratch register. */ \
- /* data area to be initialized. */ \
- __ xorq(RBX, RBX); /* Zero. */ \
- __ leaq(RDI, FieldAddress(RAX, target::TypedData::InstanceSize())); \
- __ StoreInternalPointer( \
- RAX, FieldAddress(RAX, target::TypedDataBase::data_field_offset()), \
- RDI); \
- Label done, init_loop; \
- __ Bind(&init_loop); \
- __ cmpq(RDI, RCX); \
- __ j(ABOVE_EQUAL, &done, Assembler::kNearJump); \
- __ movq(Address(RDI, 0), RBX); \
- __ addq(RDI, Immediate(target::kWordSize)); \
- __ jmp(&init_loop, Assembler::kNearJump); \
- __ Bind(&done); \
- \
- __ ret(); \
- __ Bind(normal_ir_body);
-
-static ScaleFactor GetScaleFactor(intptr_t size) {
- switch (size) {
- case 1:
- return TIMES_1;
- case 2:
- return TIMES_2;
- case 4:
- return TIMES_4;
- case 8:
- return TIMES_8;
- case 16:
- return TIMES_16;
- }
- UNREACHABLE();
- return static_cast<ScaleFactor>(0);
-}
-
-#define TYPED_DATA_ALLOCATOR(clazz) \
- void AsmIntrinsifier::TypedData_##clazz##_factory(Assembler* assembler, \
- Label* normal_ir_body) { \
- intptr_t size = TypedDataElementSizeInBytes(kTypedData##clazz##Cid); \
- intptr_t max_len = TypedDataMaxNewSpaceElements(kTypedData##clazz##Cid); \
- ScaleFactor scale = GetScaleFactor(size); \
- TYPED_ARRAY_ALLOCATION(kTypedData##clazz##Cid, max_len, scale); \
- }
-CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATOR)
-#undef TYPED_DATA_ALLOCATOR
-
// Tests if two top most arguments are smis, jumps to label not_smi if not.
// Topmost argument is in RAX.
static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) {
diff --git a/runtime/vm/compiler/backend/constant_propagator.cc b/runtime/vm/compiler/backend/constant_propagator.cc
index 84b121f..20b25ca 100644
--- a/runtime/vm/compiler/backend/constant_propagator.cc
+++ b/runtime/vm/compiler/backend/constant_propagator.cc
@@ -911,6 +911,10 @@
SetValue(instr, non_constant_);
}
+void ConstantPropagator::VisitAllocateTypedData(AllocateTypedDataInstr* instr) {
+ SetValue(instr, non_constant_);
+}
+
void ConstantPropagator::VisitAllocateObject(AllocateObjectInstr* instr) {
SetValue(instr, non_constant_);
}
diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc
index aa5891d..4ba5bd6 100644
--- a/runtime/vm/compiler/backend/il.cc
+++ b/runtime/vm/compiler/backend/il.cc
@@ -997,6 +997,26 @@
ASSERT(!CompilerState::Current().is_aot());
}
+LocationSummary* AllocateTypedDataInstr::MakeLocationSummary(Zone* zone,
+ bool opt) const {
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ locs->set_in(kLengthPos, Location::RegisterLocation(
+ AllocateTypedDataArrayABI::kLengthReg));
+ locs->set_out(
+ 0, Location::RegisterLocation(AllocateTypedDataArrayABI::kResultReg));
+ return locs;
+}
+
+void AllocateTypedDataInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ const Code& stub = Code::ZoneHandle(
+ compiler->zone(), StubCode::GetAllocationStubForTypedData(class_id()));
+ compiler->GenerateStubCall(token_pos(), stub, PcDescriptorsLayout::kOther,
+ locs());
+}
+
bool StoreInstanceFieldInstr::IsUnboxedStore() const {
return slot().IsDartField() &&
FlowGraphCompiler::IsUnboxedField(slot().field());
@@ -2896,6 +2916,10 @@
if (slot().kind() == Slot::Kind::kArray_length) {
return create_array->num_elements()->definition();
}
+ } else if (AllocateTypedDataInstr* alloc_typed_data =
+ array->AsAllocateTypedData()) {
+ ASSERT(slot().kind() == Slot::Kind::kTypedDataBase_length);
+ return alloc_typed_data->num_elements()->definition();
} else if (LoadFieldInstr* load_array = array->AsLoadField()) {
// For arrays with guarded lengths, replace the length load
// with a constant.
diff --git a/runtime/vm/compiler/backend/il.h b/runtime/vm/compiler/backend/il.h
index eac73c3..3cab656 100644
--- a/runtime/vm/compiler/backend/il.h
+++ b/runtime/vm/compiler/backend/il.h
@@ -426,6 +426,7 @@
M(InstanceOf, _) \
M(CreateArray, _) \
M(AllocateObject, _) \
+ M(AllocateTypedData, _) \
M(LoadField, _) \
M(LoadUntagged, kNoGC) \
M(StoreUntagged, kNoGC) \
@@ -6243,6 +6244,52 @@
DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr);
};
+class AllocateTypedDataInstr : public TemplateAllocation<1, Throws> {
+ public:
+ AllocateTypedDataInstr(TokenPosition token_pos,
+ classid_t class_id,
+ Value* num_elements,
+ intptr_t deopt_id)
+ : TemplateAllocation(deopt_id),
+ token_pos_(token_pos),
+ class_id_(class_id),
+ identity_(AliasIdentity::Unknown()) {
+ SetInputAt(kLengthPos, num_elements);
+ }
+
+ enum { kLengthPos = 0 };
+
+ DECLARE_INSTRUCTION(AllocateTypedData)
+ virtual CompileType ComputeType() const;
+
+ virtual TokenPosition token_pos() const { return token_pos_; }
+ classid_t class_id() const { return class_id_; }
+ Value* num_elements() const { return inputs_[kLengthPos]; }
+
+ // Throw needs environment, which is created only if instruction can
+ // deoptimize.
+ virtual bool ComputeCanDeoptimize() const {
+ return !CompilerState::Current().is_aot();
+ }
+
+ virtual bool HasUnknownSideEffects() const { return false; }
+
+ virtual AliasIdentity Identity() const { return identity_; }
+ virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
+
+ virtual bool WillAllocateNewOrRemembered() const {
+ // No write barriers are generated for typed data accesses.
+ return false;
+ }
+
+ private:
+ const TokenPosition token_pos_;
+ classid_t class_id_;
+ AliasIdentity identity_;
+
+ DISALLOW_COPY_AND_ASSIGN(AllocateTypedDataInstr);
+};
+
// Note: This instruction must not be moved without the indexed access that
// depends on it (e.g. out of loops). GC may collect the array while the
// external data-array is still accessed.
diff --git a/runtime/vm/compiler/backend/redundancy_elimination.cc b/runtime/vm/compiler/backend/redundancy_elimination.cc
index 1a4d8af..4ab46bc 100644
--- a/runtime/vm/compiler/backend/redundancy_elimination.cc
+++ b/runtime/vm/compiler/backend/redundancy_elimination.cc
@@ -443,6 +443,7 @@
static bool IsAllocation(Definition* defn) {
return (defn != NULL) &&
(defn->IsAllocateObject() || defn->IsCreateArray() ||
+ defn->IsAllocateTypedData() ||
defn->IsAllocateUninitializedContext() ||
(defn->IsStaticCall() &&
defn->AsStaticCall()->IsRecognizedFactory()));
diff --git a/runtime/vm/compiler/backend/redundancy_elimination_test.cc b/runtime/vm/compiler/backend/redundancy_elimination_test.cc
index 01c3fbd..2225ab8 100644
--- a/runtime/vm/compiler/backend/redundancy_elimination_test.cc
+++ b/runtime/vm/compiler/backend/redundancy_elimination_test.cc
@@ -732,7 +732,7 @@
auto entry = flow_graph->graph_entry()->normal_entry();
EXPECT(entry != nullptr);
- StaticCallInstr* list_factory = nullptr;
+ AllocateTypedDataInstr* alloc_typed_data = nullptr;
UnboxedConstantInstr* double_one = nullptr;
StoreIndexedInstr* first_store = nullptr;
StoreIndexedInstr* second_store = nullptr;
@@ -742,7 +742,7 @@
ILMatcher cursor(flow_graph, entry);
RELEASE_ASSERT(cursor.TryMatch(
{
- {kMatchAndMoveStaticCall, &list_factory},
+ {kMatchAndMoveAllocateTypedData, &alloc_typed_data},
{kMatchAndMoveUnboxedConstant, &double_one},
{kMatchAndMoveStoreIndexed, &first_store},
{kMatchAndMoveStoreIndexed, &second_store},
@@ -752,8 +752,8 @@
},
/*insert_before=*/kMoveGlob));
- EXPECT(first_store->array()->definition() == list_factory);
- EXPECT(second_store->array()->definition() == list_factory);
+ EXPECT(first_store->array()->definition() == alloc_typed_data);
+ EXPECT(second_store->array()->definition() == alloc_typed_data);
EXPECT(boxed_result->value()->definition() != double_one);
EXPECT(boxed_result->value()->definition() == final_load);
}
@@ -855,7 +855,7 @@
auto entry = flow_graph->graph_entry()->normal_entry();
EXPECT(entry != nullptr);
- StaticCallInstr* list_factory = nullptr;
+ AllocateTypedDataInstr* alloc_typed_data = nullptr;
UnboxedConstantInstr* double_one = nullptr;
StoreIndexedInstr* first_store = nullptr;
StoreIndexedInstr* second_store = nullptr;
@@ -865,7 +865,7 @@
ILMatcher cursor(flow_graph, entry);
RELEASE_ASSERT(cursor.TryMatch(
{
- {kMatchAndMoveStaticCall, &list_factory},
+ {kMatchAndMoveAllocateTypedData, &alloc_typed_data},
kMatchAndMoveBranchTrue,
kMatchAndMoveBranchTrue,
kMatchAndMoveBranchFalse,
@@ -880,8 +880,8 @@
},
/*insert_before=*/kMoveGlob));
- EXPECT(first_store->array()->definition() == list_factory);
- EXPECT(second_store->array()->definition() == list_factory);
+ EXPECT(first_store->array()->definition() == alloc_typed_data);
+ EXPECT(second_store->array()->definition() == alloc_typed_data);
EXPECT(boxed_result->value()->definition() != double_one);
EXPECT(boxed_result->value()->definition() == final_load);
}
diff --git a/runtime/vm/compiler/backend/type_propagator.cc b/runtime/vm/compiler/backend/type_propagator.cc
index eab2e16..6c35a83 100644
--- a/runtime/vm/compiler/backend/type_propagator.cc
+++ b/runtime/vm/compiler/backend/type_propagator.cc
@@ -1467,6 +1467,10 @@
return CompileType::FromCid(kArrayCid);
}
+CompileType AllocateTypedDataInstr::ComputeType() const {
+ return CompileType::FromCid(class_id());
+}
+
CompileType AllocateObjectInstr::ComputeType() const {
if (!closure_function().IsNull()) {
ASSERT(cls().id() == kClosureCid);
diff --git a/runtime/vm/compiler/frontend/base_flow_graph_builder.cc b/runtime/vm/compiler/frontend/base_flow_graph_builder.cc
index 8d750b7..7bb9096 100644
--- a/runtime/vm/compiler/frontend/base_flow_graph_builder.cc
+++ b/runtime/vm/compiler/frontend/base_flow_graph_builder.cc
@@ -930,6 +930,15 @@
return Fragment(array);
}
+Fragment BaseFlowGraphBuilder::AllocateTypedData(TokenPosition position,
+ classid_t class_id) {
+ Value* num_elements = Pop();
+ auto* instr = new (Z) AllocateTypedDataInstr(position, class_id, num_elements,
+ GetNextDeoptId());
+ Push(instr);
+ return Fragment(instr);
+}
+
Fragment BaseFlowGraphBuilder::InstantiateType(const AbstractType& type) {
Value* function_type_args = Pop();
Value* instantiator_type_args = Pop();
diff --git a/runtime/vm/compiler/frontend/base_flow_graph_builder.h b/runtime/vm/compiler/frontend/base_flow_graph_builder.h
index 3160351..4753533 100644
--- a/runtime/vm/compiler/frontend/base_flow_graph_builder.h
+++ b/runtime/vm/compiler/frontend/base_flow_graph_builder.h
@@ -336,6 +336,7 @@
Fragment AllocateClosure(TokenPosition position,
const Function& closure_function);
Fragment CreateArray();
+ Fragment AllocateTypedData(TokenPosition position, classid_t class_id);
Fragment InstantiateType(const AbstractType& type);
Fragment InstantiateTypeArguments(const TypeArguments& type_arguments);
Fragment LoadClassId();
diff --git a/runtime/vm/compiler/frontend/bytecode_reader.cc b/runtime/vm/compiler/frontend/bytecode_reader.cc
index 449f1d9..99da0c4 100644
--- a/runtime/vm/compiler/frontend/bytecode_reader.cc
+++ b/runtime/vm/compiler/frontend/bytecode_reader.cc
@@ -7,6 +7,7 @@
#include "vm/bit_vector.h"
#include "vm/bootstrap.h"
#include "vm/class_finalizer.h"
+#include "vm/class_id.h"
#include "vm/code_descriptors.h"
#include "vm/compiler/aot/precompiler.h" // For Obfuscator
#include "vm/compiler/assembler/disassembler_kbc.h"
@@ -1090,6 +1091,10 @@
case MethodRecognizer::kLinkedHashMap_getDeletedKeys:
case MethodRecognizer::kLinkedHashMap_setDeletedKeys:
case MethodRecognizer::kFfiAbi:
+#define TYPED_DATA_FACTORY(clazz) \
+ case MethodRecognizer::kTypedData_##clazz##_factory:
+ CLASS_LIST_TYPED_DATA(TYPED_DATA_FACTORY)
+#undef TYPED_DATA_FACTORY
break;
case MethodRecognizer::kAsyncStackTraceHelper:
// If causal async stacks are disabled the interpreter.cc will handle this
diff --git a/runtime/vm/compiler/frontend/kernel_to_il.cc b/runtime/vm/compiler/frontend/kernel_to_il.cc
index 036de46..5ff3f43 100644
--- a/runtime/vm/compiler/frontend/kernel_to_il.cc
+++ b/runtime/vm/compiler/frontend/kernel_to_il.cc
@@ -795,6 +795,20 @@
case MethodRecognizer::kTypedData_Float32x4ArrayView_factory:
case MethodRecognizer::kTypedData_Int32x4ArrayView_factory:
case MethodRecognizer::kTypedData_Float64x2ArrayView_factory:
+ case MethodRecognizer::kTypedData_Int8Array_factory:
+ case MethodRecognizer::kTypedData_Uint8Array_factory:
+ case MethodRecognizer::kTypedData_Uint8ClampedArray_factory:
+ case MethodRecognizer::kTypedData_Int16Array_factory:
+ case MethodRecognizer::kTypedData_Uint16Array_factory:
+ case MethodRecognizer::kTypedData_Int32Array_factory:
+ case MethodRecognizer::kTypedData_Uint32Array_factory:
+ case MethodRecognizer::kTypedData_Int64Array_factory:
+ case MethodRecognizer::kTypedData_Uint64Array_factory:
+ case MethodRecognizer::kTypedData_Float32Array_factory:
+ case MethodRecognizer::kTypedData_Float64Array_factory:
+ case MethodRecognizer::kTypedData_Float32x4Array_factory:
+ case MethodRecognizer::kTypedData_Int32x4Array_factory:
+ case MethodRecognizer::kTypedData_Float64x2Array_factory:
case MethodRecognizer::kFfiLoadInt8:
case MethodRecognizer::kFfiLoadInt16:
case MethodRecognizer::kFfiLoadInt32:
@@ -943,6 +957,63 @@
body += BuildTypedDataViewFactoryConstructor(
function, kTypedDataFloat64x2ArrayViewCid);
break;
+ case MethodRecognizer::kTypedData_Int8Array_factory:
+ body +=
+ BuildTypedDataFactoryConstructor(function, kTypedDataInt8ArrayCid);
+ break;
+ case MethodRecognizer::kTypedData_Uint8Array_factory:
+ body +=
+ BuildTypedDataFactoryConstructor(function, kTypedDataUint8ArrayCid);
+ break;
+ case MethodRecognizer::kTypedData_Uint8ClampedArray_factory:
+ body += BuildTypedDataFactoryConstructor(function,
+ kTypedDataUint8ClampedArrayCid);
+ break;
+ case MethodRecognizer::kTypedData_Int16Array_factory:
+ body +=
+ BuildTypedDataFactoryConstructor(function, kTypedDataInt16ArrayCid);
+ break;
+ case MethodRecognizer::kTypedData_Uint16Array_factory:
+ body +=
+ BuildTypedDataFactoryConstructor(function, kTypedDataUint16ArrayCid);
+ break;
+ case MethodRecognizer::kTypedData_Int32Array_factory:
+ body +=
+ BuildTypedDataFactoryConstructor(function, kTypedDataInt32ArrayCid);
+ break;
+ case MethodRecognizer::kTypedData_Uint32Array_factory:
+ body +=
+ BuildTypedDataFactoryConstructor(function, kTypedDataUint32ArrayCid);
+ break;
+ case MethodRecognizer::kTypedData_Int64Array_factory:
+ body +=
+ BuildTypedDataFactoryConstructor(function, kTypedDataInt64ArrayCid);
+ break;
+ case MethodRecognizer::kTypedData_Uint64Array_factory:
+ body +=
+ BuildTypedDataFactoryConstructor(function, kTypedDataUint64ArrayCid);
+ break;
+ case MethodRecognizer::kTypedData_Float32Array_factory:
+ body +=
+ BuildTypedDataFactoryConstructor(function, kTypedDataFloat32ArrayCid);
+ break;
+ case MethodRecognizer::kTypedData_Float64Array_factory:
+ body +=
+ BuildTypedDataFactoryConstructor(function, kTypedDataFloat64ArrayCid);
+ break;
+ case MethodRecognizer::kTypedData_Float32x4Array_factory:
+ body += BuildTypedDataFactoryConstructor(function,
+ kTypedDataFloat32x4ArrayCid);
+ break;
+ case MethodRecognizer::kTypedData_Int32x4Array_factory:
+ body +=
+ BuildTypedDataFactoryConstructor(function, kTypedDataInt32x4ArrayCid);
+ break;
+ case MethodRecognizer::kTypedData_Float64x2Array_factory:
+ body += BuildTypedDataFactoryConstructor(function,
+ kTypedDataFloat64x2ArrayCid);
+ break;
+
case MethodRecognizer::kObjectEquals:
ASSERT(function.NumParameters() == 2);
body += LoadLocal(parsed_function_->RawParameterVariable(0));
@@ -1444,6 +1515,23 @@
return body;
}
+Fragment FlowGraphBuilder::BuildTypedDataFactoryConstructor(
+ const Function& function,
+ classid_t cid) {
+ const auto token_pos = function.token_pos();
+ ASSERT(Thread::Current()->isolate()->class_table()->HasValidClassAt(cid));
+
+ ASSERT(function.IsFactory() && (function.NumParameters() == 2));
+ LocalVariable* length = parsed_function_->RawParameterVariable(1);
+
+ Fragment instructions;
+ instructions += LoadLocal(length);
+ // AllocateTypedData instruction checks that length is valid (a non-negative
+ // Smi below maximum allowed length).
+ instructions += AllocateTypedData(token_pos, cid);
+ return instructions;
+}
+
static const LocalScope* MakeImplicitClosureScope(Zone* Z, const Class& klass) {
ASSERT(!klass.IsNull());
// Note that if klass is _Closure, DeclarationType will be _Closure,
diff --git a/runtime/vm/compiler/frontend/kernel_to_il.h b/runtime/vm/compiler/frontend/kernel_to_il.h
index 9db5a39..173db75 100644
--- a/runtime/vm/compiler/frontend/kernel_to_il.h
+++ b/runtime/vm/compiler/frontend/kernel_to_il.h
@@ -121,6 +121,8 @@
Fragment BuildTypedDataViewFactoryConstructor(const Function& function,
classid_t cid);
+ Fragment BuildTypedDataFactoryConstructor(const Function& function,
+ classid_t cid);
Fragment EnterScope(intptr_t kernel_offset,
const LocalScope** scope = nullptr);
diff --git a/runtime/vm/compiler/intrinsifier.cc b/runtime/vm/compiler/intrinsifier.cc
index 7277c21..a1f21f1 100644
--- a/runtime/vm/compiler/intrinsifier.cc
+++ b/runtime/vm/compiler/intrinsifier.cc
@@ -181,7 +181,6 @@
};
static IntrinsicDesc typed_data_intrinsics[] = {
- TYPED_DATA_LIB_INTRINSIC_LIST(DEFINE_INTRINSIC)
GRAPH_TYPED_DATA_INTRINSICS_LIST(DEFINE_INTRINSIC)
{nullptr, nullptr},
};
diff --git a/runtime/vm/compiler/recognized_methods_list.h b/runtime/vm/compiler/recognized_methods_list.h
index c05d57b..523d82f 100644
--- a/runtime/vm/compiler/recognized_methods_list.h
+++ b/runtime/vm/compiler/recognized_methods_list.h
@@ -64,6 +64,20 @@
V(_Float32x4ArrayView, ._, TypedData_Float32x4ArrayView_factory, 0x5bb7771d) \
V(_Int32x4ArrayView, ._, TypedData_Int32x4ArrayView_factory, 0x30b9f2a2) \
V(_Float64x2ArrayView, ._, TypedData_Float64x2ArrayView_factory, 0x96490d01) \
+ V(Int8List, ., TypedData_Int8Array_factory, 0x80ad83e1) \
+ V(Uint8List, ., TypedData_Uint8Array_factory, 0x252e6768) \
+ V(Uint8ClampedList, ., TypedData_Uint8ClampedArray_factory, 0x1ed931ee) \
+ V(Int16List, ., TypedData_Int16Array_factory, 0x7ea8630c) \
+ V(Uint16List, ., TypedData_Uint16Array_factory, 0x2764f743) \
+ V(Int32List, ., TypedData_Int32Array_factory, 0x54a56479) \
+ V(Uint32List, ., TypedData_Uint32Array_factory, 0xac4deaa4) \
+ V(Int64List, ., TypedData_Int64Array_factory, 0x02d4c748) \
+ V(Uint64List, ., TypedData_Uint64Array_factory, 0x08669751) \
+ V(Float32List, ., TypedData_Float32Array_factory, 0x8b65b9d7) \
+ V(Float64List, ., TypedData_Float64Array_factory, 0x09ede82a) \
+ V(Float32x4List, ., TypedData_Float32x4Array_factory, 0xb2a9e6e1) \
+ V(Int32x4List, ., TypedData_Int32x4Array_factory, 0xa5292147) \
+ V(Float64x2List, ., TypedData_Float64x2Array_factory, 0x20eafb43) \
V(::, _toClampedUint8, ConvertIntToClampedUint8, 0x143ed675) \
V(::, copyRangeFromUint8ListToOneByteString, \
CopyRangeFromUint8ListToOneByteString, 0x89d6a60a) \
@@ -281,22 +295,6 @@
V(::, atan, MathAtan, 0x35d5ecd7) \
V(::, atan2, MathAtan2, 0xb4e03ae8) \
-#define TYPED_DATA_LIB_INTRINSIC_LIST(V) \
- V(Int8List, ., TypedData_Int8Array_factory, 0x80ad83c2) \
- V(Uint8List, ., TypedData_Uint8Array_factory, 0x252e6749) \
- V(Uint8ClampedList, ., TypedData_Uint8ClampedArray_factory, 0x1ed931cf) \
- V(Int16List, ., TypedData_Int16Array_factory, 0x7ea862ed) \
- V(Uint16List, ., TypedData_Uint16Array_factory, 0x2764f724) \
- V(Int32List, ., TypedData_Int32Array_factory, 0x54a5645a) \
- V(Uint32List, ., TypedData_Uint32Array_factory, 0xac4dea85) \
- V(Int64List, ., TypedData_Int64Array_factory, 0x02d4c729) \
- V(Uint64List, ., TypedData_Uint64Array_factory, 0x08669732) \
- V(Float32List, ., TypedData_Float32Array_factory, 0x8b65b9b8) \
- V(Float64List, ., TypedData_Float64Array_factory, 0x09ede80b) \
- V(Float32x4List, ., TypedData_Float32x4Array_factory, 0xb2a9e6c2) \
- V(Int32x4List, ., TypedData_Int32x4Array_factory, 0xa5292128) \
- V(Float64x2List, ., TypedData_Float64x2Array_factory, 0x20eafb24) \
-
#define GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \
V(_Int8List, [], Int8ArrayGetIndexed, 0xd61e79bd) \
V(_Int8List, []=, Int8ArraySetIndexed, 0x6e0b2e72) \
@@ -401,7 +399,6 @@
DEVELOPER_LIB_INTRINSIC_LIST(V) \
INTERNAL_LIB_INTRINSIC_LIST(V) \
MATH_LIB_INTRINSIC_LIST(V) \
- TYPED_DATA_LIB_INTRINSIC_LIST(V) \
#define ALL_INTRINSICS_LIST(V) \
ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \
@@ -456,22 +453,22 @@
kGrowableObjectArrayCid, 0xf6fbbee3) \
V(_GrowableListWithData, _GrowableList, ._withData, kGrowableObjectArrayCid, \
0x00be5928) \
- V(_Int8ArrayFactory, Int8List, ., kTypedDataInt8ArrayCid, 0x80ad83c2) \
- V(_Uint8ArrayFactory, Uint8List, ., kTypedDataUint8ArrayCid, 0x252e6749) \
+ V(_Int8ArrayFactory, Int8List, ., kTypedDataInt8ArrayCid, 0x80ad83e1) \
+ V(_Uint8ArrayFactory, Uint8List, ., kTypedDataUint8ArrayCid, 0x252e6768) \
V(_Uint8ClampedArrayFactory, Uint8ClampedList, ., \
- kTypedDataUint8ClampedArrayCid, 0x1ed931cf) \
- V(_Int16ArrayFactory, Int16List, ., kTypedDataInt16ArrayCid, 0x7ea862ed) \
- V(_Uint16ArrayFactory, Uint16List, ., kTypedDataUint16ArrayCid, 0x2764f724) \
- V(_Int32ArrayFactory, Int32List, ., kTypedDataInt32ArrayCid, 0x54a5645a) \
- V(_Uint32ArrayFactory, Uint32List, ., kTypedDataUint32ArrayCid, 0xac4dea85) \
- V(_Int64ArrayFactory, Int64List, ., kTypedDataInt64ArrayCid, 0x02d4c729) \
- V(_Uint64ArrayFactory, Uint64List, ., kTypedDataUint64ArrayCid, 0x08669732) \
+ kTypedDataUint8ClampedArrayCid, 0x1ed931ee) \
+ V(_Int16ArrayFactory, Int16List, ., kTypedDataInt16ArrayCid, 0x7ea8630c) \
+ V(_Uint16ArrayFactory, Uint16List, ., kTypedDataUint16ArrayCid, 0x2764f743) \
+ V(_Int32ArrayFactory, Int32List, ., kTypedDataInt32ArrayCid, 0x54a56479) \
+ V(_Uint32ArrayFactory, Uint32List, ., kTypedDataUint32ArrayCid, 0xac4deaa4) \
+ V(_Int64ArrayFactory, Int64List, ., kTypedDataInt64ArrayCid, 0x02d4c748) \
+ V(_Uint64ArrayFactory, Uint64List, ., kTypedDataUint64ArrayCid, 0x08669751) \
V(_Float64ArrayFactory, Float64List, ., kTypedDataFloat64ArrayCid, \
- 0x09ede80b) \
+ 0x09ede82a) \
V(_Float32ArrayFactory, Float32List, ., kTypedDataFloat32ArrayCid, \
- 0x8b65b9b8) \
+ 0x8b65b9d7) \
V(_Float32x4ArrayFactory, Float32x4List, ., kTypedDataFloat32x4ArrayCid, \
- 0xb2a9e6c2)
+ 0xb2a9e6e1)
// clang-format on
diff --git a/runtime/vm/compiler/runtime_offsets_extracted.h b/runtime/vm/compiler/runtime_offsets_extracted.h
index 1c8cd1c2fd..4994749 100644
--- a/runtime/vm/compiler/runtime_offsets_extracted.h
+++ b/runtime/vm/compiler/runtime_offsets_extracted.h
@@ -207,9 +207,9 @@
static constexpr dart::compiler::target::word
Thread_AllocateArray_entry_point_offset = 376;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 720;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
724;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 728;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 128;
static constexpr dart::compiler::target::word
@@ -234,7 +234,7 @@
Thread_allocate_object_slow_entry_point_offset = 292;
static constexpr dart::compiler::target::word
Thread_allocate_object_slow_stub_offset = 200;
-static constexpr dart::compiler::target::word Thread_api_top_scope_offset = 756;
+static constexpr dart::compiler::target::word Thread_api_top_scope_offset = 760;
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
96;
static constexpr dart::compiler::target::word
@@ -247,7 +247,7 @@
Thread_call_to_runtime_entry_point_offset = 272;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 148;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 764;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 768;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 48;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -265,7 +265,7 @@
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 252;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 740;
+ 744;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 256;
static constexpr dart::compiler::target::word
@@ -285,7 +285,7 @@
static constexpr dart::compiler::target::word
Thread_float_zerow_address_offset = 372;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 728;
+ 732;
static constexpr dart::compiler::target::word
Thread_interpret_call_entry_point_offset = 340;
static constexpr dart::compiler::target::word
@@ -293,7 +293,7 @@
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_stub_offset = 140;
static constexpr dart::compiler::target::word Thread_exit_through_ffi_offset =
- 752;
+ 756;
static constexpr dart::compiler::target::word Thread_isolate_offset = 44;
static constexpr dart::compiler::target::word Thread_field_table_values_offset =
68;
@@ -332,11 +332,11 @@
static constexpr dart::compiler::target::word Thread_object_null_offset = 112;
static constexpr dart::compiler::target::word
Thread_predefined_symbols_address_offset = 344;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 732;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 736;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 736;
+ Thread_saved_shadow_call_stack_offset = 740;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 744;
+ 748;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 244;
static constexpr dart::compiler::target::word
@@ -369,7 +369,7 @@
Thread_write_barrier_entry_point_offset = 264;
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
40;
-static constexpr dart::compiler::target::word Thread_callback_code_offset = 748;
+static constexpr dart::compiler::target::word Thread_callback_code_offset = 752;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset = 8;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 12;
static constexpr dart::compiler::target::word Type_arguments_offset = 16;
@@ -415,7 +415,7 @@
4, 12, 8, 16};
static constexpr dart::compiler::target::word
Thread_write_barrier_wrappers_thread_offset[] = {
- 688, 692, 696, 700, 704, -1, 708, -1, 712, 716, -1, -1, -1, -1, -1, -1};
+ 692, 696, 700, 704, 708, -1, 712, -1, 716, 720, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word ApiError_InstanceSize = 8;
static constexpr dart::compiler::target::word Array_InstanceSize = 12;
static constexpr dart::compiler::target::word Array_header_size = 12;
@@ -715,9 +715,9 @@
static constexpr dart::compiler::target::word
Thread_AllocateArray_entry_point_offset = 736;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 1448;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
1456;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 1464;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -743,7 +743,7 @@
static constexpr dart::compiler::target::word
Thread_allocate_object_slow_stub_offset = 384;
static constexpr dart::compiler::target::word Thread_api_top_scope_offset =
- 1520;
+ 1528;
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
192;
static constexpr dart::compiler::target::word
@@ -756,7 +756,7 @@
Thread_call_to_runtime_entry_point_offset = 528;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 280;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1536;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1544;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -774,7 +774,7 @@
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 488;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 1488;
+ 1496;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 496;
static constexpr dart::compiler::target::word
@@ -794,7 +794,7 @@
static constexpr dart::compiler::target::word
Thread_float_zerow_address_offset = 728;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 1464;
+ 1472;
static constexpr dart::compiler::target::word
Thread_interpret_call_entry_point_offset = 664;
static constexpr dart::compiler::target::word
@@ -802,7 +802,7 @@
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_stub_offset = 264;
static constexpr dart::compiler::target::word Thread_exit_through_ffi_offset =
- 1512;
+ 1520;
static constexpr dart::compiler::target::word Thread_isolate_offset = 88;
static constexpr dart::compiler::target::word Thread_field_table_values_offset =
136;
@@ -841,11 +841,11 @@
static constexpr dart::compiler::target::word Thread_object_null_offset = 208;
static constexpr dart::compiler::target::word
Thread_predefined_symbols_address_offset = 672;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1472;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1480;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 1480;
+ Thread_saved_shadow_call_stack_offset = 1488;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 1496;
+ 1504;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 472;
static constexpr dart::compiler::target::word
@@ -879,7 +879,7 @@
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
80;
static constexpr dart::compiler::target::word Thread_callback_code_offset =
- 1504;
+ 1512;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset =
16;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 16;
@@ -926,8 +926,8 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
Thread_write_barrier_wrappers_thread_offset[] = {
- 1360, 1368, 1376, 1384, -1, -1, 1392, 1400,
- 1408, 1416, 1424, -1, 1432, 1440, -1, -1};
+ 1368, 1376, 1384, 1392, -1, -1, 1400, 1408,
+ 1416, 1424, 1432, -1, 1440, 1448, -1, -1};
static constexpr dart::compiler::target::word ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word Array_InstanceSize = 24;
static constexpr dart::compiler::target::word Array_header_size = 24;
@@ -1225,9 +1225,9 @@
static constexpr dart::compiler::target::word
Thread_AllocateArray_entry_point_offset = 376;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 688;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
692;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 696;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 128;
static constexpr dart::compiler::target::word
@@ -1252,7 +1252,7 @@
Thread_allocate_object_slow_entry_point_offset = 292;
static constexpr dart::compiler::target::word
Thread_allocate_object_slow_stub_offset = 200;
-static constexpr dart::compiler::target::word Thread_api_top_scope_offset = 724;
+static constexpr dart::compiler::target::word Thread_api_top_scope_offset = 728;
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
96;
static constexpr dart::compiler::target::word
@@ -1265,7 +1265,7 @@
Thread_call_to_runtime_entry_point_offset = 272;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 148;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 732;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 736;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 48;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -1283,7 +1283,7 @@
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 252;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 708;
+ 712;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 256;
static constexpr dart::compiler::target::word
@@ -1303,7 +1303,7 @@
static constexpr dart::compiler::target::word
Thread_float_zerow_address_offset = 372;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 696;
+ 700;
static constexpr dart::compiler::target::word
Thread_interpret_call_entry_point_offset = 340;
static constexpr dart::compiler::target::word
@@ -1311,7 +1311,7 @@
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_stub_offset = 140;
static constexpr dart::compiler::target::word Thread_exit_through_ffi_offset =
- 720;
+ 724;
static constexpr dart::compiler::target::word Thread_isolate_offset = 44;
static constexpr dart::compiler::target::word Thread_field_table_values_offset =
68;
@@ -1350,11 +1350,11 @@
static constexpr dart::compiler::target::word Thread_object_null_offset = 112;
static constexpr dart::compiler::target::word
Thread_predefined_symbols_address_offset = 344;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 700;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 704;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 704;
+ Thread_saved_shadow_call_stack_offset = 708;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 712;
+ 716;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 244;
static constexpr dart::compiler::target::word
@@ -1387,7 +1387,7 @@
Thread_write_barrier_entry_point_offset = 264;
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
40;
-static constexpr dart::compiler::target::word Thread_callback_code_offset = 716;
+static constexpr dart::compiler::target::word Thread_callback_code_offset = 720;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset = 8;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 12;
static constexpr dart::compiler::target::word Type_arguments_offset = 16;
@@ -1730,9 +1730,9 @@
static constexpr dart::compiler::target::word
Thread_AllocateArray_entry_point_offset = 736;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 1520;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
1528;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 1536;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -1758,7 +1758,7 @@
static constexpr dart::compiler::target::word
Thread_allocate_object_slow_stub_offset = 384;
static constexpr dart::compiler::target::word Thread_api_top_scope_offset =
- 1592;
+ 1600;
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
192;
static constexpr dart::compiler::target::word
@@ -1771,7 +1771,7 @@
Thread_call_to_runtime_entry_point_offset = 528;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 280;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1608;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1616;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -1789,7 +1789,7 @@
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 488;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 1560;
+ 1568;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 496;
static constexpr dart::compiler::target::word
@@ -1809,7 +1809,7 @@
static constexpr dart::compiler::target::word
Thread_float_zerow_address_offset = 728;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 1536;
+ 1544;
static constexpr dart::compiler::target::word
Thread_interpret_call_entry_point_offset = 664;
static constexpr dart::compiler::target::word
@@ -1817,7 +1817,7 @@
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_stub_offset = 264;
static constexpr dart::compiler::target::word Thread_exit_through_ffi_offset =
- 1584;
+ 1592;
static constexpr dart::compiler::target::word Thread_isolate_offset = 88;
static constexpr dart::compiler::target::word Thread_field_table_values_offset =
136;
@@ -1856,11 +1856,11 @@
static constexpr dart::compiler::target::word Thread_object_null_offset = 208;
static constexpr dart::compiler::target::word
Thread_predefined_symbols_address_offset = 672;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1544;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1552;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 1552;
+ Thread_saved_shadow_call_stack_offset = 1560;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 1568;
+ 1576;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 472;
static constexpr dart::compiler::target::word
@@ -1894,7 +1894,7 @@
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
80;
static constexpr dart::compiler::target::word Thread_callback_code_offset =
- 1576;
+ 1584;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset =
16;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 16;
@@ -1941,9 +1941,9 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
Thread_write_barrier_wrappers_thread_offset[] = {
- 1360, 1368, 1376, 1384, 1392, 1400, 1408, 1416, 1424, 1432, 1440,
- 1448, 1456, 1464, 1472, -1, -1, -1, -1, 1480, 1488, -1,
- -1, 1496, 1504, 1512, -1, -1, -1, -1, -1, -1};
+ 1368, 1376, 1384, 1392, 1400, 1408, 1416, 1424, 1432, 1440, 1448,
+ 1456, 1464, 1472, 1480, -1, -1, -1, -1, 1488, 1496, -1,
+ -1, 1504, 1512, 1520, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word Array_InstanceSize = 24;
static constexpr dart::compiler::target::word Array_header_size = 24;
@@ -2240,9 +2240,9 @@
static constexpr dart::compiler::target::word
Thread_AllocateArray_entry_point_offset = 376;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 720;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
724;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 728;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 128;
static constexpr dart::compiler::target::word
@@ -2267,7 +2267,7 @@
Thread_allocate_object_slow_entry_point_offset = 292;
static constexpr dart::compiler::target::word
Thread_allocate_object_slow_stub_offset = 200;
-static constexpr dart::compiler::target::word Thread_api_top_scope_offset = 756;
+static constexpr dart::compiler::target::word Thread_api_top_scope_offset = 760;
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
96;
static constexpr dart::compiler::target::word
@@ -2280,7 +2280,7 @@
Thread_call_to_runtime_entry_point_offset = 272;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 148;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 764;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 768;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 48;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -2298,7 +2298,7 @@
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 252;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 740;
+ 744;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 256;
static constexpr dart::compiler::target::word
@@ -2318,7 +2318,7 @@
static constexpr dart::compiler::target::word
Thread_float_zerow_address_offset = 372;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 728;
+ 732;
static constexpr dart::compiler::target::word
Thread_interpret_call_entry_point_offset = 340;
static constexpr dart::compiler::target::word
@@ -2326,7 +2326,7 @@
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_stub_offset = 140;
static constexpr dart::compiler::target::word Thread_exit_through_ffi_offset =
- 752;
+ 756;
static constexpr dart::compiler::target::word Thread_isolate_offset = 44;
static constexpr dart::compiler::target::word Thread_field_table_values_offset =
68;
@@ -2365,11 +2365,11 @@
static constexpr dart::compiler::target::word Thread_object_null_offset = 112;
static constexpr dart::compiler::target::word
Thread_predefined_symbols_address_offset = 344;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 732;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 736;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 736;
+ Thread_saved_shadow_call_stack_offset = 740;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 744;
+ 748;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 244;
static constexpr dart::compiler::target::word
@@ -2402,7 +2402,7 @@
Thread_write_barrier_entry_point_offset = 264;
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
40;
-static constexpr dart::compiler::target::word Thread_callback_code_offset = 748;
+static constexpr dart::compiler::target::word Thread_callback_code_offset = 752;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset = 8;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 12;
static constexpr dart::compiler::target::word Type_arguments_offset = 16;
@@ -2445,7 +2445,7 @@
4, 12, 8, 16};
static constexpr dart::compiler::target::word
Thread_write_barrier_wrappers_thread_offset[] = {
- 688, 692, 696, 700, 704, -1, 708, -1, 712, 716, -1, -1, -1, -1, -1, -1};
+ 692, 696, 700, 704, 708, -1, 712, -1, 716, 720, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word ApiError_InstanceSize = 8;
static constexpr dart::compiler::target::word Array_InstanceSize = 12;
static constexpr dart::compiler::target::word Array_header_size = 12;
@@ -2742,9 +2742,9 @@
static constexpr dart::compiler::target::word
Thread_AllocateArray_entry_point_offset = 736;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 1448;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
1456;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 1464;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -2770,7 +2770,7 @@
static constexpr dart::compiler::target::word
Thread_allocate_object_slow_stub_offset = 384;
static constexpr dart::compiler::target::word Thread_api_top_scope_offset =
- 1520;
+ 1528;
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
192;
static constexpr dart::compiler::target::word
@@ -2783,7 +2783,7 @@
Thread_call_to_runtime_entry_point_offset = 528;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 280;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1536;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1544;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -2801,7 +2801,7 @@
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 488;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 1488;
+ 1496;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 496;
static constexpr dart::compiler::target::word
@@ -2821,7 +2821,7 @@
static constexpr dart::compiler::target::word
Thread_float_zerow_address_offset = 728;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 1464;
+ 1472;
static constexpr dart::compiler::target::word
Thread_interpret_call_entry_point_offset = 664;
static constexpr dart::compiler::target::word
@@ -2829,7 +2829,7 @@
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_stub_offset = 264;
static constexpr dart::compiler::target::word Thread_exit_through_ffi_offset =
- 1512;
+ 1520;
static constexpr dart::compiler::target::word Thread_isolate_offset = 88;
static constexpr dart::compiler::target::word Thread_field_table_values_offset =
136;
@@ -2868,11 +2868,11 @@
static constexpr dart::compiler::target::word Thread_object_null_offset = 208;
static constexpr dart::compiler::target::word
Thread_predefined_symbols_address_offset = 672;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1472;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1480;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 1480;
+ Thread_saved_shadow_call_stack_offset = 1488;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 1496;
+ 1504;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 472;
static constexpr dart::compiler::target::word
@@ -2906,7 +2906,7 @@
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
80;
static constexpr dart::compiler::target::word Thread_callback_code_offset =
- 1504;
+ 1512;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset =
16;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 16;
@@ -2950,8 +2950,8 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
Thread_write_barrier_wrappers_thread_offset[] = {
- 1360, 1368, 1376, 1384, -1, -1, 1392, 1400,
- 1408, 1416, 1424, -1, 1432, 1440, -1, -1};
+ 1368, 1376, 1384, 1392, -1, -1, 1400, 1408,
+ 1416, 1424, 1432, -1, 1440, 1448, -1, -1};
static constexpr dart::compiler::target::word ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word Array_InstanceSize = 24;
static constexpr dart::compiler::target::word Array_header_size = 24;
@@ -3246,9 +3246,9 @@
static constexpr dart::compiler::target::word
Thread_AllocateArray_entry_point_offset = 376;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 688;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
692;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 696;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 128;
static constexpr dart::compiler::target::word
@@ -3273,7 +3273,7 @@
Thread_allocate_object_slow_entry_point_offset = 292;
static constexpr dart::compiler::target::word
Thread_allocate_object_slow_stub_offset = 200;
-static constexpr dart::compiler::target::word Thread_api_top_scope_offset = 724;
+static constexpr dart::compiler::target::word Thread_api_top_scope_offset = 728;
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
96;
static constexpr dart::compiler::target::word
@@ -3286,7 +3286,7 @@
Thread_call_to_runtime_entry_point_offset = 272;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 148;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 732;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 736;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 48;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -3304,7 +3304,7 @@
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 252;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 708;
+ 712;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 256;
static constexpr dart::compiler::target::word
@@ -3324,7 +3324,7 @@
static constexpr dart::compiler::target::word
Thread_float_zerow_address_offset = 372;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 696;
+ 700;
static constexpr dart::compiler::target::word
Thread_interpret_call_entry_point_offset = 340;
static constexpr dart::compiler::target::word
@@ -3332,7 +3332,7 @@
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_stub_offset = 140;
static constexpr dart::compiler::target::word Thread_exit_through_ffi_offset =
- 720;
+ 724;
static constexpr dart::compiler::target::word Thread_isolate_offset = 44;
static constexpr dart::compiler::target::word Thread_field_table_values_offset =
68;
@@ -3371,11 +3371,11 @@
static constexpr dart::compiler::target::word Thread_object_null_offset = 112;
static constexpr dart::compiler::target::word
Thread_predefined_symbols_address_offset = 344;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 700;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 704;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 704;
+ Thread_saved_shadow_call_stack_offset = 708;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 712;
+ 716;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 244;
static constexpr dart::compiler::target::word
@@ -3408,7 +3408,7 @@
Thread_write_barrier_entry_point_offset = 264;
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
40;
-static constexpr dart::compiler::target::word Thread_callback_code_offset = 716;
+static constexpr dart::compiler::target::word Thread_callback_code_offset = 720;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset = 8;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 12;
static constexpr dart::compiler::target::word Type_arguments_offset = 16;
@@ -3745,9 +3745,9 @@
static constexpr dart::compiler::target::word
Thread_AllocateArray_entry_point_offset = 736;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 1520;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
1528;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 1536;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -3773,7 +3773,7 @@
static constexpr dart::compiler::target::word
Thread_allocate_object_slow_stub_offset = 384;
static constexpr dart::compiler::target::word Thread_api_top_scope_offset =
- 1592;
+ 1600;
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
192;
static constexpr dart::compiler::target::word
@@ -3786,7 +3786,7 @@
Thread_call_to_runtime_entry_point_offset = 528;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 280;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1608;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1616;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -3804,7 +3804,7 @@
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 488;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 1560;
+ 1568;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 496;
static constexpr dart::compiler::target::word
@@ -3824,7 +3824,7 @@
static constexpr dart::compiler::target::word
Thread_float_zerow_address_offset = 728;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 1536;
+ 1544;
static constexpr dart::compiler::target::word
Thread_interpret_call_entry_point_offset = 664;
static constexpr dart::compiler::target::word
@@ -3832,7 +3832,7 @@
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_stub_offset = 264;
static constexpr dart::compiler::target::word Thread_exit_through_ffi_offset =
- 1584;
+ 1592;
static constexpr dart::compiler::target::word Thread_isolate_offset = 88;
static constexpr dart::compiler::target::word Thread_field_table_values_offset =
136;
@@ -3871,11 +3871,11 @@
static constexpr dart::compiler::target::word Thread_object_null_offset = 208;
static constexpr dart::compiler::target::word
Thread_predefined_symbols_address_offset = 672;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1544;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1552;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 1552;
+ Thread_saved_shadow_call_stack_offset = 1560;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 1568;
+ 1576;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 472;
static constexpr dart::compiler::target::word
@@ -3909,7 +3909,7 @@
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
80;
static constexpr dart::compiler::target::word Thread_callback_code_offset =
- 1576;
+ 1584;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset =
16;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 16;
@@ -3953,9 +3953,9 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
Thread_write_barrier_wrappers_thread_offset[] = {
- 1360, 1368, 1376, 1384, 1392, 1400, 1408, 1416, 1424, 1432, 1440,
- 1448, 1456, 1464, 1472, -1, -1, -1, -1, 1480, 1488, -1,
- -1, 1496, 1504, 1512, -1, -1, -1, -1, -1, -1};
+ 1368, 1376, 1384, 1392, 1400, 1408, 1416, 1424, 1432, 1440, 1448,
+ 1456, 1464, 1472, 1480, -1, -1, -1, -1, 1488, 1496, -1,
+ -1, 1504, 1512, 1520, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word Array_InstanceSize = 24;
static constexpr dart::compiler::target::word Array_header_size = 24;
@@ -4275,9 +4275,9 @@
static constexpr dart::compiler::target::word
AOT_Thread_AllocateArray_entry_point_offset = 376;
static constexpr dart::compiler::target::word
- AOT_Thread_active_exception_offset = 720;
+ AOT_Thread_active_exception_offset = 724;
static constexpr dart::compiler::target::word
- AOT_Thread_active_stacktrace_offset = 724;
+ AOT_Thread_active_stacktrace_offset = 728;
static constexpr dart::compiler::target::word
AOT_Thread_array_write_barrier_code_offset = 128;
static constexpr dart::compiler::target::word
@@ -4303,7 +4303,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_allocate_object_slow_stub_offset = 200;
static constexpr dart::compiler::target::word AOT_Thread_api_top_scope_offset =
- 756;
+ 760;
static constexpr dart::compiler::target::word
AOT_Thread_async_stack_trace_offset = 96;
static constexpr dart::compiler::target::word
@@ -4318,7 +4318,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_stub_offset = 148;
static constexpr dart::compiler::target::word AOT_Thread_dart_stream_offset =
- 764;
+ 768;
static constexpr dart::compiler::target::word
AOT_Thread_dispatch_table_array_offset = 48;
static constexpr dart::compiler::target::word AOT_Thread_optimize_entry_offset =
@@ -4337,7 +4337,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_enter_safepoint_stub_offset = 252;
static constexpr dart::compiler::target::word
- AOT_Thread_execution_state_offset = 740;
+ AOT_Thread_execution_state_offset = 744;
static constexpr dart::compiler::target::word
AOT_Thread_exit_safepoint_stub_offset = 256;
static constexpr dart::compiler::target::word
@@ -4357,7 +4357,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_float_zerow_address_offset = 372;
static constexpr dart::compiler::target::word
- AOT_Thread_global_object_pool_offset = 728;
+ AOT_Thread_global_object_pool_offset = 732;
static constexpr dart::compiler::target::word
AOT_Thread_interpret_call_entry_point_offset = 340;
static constexpr dart::compiler::target::word
@@ -4365,7 +4365,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_invoke_dart_code_stub_offset = 140;
static constexpr dart::compiler::target::word
- AOT_Thread_exit_through_ffi_offset = 752;
+ AOT_Thread_exit_through_ffi_offset = 756;
static constexpr dart::compiler::target::word AOT_Thread_isolate_offset = 44;
static constexpr dart::compiler::target::word
AOT_Thread_field_table_values_offset = 68;
@@ -4405,11 +4405,11 @@
112;
static constexpr dart::compiler::target::word
AOT_Thread_predefined_symbols_address_offset = 344;
-static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset = 732;
+static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset = 736;
static constexpr dart::compiler::target::word
- AOT_Thread_saved_shadow_call_stack_offset = 736;
+ AOT_Thread_saved_shadow_call_stack_offset = 740;
static constexpr dart::compiler::target::word
- AOT_Thread_safepoint_state_offset = 744;
+ AOT_Thread_safepoint_state_offset = 748;
static constexpr dart::compiler::target::word
AOT_Thread_slow_type_test_stub_offset = 244;
static constexpr dart::compiler::target::word
@@ -4445,7 +4445,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_mask_offset = 40;
static constexpr dart::compiler::target::word AOT_Thread_callback_code_offset =
- 748;
+ 752;
static constexpr dart::compiler::target::word
AOT_TimelineStream_enabled_offset = 8;
static constexpr dart::compiler::target::word AOT_TwoByteString_data_offset =
@@ -4500,7 +4500,7 @@
4, 12, 8, 16};
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_wrappers_thread_offset[] = {
- 688, 692, 696, 700, 704, -1, 708, -1, 712, 716, -1, -1, -1, -1, -1, -1};
+ 692, 696, 700, 704, 708, -1, 712, -1, 716, 720, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word AOT_ApiError_InstanceSize = 8;
static constexpr dart::compiler::target::word AOT_Array_InstanceSize = 12;
static constexpr dart::compiler::target::word AOT_Array_header_size = 12;
@@ -4836,9 +4836,9 @@
static constexpr dart::compiler::target::word
AOT_Thread_AllocateArray_entry_point_offset = 736;
static constexpr dart::compiler::target::word
- AOT_Thread_active_exception_offset = 1448;
+ AOT_Thread_active_exception_offset = 1456;
static constexpr dart::compiler::target::word
- AOT_Thread_active_stacktrace_offset = 1456;
+ AOT_Thread_active_stacktrace_offset = 1464;
static constexpr dart::compiler::target::word
AOT_Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -4864,7 +4864,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_allocate_object_slow_stub_offset = 384;
static constexpr dart::compiler::target::word AOT_Thread_api_top_scope_offset =
- 1520;
+ 1528;
static constexpr dart::compiler::target::word
AOT_Thread_async_stack_trace_offset = 192;
static constexpr dart::compiler::target::word
@@ -4879,7 +4879,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_stub_offset = 280;
static constexpr dart::compiler::target::word AOT_Thread_dart_stream_offset =
- 1536;
+ 1544;
static constexpr dart::compiler::target::word
AOT_Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word AOT_Thread_optimize_entry_offset =
@@ -4898,7 +4898,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_enter_safepoint_stub_offset = 488;
static constexpr dart::compiler::target::word
- AOT_Thread_execution_state_offset = 1488;
+ AOT_Thread_execution_state_offset = 1496;
static constexpr dart::compiler::target::word
AOT_Thread_exit_safepoint_stub_offset = 496;
static constexpr dart::compiler::target::word
@@ -4918,7 +4918,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_float_zerow_address_offset = 728;
static constexpr dart::compiler::target::word
- AOT_Thread_global_object_pool_offset = 1464;
+ AOT_Thread_global_object_pool_offset = 1472;
static constexpr dart::compiler::target::word
AOT_Thread_interpret_call_entry_point_offset = 664;
static constexpr dart::compiler::target::word
@@ -4926,7 +4926,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_invoke_dart_code_stub_offset = 264;
static constexpr dart::compiler::target::word
- AOT_Thread_exit_through_ffi_offset = 1512;
+ AOT_Thread_exit_through_ffi_offset = 1520;
static constexpr dart::compiler::target::word AOT_Thread_isolate_offset = 88;
static constexpr dart::compiler::target::word
AOT_Thread_field_table_values_offset = 136;
@@ -4967,11 +4967,11 @@
static constexpr dart::compiler::target::word
AOT_Thread_predefined_symbols_address_offset = 672;
static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset =
- 1472;
+ 1480;
static constexpr dart::compiler::target::word
- AOT_Thread_saved_shadow_call_stack_offset = 1480;
+ AOT_Thread_saved_shadow_call_stack_offset = 1488;
static constexpr dart::compiler::target::word
- AOT_Thread_safepoint_state_offset = 1496;
+ AOT_Thread_safepoint_state_offset = 1504;
static constexpr dart::compiler::target::word
AOT_Thread_slow_type_test_stub_offset = 472;
static constexpr dart::compiler::target::word
@@ -5007,7 +5007,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_mask_offset = 80;
static constexpr dart::compiler::target::word AOT_Thread_callback_code_offset =
- 1504;
+ 1512;
static constexpr dart::compiler::target::word
AOT_TimelineStream_enabled_offset = 16;
static constexpr dart::compiler::target::word AOT_TwoByteString_data_offset =
@@ -5062,8 +5062,8 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_wrappers_thread_offset[] = {
- 1360, 1368, 1376, 1384, -1, -1, 1392, 1400,
- 1408, 1416, 1424, -1, 1432, 1440, -1, -1};
+ 1368, 1376, 1384, 1392, -1, -1, 1400, 1408,
+ 1416, 1424, 1432, -1, 1440, 1448, -1, -1};
static constexpr dart::compiler::target::word AOT_ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word AOT_Array_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Array_header_size = 24;
@@ -5403,9 +5403,9 @@
static constexpr dart::compiler::target::word
AOT_Thread_AllocateArray_entry_point_offset = 736;
static constexpr dart::compiler::target::word
- AOT_Thread_active_exception_offset = 1520;
+ AOT_Thread_active_exception_offset = 1528;
static constexpr dart::compiler::target::word
- AOT_Thread_active_stacktrace_offset = 1528;
+ AOT_Thread_active_stacktrace_offset = 1536;
static constexpr dart::compiler::target::word
AOT_Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -5431,7 +5431,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_allocate_object_slow_stub_offset = 384;
static constexpr dart::compiler::target::word AOT_Thread_api_top_scope_offset =
- 1592;
+ 1600;
static constexpr dart::compiler::target::word
AOT_Thread_async_stack_trace_offset = 192;
static constexpr dart::compiler::target::word
@@ -5446,7 +5446,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_stub_offset = 280;
static constexpr dart::compiler::target::word AOT_Thread_dart_stream_offset =
- 1608;
+ 1616;
static constexpr dart::compiler::target::word
AOT_Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word AOT_Thread_optimize_entry_offset =
@@ -5465,7 +5465,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_enter_safepoint_stub_offset = 488;
static constexpr dart::compiler::target::word
- AOT_Thread_execution_state_offset = 1560;
+ AOT_Thread_execution_state_offset = 1568;
static constexpr dart::compiler::target::word
AOT_Thread_exit_safepoint_stub_offset = 496;
static constexpr dart::compiler::target::word
@@ -5485,7 +5485,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_float_zerow_address_offset = 728;
static constexpr dart::compiler::target::word
- AOT_Thread_global_object_pool_offset = 1536;
+ AOT_Thread_global_object_pool_offset = 1544;
static constexpr dart::compiler::target::word
AOT_Thread_interpret_call_entry_point_offset = 664;
static constexpr dart::compiler::target::word
@@ -5493,7 +5493,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_invoke_dart_code_stub_offset = 264;
static constexpr dart::compiler::target::word
- AOT_Thread_exit_through_ffi_offset = 1584;
+ AOT_Thread_exit_through_ffi_offset = 1592;
static constexpr dart::compiler::target::word AOT_Thread_isolate_offset = 88;
static constexpr dart::compiler::target::word
AOT_Thread_field_table_values_offset = 136;
@@ -5534,11 +5534,11 @@
static constexpr dart::compiler::target::word
AOT_Thread_predefined_symbols_address_offset = 672;
static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset =
- 1544;
+ 1552;
static constexpr dart::compiler::target::word
- AOT_Thread_saved_shadow_call_stack_offset = 1552;
+ AOT_Thread_saved_shadow_call_stack_offset = 1560;
static constexpr dart::compiler::target::word
- AOT_Thread_safepoint_state_offset = 1568;
+ AOT_Thread_safepoint_state_offset = 1576;
static constexpr dart::compiler::target::word
AOT_Thread_slow_type_test_stub_offset = 472;
static constexpr dart::compiler::target::word
@@ -5574,7 +5574,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_mask_offset = 80;
static constexpr dart::compiler::target::word AOT_Thread_callback_code_offset =
- 1576;
+ 1584;
static constexpr dart::compiler::target::word
AOT_TimelineStream_enabled_offset = 16;
static constexpr dart::compiler::target::word AOT_TwoByteString_data_offset =
@@ -5629,9 +5629,9 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_wrappers_thread_offset[] = {
- 1360, 1368, 1376, 1384, 1392, 1400, 1408, 1416, 1424, 1432, 1440,
- 1448, 1456, 1464, 1472, -1, -1, -1, -1, 1480, 1488, -1,
- -1, 1496, 1504, 1512, -1, -1, -1, -1, -1, -1};
+ 1368, 1376, 1384, 1392, 1400, 1408, 1416, 1424, 1432, 1440, 1448,
+ 1456, 1464, 1472, 1480, -1, -1, -1, -1, 1488, 1496, -1,
+ -1, 1504, 1512, 1520, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word AOT_ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word AOT_Array_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Array_header_size = 24;
@@ -5965,9 +5965,9 @@
static constexpr dart::compiler::target::word
AOT_Thread_AllocateArray_entry_point_offset = 376;
static constexpr dart::compiler::target::word
- AOT_Thread_active_exception_offset = 720;
+ AOT_Thread_active_exception_offset = 724;
static constexpr dart::compiler::target::word
- AOT_Thread_active_stacktrace_offset = 724;
+ AOT_Thread_active_stacktrace_offset = 728;
static constexpr dart::compiler::target::word
AOT_Thread_array_write_barrier_code_offset = 128;
static constexpr dart::compiler::target::word
@@ -5993,7 +5993,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_allocate_object_slow_stub_offset = 200;
static constexpr dart::compiler::target::word AOT_Thread_api_top_scope_offset =
- 756;
+ 760;
static constexpr dart::compiler::target::word
AOT_Thread_async_stack_trace_offset = 96;
static constexpr dart::compiler::target::word
@@ -6008,7 +6008,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_stub_offset = 148;
static constexpr dart::compiler::target::word AOT_Thread_dart_stream_offset =
- 764;
+ 768;
static constexpr dart::compiler::target::word
AOT_Thread_dispatch_table_array_offset = 48;
static constexpr dart::compiler::target::word AOT_Thread_optimize_entry_offset =
@@ -6027,7 +6027,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_enter_safepoint_stub_offset = 252;
static constexpr dart::compiler::target::word
- AOT_Thread_execution_state_offset = 740;
+ AOT_Thread_execution_state_offset = 744;
static constexpr dart::compiler::target::word
AOT_Thread_exit_safepoint_stub_offset = 256;
static constexpr dart::compiler::target::word
@@ -6047,7 +6047,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_float_zerow_address_offset = 372;
static constexpr dart::compiler::target::word
- AOT_Thread_global_object_pool_offset = 728;
+ AOT_Thread_global_object_pool_offset = 732;
static constexpr dart::compiler::target::word
AOT_Thread_interpret_call_entry_point_offset = 340;
static constexpr dart::compiler::target::word
@@ -6055,7 +6055,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_invoke_dart_code_stub_offset = 140;
static constexpr dart::compiler::target::word
- AOT_Thread_exit_through_ffi_offset = 752;
+ AOT_Thread_exit_through_ffi_offset = 756;
static constexpr dart::compiler::target::word AOT_Thread_isolate_offset = 44;
static constexpr dart::compiler::target::word
AOT_Thread_field_table_values_offset = 68;
@@ -6095,11 +6095,11 @@
112;
static constexpr dart::compiler::target::word
AOT_Thread_predefined_symbols_address_offset = 344;
-static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset = 732;
+static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset = 736;
static constexpr dart::compiler::target::word
- AOT_Thread_saved_shadow_call_stack_offset = 736;
+ AOT_Thread_saved_shadow_call_stack_offset = 740;
static constexpr dart::compiler::target::word
- AOT_Thread_safepoint_state_offset = 744;
+ AOT_Thread_safepoint_state_offset = 748;
static constexpr dart::compiler::target::word
AOT_Thread_slow_type_test_stub_offset = 244;
static constexpr dart::compiler::target::word
@@ -6135,7 +6135,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_mask_offset = 40;
static constexpr dart::compiler::target::word AOT_Thread_callback_code_offset =
- 748;
+ 752;
static constexpr dart::compiler::target::word
AOT_TimelineStream_enabled_offset = 8;
static constexpr dart::compiler::target::word AOT_TwoByteString_data_offset =
@@ -6187,7 +6187,7 @@
4, 12, 8, 16};
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_wrappers_thread_offset[] = {
- 688, 692, 696, 700, 704, -1, 708, -1, 712, 716, -1, -1, -1, -1, -1, -1};
+ 692, 696, 700, 704, 708, -1, 712, -1, 716, 720, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word AOT_ApiError_InstanceSize = 8;
static constexpr dart::compiler::target::word AOT_Array_InstanceSize = 12;
static constexpr dart::compiler::target::word AOT_Array_header_size = 12;
@@ -6519,9 +6519,9 @@
static constexpr dart::compiler::target::word
AOT_Thread_AllocateArray_entry_point_offset = 736;
static constexpr dart::compiler::target::word
- AOT_Thread_active_exception_offset = 1448;
+ AOT_Thread_active_exception_offset = 1456;
static constexpr dart::compiler::target::word
- AOT_Thread_active_stacktrace_offset = 1456;
+ AOT_Thread_active_stacktrace_offset = 1464;
static constexpr dart::compiler::target::word
AOT_Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -6547,7 +6547,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_allocate_object_slow_stub_offset = 384;
static constexpr dart::compiler::target::word AOT_Thread_api_top_scope_offset =
- 1520;
+ 1528;
static constexpr dart::compiler::target::word
AOT_Thread_async_stack_trace_offset = 192;
static constexpr dart::compiler::target::word
@@ -6562,7 +6562,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_stub_offset = 280;
static constexpr dart::compiler::target::word AOT_Thread_dart_stream_offset =
- 1536;
+ 1544;
static constexpr dart::compiler::target::word
AOT_Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word AOT_Thread_optimize_entry_offset =
@@ -6581,7 +6581,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_enter_safepoint_stub_offset = 488;
static constexpr dart::compiler::target::word
- AOT_Thread_execution_state_offset = 1488;
+ AOT_Thread_execution_state_offset = 1496;
static constexpr dart::compiler::target::word
AOT_Thread_exit_safepoint_stub_offset = 496;
static constexpr dart::compiler::target::word
@@ -6601,7 +6601,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_float_zerow_address_offset = 728;
static constexpr dart::compiler::target::word
- AOT_Thread_global_object_pool_offset = 1464;
+ AOT_Thread_global_object_pool_offset = 1472;
static constexpr dart::compiler::target::word
AOT_Thread_interpret_call_entry_point_offset = 664;
static constexpr dart::compiler::target::word
@@ -6609,7 +6609,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_invoke_dart_code_stub_offset = 264;
static constexpr dart::compiler::target::word
- AOT_Thread_exit_through_ffi_offset = 1512;
+ AOT_Thread_exit_through_ffi_offset = 1520;
static constexpr dart::compiler::target::word AOT_Thread_isolate_offset = 88;
static constexpr dart::compiler::target::word
AOT_Thread_field_table_values_offset = 136;
@@ -6650,11 +6650,11 @@
static constexpr dart::compiler::target::word
AOT_Thread_predefined_symbols_address_offset = 672;
static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset =
- 1472;
+ 1480;
static constexpr dart::compiler::target::word
- AOT_Thread_saved_shadow_call_stack_offset = 1480;
+ AOT_Thread_saved_shadow_call_stack_offset = 1488;
static constexpr dart::compiler::target::word
- AOT_Thread_safepoint_state_offset = 1496;
+ AOT_Thread_safepoint_state_offset = 1504;
static constexpr dart::compiler::target::word
AOT_Thread_slow_type_test_stub_offset = 472;
static constexpr dart::compiler::target::word
@@ -6690,7 +6690,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_mask_offset = 80;
static constexpr dart::compiler::target::word AOT_Thread_callback_code_offset =
- 1504;
+ 1512;
static constexpr dart::compiler::target::word
AOT_TimelineStream_enabled_offset = 16;
static constexpr dart::compiler::target::word AOT_TwoByteString_data_offset =
@@ -6742,8 +6742,8 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_wrappers_thread_offset[] = {
- 1360, 1368, 1376, 1384, -1, -1, 1392, 1400,
- 1408, 1416, 1424, -1, 1432, 1440, -1, -1};
+ 1368, 1376, 1384, 1392, -1, -1, 1400, 1408,
+ 1416, 1424, 1432, -1, 1440, 1448, -1, -1};
static constexpr dart::compiler::target::word AOT_ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word AOT_Array_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Array_header_size = 24;
@@ -7079,9 +7079,9 @@
static constexpr dart::compiler::target::word
AOT_Thread_AllocateArray_entry_point_offset = 736;
static constexpr dart::compiler::target::word
- AOT_Thread_active_exception_offset = 1520;
+ AOT_Thread_active_exception_offset = 1528;
static constexpr dart::compiler::target::word
- AOT_Thread_active_stacktrace_offset = 1528;
+ AOT_Thread_active_stacktrace_offset = 1536;
static constexpr dart::compiler::target::word
AOT_Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -7107,7 +7107,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_allocate_object_slow_stub_offset = 384;
static constexpr dart::compiler::target::word AOT_Thread_api_top_scope_offset =
- 1592;
+ 1600;
static constexpr dart::compiler::target::word
AOT_Thread_async_stack_trace_offset = 192;
static constexpr dart::compiler::target::word
@@ -7122,7 +7122,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_stub_offset = 280;
static constexpr dart::compiler::target::word AOT_Thread_dart_stream_offset =
- 1608;
+ 1616;
static constexpr dart::compiler::target::word
AOT_Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word AOT_Thread_optimize_entry_offset =
@@ -7141,7 +7141,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_enter_safepoint_stub_offset = 488;
static constexpr dart::compiler::target::word
- AOT_Thread_execution_state_offset = 1560;
+ AOT_Thread_execution_state_offset = 1568;
static constexpr dart::compiler::target::word
AOT_Thread_exit_safepoint_stub_offset = 496;
static constexpr dart::compiler::target::word
@@ -7161,7 +7161,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_float_zerow_address_offset = 728;
static constexpr dart::compiler::target::word
- AOT_Thread_global_object_pool_offset = 1536;
+ AOT_Thread_global_object_pool_offset = 1544;
static constexpr dart::compiler::target::word
AOT_Thread_interpret_call_entry_point_offset = 664;
static constexpr dart::compiler::target::word
@@ -7169,7 +7169,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_invoke_dart_code_stub_offset = 264;
static constexpr dart::compiler::target::word
- AOT_Thread_exit_through_ffi_offset = 1584;
+ AOT_Thread_exit_through_ffi_offset = 1592;
static constexpr dart::compiler::target::word AOT_Thread_isolate_offset = 88;
static constexpr dart::compiler::target::word
AOT_Thread_field_table_values_offset = 136;
@@ -7210,11 +7210,11 @@
static constexpr dart::compiler::target::word
AOT_Thread_predefined_symbols_address_offset = 672;
static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset =
- 1544;
+ 1552;
static constexpr dart::compiler::target::word
- AOT_Thread_saved_shadow_call_stack_offset = 1552;
+ AOT_Thread_saved_shadow_call_stack_offset = 1560;
static constexpr dart::compiler::target::word
- AOT_Thread_safepoint_state_offset = 1568;
+ AOT_Thread_safepoint_state_offset = 1576;
static constexpr dart::compiler::target::word
AOT_Thread_slow_type_test_stub_offset = 472;
static constexpr dart::compiler::target::word
@@ -7250,7 +7250,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_mask_offset = 80;
static constexpr dart::compiler::target::word AOT_Thread_callback_code_offset =
- 1576;
+ 1584;
static constexpr dart::compiler::target::word
AOT_TimelineStream_enabled_offset = 16;
static constexpr dart::compiler::target::word AOT_TwoByteString_data_offset =
@@ -7302,9 +7302,9 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_wrappers_thread_offset[] = {
- 1360, 1368, 1376, 1384, 1392, 1400, 1408, 1416, 1424, 1432, 1440,
- 1448, 1456, 1464, 1472, -1, -1, -1, -1, 1480, 1488, -1,
- -1, 1496, 1504, 1512, -1, -1, -1, -1, -1, -1};
+ 1368, 1376, 1384, 1392, 1400, 1408, 1416, 1424, 1432, 1440, 1448,
+ 1456, 1464, 1472, 1480, -1, -1, -1, -1, 1488, 1496, -1,
+ -1, 1504, 1512, 1520, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word AOT_ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word AOT_Array_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Array_header_size = 24;
diff --git a/runtime/vm/compiler/stub_code_compiler.cc b/runtime/vm/compiler/stub_code_compiler.cc
index 87f0a60..dfa4d4f 100644
--- a/runtime/vm/compiler/stub_code_compiler.cc
+++ b/runtime/vm/compiler/stub_code_compiler.cc
@@ -197,6 +197,13 @@
Code::Handle(Code::null()));
}
+#define TYPED_DATA_ALLOCATION_STUB(clazz) \
+ void StubCodeCompiler::GenerateAllocate##clazz##Stub(Assembler* assembler) { \
+ GenerateAllocateTypedDataArrayStub(assembler, kTypedData##clazz##Cid); \
+ }
+CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATION_STUB)
+#undef TYPED_DATA_ALLOCATION_STUB
+
} // namespace compiler
} // namespace dart
diff --git a/runtime/vm/compiler/stub_code_compiler.h b/runtime/vm/compiler/stub_code_compiler.h
index 875ea17..d4a6fd0 100644
--- a/runtime/vm/compiler/stub_code_compiler.h
+++ b/runtime/vm/compiler/stub_code_compiler.h
@@ -142,6 +142,10 @@
// InitLateFinalInstanceField stubs.
static void GenerateInitLateInstanceFieldStub(Assembler* assembler,
bool is_final);
+
+ // Common function for generating Allocate<TypedData>Array stubs.
+ static void GenerateAllocateTypedDataArrayStub(Assembler* assembler,
+ intptr_t cid);
};
} // namespace compiler
diff --git a/runtime/vm/compiler/stub_code_compiler_arm.cc b/runtime/vm/compiler/stub_code_compiler_arm.cc
index 1669dc6..0969032 100644
--- a/runtime/vm/compiler/stub_code_compiler_arm.cc
+++ b/runtime/vm/compiler/stub_code_compiler_arm.cc
@@ -3904,6 +3904,131 @@
GenerateInstantiateTypeArgumentsStub(assembler);
}
+static int GetScaleFactor(intptr_t size) {
+ switch (size) {
+ case 1:
+ return 0;
+ case 2:
+ return 1;
+ case 4:
+ return 2;
+ case 8:
+ return 3;
+ case 16:
+ return 4;
+ }
+ UNREACHABLE();
+ return -1;
+}
+
+void StubCodeCompiler::GenerateAllocateTypedDataArrayStub(Assembler* assembler,
+ intptr_t cid) {
+ const intptr_t element_size = TypedDataElementSizeInBytes(cid);
+ const intptr_t max_len = TypedDataMaxNewSpaceElements(cid);
+ const intptr_t scale_shift = GetScaleFactor(element_size);
+
+ COMPILE_ASSERT(AllocateTypedDataArrayABI::kLengthReg == R4);
+ COMPILE_ASSERT(AllocateTypedDataArrayABI::kResultReg == R0);
+
+ Label call_runtime;
+ NOT_IN_PRODUCT(__ LoadAllocationStatsAddress(R2, cid));
+ NOT_IN_PRODUCT(__ MaybeTraceAllocation(R2, &call_runtime));
+ __ mov(R2, Operand(AllocateTypedDataArrayABI::kLengthReg));
+ /* Check that length is a positive Smi. */
+ /* R2: requested array length argument. */
+ __ tst(R2, Operand(kSmiTagMask));
+ __ b(&call_runtime, NE);
+ __ CompareImmediate(R2, 0);
+ __ b(&call_runtime, LT);
+ __ SmiUntag(R2);
+ /* Check for maximum allowed length. */
+ /* R2: untagged array length. */
+ __ CompareImmediate(R2, max_len);
+ __ b(&call_runtime, GT);
+ __ mov(R2, Operand(R2, LSL, scale_shift));
+ const intptr_t fixed_size_plus_alignment_padding =
+ target::TypedData::InstanceSize() +
+ target::ObjectAlignment::kObjectAlignment - 1;
+ __ AddImmediate(R2, fixed_size_plus_alignment_padding);
+ __ bic(R2, R2, Operand(target::ObjectAlignment::kObjectAlignment - 1));
+ __ ldr(R0, Address(THR, target::Thread::top_offset()));
+
+ /* R2: allocation size. */
+ __ adds(R1, R0, Operand(R2));
+ __ b(&call_runtime, CS); /* Fail on unsigned overflow. */
+
+ /* Check if the allocation fits into the remaining space. */
+ /* R0: potential new object start. */
+ /* R1: potential next object start. */
+ /* R2: allocation size. */
+ __ ldr(IP, Address(THR, target::Thread::end_offset()));
+ __ cmp(R1, Operand(IP));
+ __ b(&call_runtime, CS);
+
+ __ str(R1, Address(THR, target::Thread::top_offset()));
+ __ AddImmediate(R0, kHeapObjectTag);
+ /* Initialize the tags. */
+ /* R0: new object start as a tagged pointer. */
+ /* R1: new object end address. */
+ /* R2: allocation size. */
+ {
+ __ CompareImmediate(R2, target::ObjectLayout::kSizeTagMaxSizeTag);
+ __ mov(R3,
+ Operand(R2, LSL,
+ target::ObjectLayout::kTagBitsSizeTagPos -
+ target::ObjectAlignment::kObjectAlignmentLog2),
+ LS);
+ __ mov(R3, Operand(0), HI);
+
+ /* Get the class index and insert it into the tags. */
+ uint32_t tags =
+ target::MakeTagWordForNewSpaceObject(cid, /*instance_size=*/0);
+ __ LoadImmediate(TMP, tags);
+ __ orr(R3, R3, Operand(TMP));
+ __ str(R3, FieldAddress(R0, target::Object::tags_offset())); /* Tags. */
+ }
+ /* Set the length field. */
+ /* R0: new object start as a tagged pointer. */
+ /* R1: new object end address. */
+ /* R2: allocation size. */
+ __ mov(R3,
+ Operand(AllocateTypedDataArrayABI::kLengthReg)); /* Array length. */
+ __ StoreIntoObjectNoBarrier(
+ R0, FieldAddress(R0, target::TypedDataBase::length_offset()), R3);
+ /* Initialize all array elements to 0. */
+ /* R0: new object start as a tagged pointer. */
+ /* R1: new object end address. */
+ /* R2: allocation size. */
+ /* R3: iterator which initially points to the start of the variable */
+ /* R8, R9: zero. */
+ /* data area to be initialized. */
+ __ LoadImmediate(R8, 0);
+ __ mov(R9, Operand(R8));
+ __ AddImmediate(R3, R0, target::TypedData::InstanceSize() - 1);
+ __ StoreInternalPointer(
+ R0, FieldAddress(R0, target::TypedDataBase::data_field_offset()), R3);
+ Label init_loop;
+ __ Bind(&init_loop);
+ __ AddImmediate(R3, 2 * target::kWordSize);
+ __ cmp(R3, Operand(R1));
+ __ strd(R8, R9, R3, -2 * target::kWordSize, LS);
+ __ b(&init_loop, CC);
+ __ str(R8, Address(R3, -2 * target::kWordSize), HI);
+
+ __ Ret();
+
+ __ Bind(&call_runtime);
+ __ EnterStubFrame();
+ __ PushObject(Object::null_object()); // Make room for the result.
+ __ PushImmediate(target::ToRawSmi(cid)); // Cid
+ __ Push(AllocateTypedDataArrayABI::kLengthReg); // Array length
+ __ CallRuntime(kAllocateTypedDataRuntimeEntry, 2);
+ __ Drop(2); // Drop arguments.
+ __ Pop(AllocateTypedDataArrayABI::kResultReg);
+ __ LeaveStubFrame();
+ __ Ret();
+}
+
} // namespace compiler
} // namespace dart
diff --git a/runtime/vm/compiler/stub_code_compiler_arm64.cc b/runtime/vm/compiler/stub_code_compiler_arm64.cc
index 6f29ad2..e62f9fe 100644
--- a/runtime/vm/compiler/stub_code_compiler_arm64.cc
+++ b/runtime/vm/compiler/stub_code_compiler_arm64.cc
@@ -4069,6 +4069,126 @@
GenerateInstantiateTypeArgumentsStub(assembler);
}
+static int GetScaleFactor(intptr_t size) {
+ switch (size) {
+ case 1:
+ return 0;
+ case 2:
+ return 1;
+ case 4:
+ return 2;
+ case 8:
+ return 3;
+ case 16:
+ return 4;
+ }
+ UNREACHABLE();
+ return -1;
+}
+
+void StubCodeCompiler::GenerateAllocateTypedDataArrayStub(Assembler* assembler,
+ intptr_t cid) {
+ const intptr_t element_size = TypedDataElementSizeInBytes(cid);
+ const intptr_t max_len = TypedDataMaxNewSpaceElements(cid);
+ const intptr_t scale_shift = GetScaleFactor(element_size);
+
+ COMPILE_ASSERT(AllocateTypedDataArrayABI::kLengthReg == R4);
+ COMPILE_ASSERT(AllocateTypedDataArrayABI::kResultReg == R0);
+
+ Label call_runtime;
+ NOT_IN_PRODUCT(__ MaybeTraceAllocation(cid, R2, &call_runtime));
+ __ mov(R2, AllocateTypedDataArrayABI::kLengthReg);
+ /* Check that length is a positive Smi. */
+ /* R2: requested array length argument. */
+ __ BranchIfNotSmi(R2, &call_runtime);
+ __ CompareRegisters(R2, ZR);
+ __ b(&call_runtime, LT);
+ __ SmiUntag(R2);
+ /* Check for maximum allowed length. */
+ /* R2: untagged array length. */
+ __ CompareImmediate(R2, max_len);
+ __ b(&call_runtime, GT);
+ __ LslImmediate(R2, R2, scale_shift);
+ const intptr_t fixed_size_plus_alignment_padding =
+ target::TypedData::InstanceSize() +
+ target::ObjectAlignment::kObjectAlignment - 1;
+ __ AddImmediate(R2, fixed_size_plus_alignment_padding);
+ __ andi(R2, R2, Immediate(~(target::ObjectAlignment::kObjectAlignment - 1)));
+ __ ldr(R0, Address(THR, target::Thread::top_offset()));
+
+ /* R2: allocation size. */
+ __ adds(R1, R0, Operand(R2));
+ __ b(&call_runtime, CS); /* Fail on unsigned overflow. */
+
+ /* Check if the allocation fits into the remaining space. */
+ /* R0: potential new object start. */
+ /* R1: potential next object start. */
+ /* R2: allocation size. */
+ __ ldr(R6, Address(THR, target::Thread::end_offset()));
+ __ cmp(R1, Operand(R6));
+ __ b(&call_runtime, CS);
+
+ /* Successfully allocated the object(s), now update top to point to */
+ /* next object start and initialize the object. */
+ __ str(R1, Address(THR, target::Thread::top_offset()));
+ __ AddImmediate(R0, kHeapObjectTag);
+ /* Initialize the tags. */
+ /* R0: new object start as a tagged pointer. */
+ /* R1: new object end address. */
+ /* R2: allocation size. */
+ {
+ __ CompareImmediate(R2, target::ObjectLayout::kSizeTagMaxSizeTag);
+ __ LslImmediate(R2, R2,
+ target::ObjectLayout::kTagBitsSizeTagPos -
+ target::ObjectAlignment::kObjectAlignmentLog2);
+ __ csel(R2, ZR, R2, HI);
+
+ /* Get the class index and insert it into the tags. */
+ uint32_t tags =
+ target::MakeTagWordForNewSpaceObject(cid, /*instance_size=*/0);
+ __ LoadImmediate(TMP, tags);
+ __ orr(R2, R2, Operand(TMP));
+ __ str(R2, FieldAddress(R0, target::Object::tags_offset())); /* Tags. */
+ }
+ /* Set the length field. */
+ /* R0: new object start as a tagged pointer. */
+ /* R1: new object end address. */
+ __ mov(R2, AllocateTypedDataArrayABI::kLengthReg); /* Array length. */
+ __ StoreIntoObjectNoBarrier(
+ R0, FieldAddress(R0, target::TypedDataBase::length_offset()), R2);
+ /* Initialize all array elements to 0. */
+ /* R0: new object start as a tagged pointer. */
+ /* R1: new object end address. */
+ /* R2: iterator which initially points to the start of the variable */
+ /* R3: scratch register. */
+ /* data area to be initialized. */
+ __ mov(R3, ZR);
+ __ AddImmediate(R2, R0, target::TypedData::InstanceSize() - 1);
+ __ StoreInternalPointer(
+ R0, FieldAddress(R0, target::TypedDataBase::data_field_offset()), R2);
+ Label init_loop, done;
+ __ Bind(&init_loop);
+ __ cmp(R2, Operand(R1));
+ __ b(&done, CS);
+ __ str(R3, Address(R2, 0));
+ __ add(R2, R2, Operand(target::kWordSize));
+ __ b(&init_loop);
+ __ Bind(&done);
+
+ __ Ret();
+
+ __ Bind(&call_runtime);
+ __ EnterStubFrame();
+ __ Push(ZR); // Result slot.
+ __ PushImmediate(target::ToRawSmi(cid)); // Cid
+ __ Push(AllocateTypedDataArrayABI::kLengthReg); // Array length
+ __ CallRuntime(kAllocateTypedDataRuntimeEntry, 2);
+ __ Drop(2); // Drop arguments.
+ __ Pop(AllocateTypedDataArrayABI::kResultReg);
+ __ LeaveStubFrame();
+ __ Ret();
+}
+
} // namespace compiler
} // namespace dart
diff --git a/runtime/vm/compiler/stub_code_compiler_ia32.cc b/runtime/vm/compiler/stub_code_compiler_ia32.cc
index 9ce50a1..4e81b70 100644
--- a/runtime/vm/compiler/stub_code_compiler_ia32.cc
+++ b/runtime/vm/compiler/stub_code_compiler_ia32.cc
@@ -3089,6 +3089,142 @@
GenerateInstantiateTypeArgumentsStub(assembler);
}
+static ScaleFactor GetScaleFactor(intptr_t size) {
+ switch (size) {
+ case 1:
+ return TIMES_1;
+ case 2:
+ return TIMES_2;
+ case 4:
+ return TIMES_4;
+ case 8:
+ return TIMES_8;
+ case 16:
+ return TIMES_16;
+ }
+ UNREACHABLE();
+ return static_cast<ScaleFactor>(0);
+}
+
+void StubCodeCompiler::GenerateAllocateTypedDataArrayStub(Assembler* assembler,
+ intptr_t cid) {
+ const intptr_t element_size = TypedDataElementSizeInBytes(cid);
+ const intptr_t max_len = TypedDataMaxNewSpaceElements(cid);
+ ScaleFactor scale_factor = GetScaleFactor(element_size);
+
+ COMPILE_ASSERT(AllocateTypedDataArrayABI::kLengthReg == EAX);
+ COMPILE_ASSERT(AllocateTypedDataArrayABI::kResultReg == EAX);
+
+ // Save length argument for possible runtime call, as
+ // EAX is clobbered.
+ Label call_runtime;
+ __ pushl(AllocateTypedDataArrayABI::kLengthReg);
+
+ NOT_IN_PRODUCT(__ MaybeTraceAllocation(cid, ECX, &call_runtime, false));
+ /* Check that length is a positive Smi. */
+ /* EDI: requested array length argument. */
+ __ testl(EDI, Immediate(kSmiTagMask));
+ __ j(NOT_ZERO, &call_runtime);
+ __ cmpl(EDI, Immediate(0));
+ __ j(LESS, &call_runtime);
+ __ SmiUntag(EDI);
+ /* Check for maximum allowed length. */
+ /* EDI: untagged array length. */
+ __ cmpl(EDI, Immediate(max_len));
+ __ j(GREATER, &call_runtime);
+ /* Special case for scaling by 16. */
+ if (scale_factor == TIMES_16) {
+ /* double length of array. */
+ __ addl(EDI, EDI);
+ /* only scale by 8. */
+ scale_factor = TIMES_8;
+ }
+
+ const intptr_t fixed_size_plus_alignment_padding =
+ target::TypedData::InstanceSize() +
+ target::ObjectAlignment::kObjectAlignment - 1;
+ __ leal(EDI, Address(EDI, scale_factor, fixed_size_plus_alignment_padding));
+ __ andl(EDI, Immediate(-target::ObjectAlignment::kObjectAlignment));
+ __ movl(EAX, Address(THR, target::Thread::top_offset()));
+ __ movl(EBX, EAX);
+ /* EDI: allocation size. */
+ __ addl(EBX, EDI);
+ __ j(CARRY, &call_runtime);
+
+ /* Check if the allocation fits into the remaining space. */
+ /* EAX: potential new object start. */
+ /* EBX: potential next object start. */
+ /* EDI: allocation size. */
+ __ cmpl(EBX, Address(THR, target::Thread::end_offset()));
+ __ j(ABOVE_EQUAL, &call_runtime);
+
+ /* Successfully allocated the object(s), now update top to point to */
+ /* next object start and initialize the object. */
+ __ movl(Address(THR, target::Thread::top_offset()), EBX);
+ __ addl(EAX, Immediate(kHeapObjectTag));
+
+ /* Initialize the tags. */
+ /* EAX: new object start as a tagged pointer. */
+ /* EBX: new object end address. */
+ /* EDI: allocation size. */
+ {
+ Label size_tag_overflow, done;
+ __ cmpl(EDI, Immediate(target::ObjectLayout::kSizeTagMaxSizeTag));
+ __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump);
+ __ shll(EDI, Immediate(target::ObjectLayout::kTagBitsSizeTagPos -
+ target::ObjectAlignment::kObjectAlignmentLog2));
+ __ jmp(&done, Assembler::kNearJump);
+ __ Bind(&size_tag_overflow);
+ __ movl(EDI, Immediate(0));
+ __ Bind(&done);
+ /* Get the class index and insert it into the tags. */
+ uint32_t tags =
+ target::MakeTagWordForNewSpaceObject(cid, /*instance_size=*/0);
+ __ orl(EDI, Immediate(tags));
+ __ movl(FieldAddress(EAX, target::Object::tags_offset()), EDI); /* Tags. */
+ }
+
+ /* Set the length field. */
+ /* EAX: new object start as a tagged pointer. */
+ /* EBX: new object end address. */
+ __ popl(EDI); /* Array length. */
+ __ StoreIntoObjectNoBarrier(
+ EAX, FieldAddress(EAX, target::TypedDataBase::length_offset()), EDI);
+
+ /* Initialize all array elements to 0. */
+ /* EAX: new object start as a tagged pointer. */
+ /* EBX: new object end address. */
+ /* EDI: iterator which initially points to the start of the variable */
+ /* ECX: scratch register. */
+ /* data area to be initialized. */
+ __ xorl(ECX, ECX); /* Zero. */
+ __ leal(EDI, FieldAddress(EAX, target::TypedData::InstanceSize()));
+ __ StoreInternalPointer(
+ EAX, FieldAddress(EAX, target::TypedDataBase::data_field_offset()), EDI);
+ Label done, init_loop;
+ __ Bind(&init_loop);
+ __ cmpl(EDI, EBX);
+ __ j(ABOVE_EQUAL, &done, Assembler::kNearJump);
+ __ movl(Address(EDI, 0), ECX);
+ __ addl(EDI, Immediate(target::kWordSize));
+ __ jmp(&init_loop, Assembler::kNearJump);
+ __ Bind(&done);
+
+ __ ret();
+
+ __ Bind(&call_runtime);
+ __ popl(EDI); // Array length
+ __ EnterStubFrame();
+ __ PushObject(Object::null_object()); // Make room for the result.
+ __ pushl(Immediate(target::ToRawSmi(cid)));
+ __ pushl(EDI); // Array length
+ __ CallRuntime(kAllocateTypedDataRuntimeEntry, 2);
+ __ Drop(2); // Drop arguments.
+ __ popl(AllocateTypedDataArrayABI::kResultReg);
+ __ LeaveStubFrame();
+ __ ret();
+}
+
} // namespace compiler
} // namespace dart
diff --git a/runtime/vm/compiler/stub_code_compiler_x64.cc b/runtime/vm/compiler/stub_code_compiler_x64.cc
index e7011d0..c5eeb8a 100644
--- a/runtime/vm/compiler/stub_code_compiler_x64.cc
+++ b/runtime/vm/compiler/stub_code_compiler_x64.cc
@@ -4007,6 +4007,143 @@
GenerateInstantiateTypeArgumentsStub(assembler);
}
+static ScaleFactor GetScaleFactor(intptr_t size) {
+ switch (size) {
+ case 1:
+ return TIMES_1;
+ case 2:
+ return TIMES_2;
+ case 4:
+ return TIMES_4;
+ case 8:
+ return TIMES_8;
+ case 16:
+ return TIMES_16;
+ }
+ UNREACHABLE();
+ return static_cast<ScaleFactor>(0);
+}
+
+void StubCodeCompiler::GenerateAllocateTypedDataArrayStub(Assembler* assembler,
+ intptr_t cid) {
+ const intptr_t element_size = TypedDataElementSizeInBytes(cid);
+ const intptr_t max_len = TypedDataMaxNewSpaceElements(cid);
+ ScaleFactor scale_factor = GetScaleFactor(element_size);
+
+ COMPILE_ASSERT(AllocateTypedDataArrayABI::kLengthReg == RAX);
+ COMPILE_ASSERT(AllocateTypedDataArrayABI::kResultReg == RAX);
+
+ // Save length argument for possible runtime call, as
+ // RAX is clobbered.
+ Label call_runtime;
+ __ pushq(AllocateTypedDataArrayABI::kLengthReg);
+
+ NOT_IN_PRODUCT(__ MaybeTraceAllocation(cid, &call_runtime, false));
+ __ movq(RDI, AllocateTypedDataArrayABI::kLengthReg);
+ /* Check that length is a positive Smi. */
+ /* RDI: requested array length argument. */
+ __ testq(RDI, Immediate(kSmiTagMask));
+ __ j(NOT_ZERO, &call_runtime);
+ __ cmpq(RDI, Immediate(0));
+ __ j(LESS, &call_runtime);
+ __ SmiUntag(RDI);
+ /* Check for maximum allowed length. */
+ /* RDI: untagged array length. */
+ __ cmpq(RDI, Immediate(max_len));
+ __ j(GREATER, &call_runtime);
+ /* Special case for scaling by 16. */
+ if (scale_factor == TIMES_16) {
+ /* double length of array. */
+ __ addq(RDI, RDI);
+ /* only scale by 8. */
+ scale_factor = TIMES_8;
+ }
+ const intptr_t fixed_size_plus_alignment_padding =
+ target::TypedData::InstanceSize() +
+ target::ObjectAlignment::kObjectAlignment - 1;
+ __ leaq(RDI, Address(RDI, scale_factor, fixed_size_plus_alignment_padding));
+ __ andq(RDI, Immediate(-target::ObjectAlignment::kObjectAlignment));
+ __ movq(RAX, Address(THR, target::Thread::top_offset()));
+ __ movq(RCX, RAX);
+
+ /* RDI: allocation size. */
+ __ addq(RCX, RDI);
+ __ j(CARRY, &call_runtime);
+
+ /* Check if the allocation fits into the remaining space. */
+ /* RAX: potential new object start. */
+ /* RCX: potential next object start. */
+ /* RDI: allocation size. */
+ __ cmpq(RCX, Address(THR, target::Thread::end_offset()));
+ __ j(ABOVE_EQUAL, &call_runtime);
+
+ /* Successfully allocated the object(s), now update top to point to */
+ /* next object start and initialize the object. */
+ __ movq(Address(THR, target::Thread::top_offset()), RCX);
+ __ addq(RAX, Immediate(kHeapObjectTag));
+ /* Initialize the tags. */
+ /* RAX: new object start as a tagged pointer. */
+ /* RCX: new object end address. */
+ /* RDI: allocation size. */
+ /* R13: scratch register. */
+ {
+ Label size_tag_overflow, done;
+ __ cmpq(RDI, Immediate(target::ObjectLayout::kSizeTagMaxSizeTag));
+ __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump);
+ __ shlq(RDI, Immediate(target::ObjectLayout::kTagBitsSizeTagPos -
+ target::ObjectAlignment::kObjectAlignmentLog2));
+ __ jmp(&done, Assembler::kNearJump);
+
+ __ Bind(&size_tag_overflow);
+ __ LoadImmediate(RDI, Immediate(0));
+ __ Bind(&done);
+
+ /* Get the class index and insert it into the tags. */
+ uint32_t tags =
+ target::MakeTagWordForNewSpaceObject(cid, /*instance_size=*/0);
+ __ orq(RDI, Immediate(tags));
+ __ movq(FieldAddress(RAX, target::Object::tags_offset()), RDI); /* Tags. */
+ }
+ /* Set the length field. */
+ /* RAX: new object start as a tagged pointer. */
+ /* RCX: new object end address. */
+ __ popq(RDI); /* Array length. */
+ __ StoreIntoObjectNoBarrier(
+ RAX, FieldAddress(RAX, target::TypedDataBase::length_offset()), RDI);
+ /* Initialize all array elements to 0. */
+ /* RAX: new object start as a tagged pointer. */
+ /* RCX: new object end address. */
+ /* RDI: iterator which initially points to the start of the variable */
+ /* RBX: scratch register. */
+ /* data area to be initialized. */
+ __ xorq(RBX, RBX); /* Zero. */
+ __ leaq(RDI, FieldAddress(RAX, target::TypedData::InstanceSize()));
+ __ StoreInternalPointer(
+ RAX, FieldAddress(RAX, target::TypedDataBase::data_field_offset()), RDI);
+ Label done, init_loop;
+ __ Bind(&init_loop);
+ __ cmpq(RDI, RCX);
+ __ j(ABOVE_EQUAL, &done, Assembler::kNearJump);
+ __ movq(Address(RDI, 0), RBX);
+ __ addq(RDI, Immediate(target::kWordSize));
+ __ jmp(&init_loop, Assembler::kNearJump);
+ __ Bind(&done);
+
+ __ ret();
+
+ __ Bind(&call_runtime);
+ __ popq(RDI); // Array length
+ __ EnterStubFrame();
+ __ PushObject(Object::null_object()); // Make room for the result.
+ __ PushImmediate(Immediate(target::ToRawSmi(cid)));
+ __ pushq(RDI); // Array length
+ __ CallRuntime(kAllocateTypedDataRuntimeEntry, 2);
+ __ Drop(2); // Drop arguments.
+ __ popq(AllocateTypedDataArrayABI::kResultReg);
+ __ LeaveStubFrame();
+ __ ret();
+}
+
} // namespace compiler
} // namespace dart
diff --git a/runtime/vm/constants_arm.h b/runtime/vm/constants_arm.h
index 2c62815..96d7905 100644
--- a/runtime/vm/constants_arm.h
+++ b/runtime/vm/constants_arm.h
@@ -394,6 +394,12 @@
static const Register kTempReg = R1;
};
+// ABI for Allocate<TypedData>ArrayStub.
+struct AllocateTypedDataArrayABI {
+ static const Register kLengthReg = R4;
+ static const Register kResultReg = R0;
+};
+
// TODO(regis): Add ABIs for type testing stubs and is-type test stubs instead
// of reusing the constants of the instantiation stubs ABI.
diff --git a/runtime/vm/constants_arm64.h b/runtime/vm/constants_arm64.h
index b5340bb..d433699 100644
--- a/runtime/vm/constants_arm64.h
+++ b/runtime/vm/constants_arm64.h
@@ -226,6 +226,12 @@
static const Register kTempReg = R1;
};
+// ABI for Allocate<TypedData>ArrayStub.
+struct AllocateTypedDataArrayABI {
+ static const Register kLengthReg = R4;
+ static const Register kResultReg = R0;
+};
+
// TODO(regis): Add ABIs for type testing stubs and is-type test stubs instead
// of reusing the constants of the instantiation stubs ABI.
diff --git a/runtime/vm/constants_ia32.h b/runtime/vm/constants_ia32.h
index ff82b2f..b90a121 100644
--- a/runtime/vm/constants_ia32.h
+++ b/runtime/vm/constants_ia32.h
@@ -158,6 +158,12 @@
static const Register kIndexReg = EBX;
};
+// ABI for Allocate<TypedData>ArrayStub.
+struct AllocateTypedDataArrayABI {
+ static const Register kLengthReg = EAX;
+ static const Register kResultReg = EAX;
+};
+
typedef uint32_t RegList;
const RegList kAllCpuRegistersList = 0xFF;
diff --git a/runtime/vm/constants_x64.h b/runtime/vm/constants_x64.h
index 218823e..7b6e90d 100644
--- a/runtime/vm/constants_x64.h
+++ b/runtime/vm/constants_x64.h
@@ -207,6 +207,12 @@
static const Register kTempReg = RBX;
};
+// ABI for Allocate<TypedData>ArrayStub.
+struct AllocateTypedDataArrayABI {
+ static const Register kLengthReg = RAX;
+ static const Register kResultReg = RAX;
+};
+
// Registers used inside the implementation of type testing stubs.
struct TTSInternalRegs {
static const Register kInstanceTypeArgumentsReg = RSI;
diff --git a/runtime/vm/interpreter.cc b/runtime/vm/interpreter.cc
index 97b58f5..38a0159 100644
--- a/runtime/vm/interpreter.cc
+++ b/runtime/vm/interpreter.cc
@@ -10,6 +10,7 @@
#include "vm/interpreter.h"
+#include "vm/class_id.h"
#include "vm/compiler/api/type_check_mode.h"
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/assembler/disassembler_kbc.h"
@@ -2282,6 +2283,17 @@
case MethodRecognizer::kFfiAbi: {
*++SP = Smi::New(static_cast<int64_t>(compiler::ffi::TargetAbi()));
} break;
+#define TYPED_DATA_FACTORY(clazz) \
+ case MethodRecognizer::kTypedData_##clazz##_factory: { \
+ ObjectPtr length = SP[0]; \
+ SP[1] = Smi::New(kTypedData##clazz##Cid); \
+ SP[2] = length; \
+ Exit(thread, FP, SP + 3, pc); \
+ INVOKE_RUNTIME(DRT_AllocateTypedData, \
+ NativeArguments(thread, 2, SP + 1, SP)); \
+ } break;
+ CLASS_LIST_TYPED_DATA(TYPED_DATA_FACTORY)
+#undef TYPED_DATA_FACTORY
default: {
NativeEntryData::Payload* payload =
NativeEntryData::FromTypedArray(data);
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 9e253e3..e81f325 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -14078,10 +14078,6 @@
all_libs.Add(&Library::ZoneHandle(Library::MathLibrary()));
MATH_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS2);
- all_libs.Clear();
- all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary()));
- TYPED_DATA_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS2);
-
#undef CHECK_FINGERPRINTS
#undef CHECK_FINGERPRINTS2
@@ -14095,7 +14091,9 @@
func.CheckSourceFingerprint(fp) && fingerprints_match; \
}
+ all_libs.Clear();
all_libs.Add(&Library::ZoneHandle(Library::CoreLibrary()));
+ all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary()));
RECOGNIZED_LIST_FACTORY_LIST(CHECK_FACTORY_FINGERPRINTS);
#undef CHECK_FACTORY_FINGERPRINTS
diff --git a/runtime/vm/object_store.h b/runtime/vm/object_store.h
index f8046bd..05f290c 100644
--- a/runtime/vm/object_store.h
+++ b/runtime/vm/object_store.h
@@ -193,6 +193,20 @@
RW(Code, stack_overflow_stub_with_fpu_regs_stub) \
RW(Code, stack_overflow_stub_without_fpu_regs_stub) \
RW(Code, allocate_array_stub) \
+ RW(Code, allocate_int8_array_stub) \
+ RW(Code, allocate_uint8_array_stub) \
+ RW(Code, allocate_uint8_clamped_array_stub) \
+ RW(Code, allocate_int16_array_stub) \
+ RW(Code, allocate_uint16_array_stub) \
+ RW(Code, allocate_int32_array_stub) \
+ RW(Code, allocate_uint32_array_stub) \
+ RW(Code, allocate_int64_array_stub) \
+ RW(Code, allocate_uint64_array_stub) \
+ RW(Code, allocate_float32_array_stub) \
+ RW(Code, allocate_float64_array_stub) \
+ RW(Code, allocate_float32x4_array_stub) \
+ RW(Code, allocate_int32x4_array_stub) \
+ RW(Code, allocate_float64x2_array_stub) \
RW(Code, allocate_context_stub) \
RW(Code, allocate_object_stub) \
RW(Code, allocate_object_parametrized_stub) \
@@ -244,6 +258,20 @@
DO(stack_overflow_stub_without_fpu_regs_stub, \
StackOverflowSharedWithoutFPURegs) \
DO(allocate_array_stub, AllocateArray) \
+ DO(allocate_int8_array_stub, AllocateInt8Array) \
+ DO(allocate_uint8_array_stub, AllocateUint8Array) \
+ DO(allocate_uint8_clamped_array_stub, AllocateUint8ClampedArray) \
+ DO(allocate_int16_array_stub, AllocateInt16Array) \
+ DO(allocate_uint16_array_stub, AllocateUint16Array) \
+ DO(allocate_int32_array_stub, AllocateInt32Array) \
+ DO(allocate_uint32_array_stub, AllocateUint32Array) \
+ DO(allocate_int64_array_stub, AllocateInt64Array) \
+ DO(allocate_uint64_array_stub, AllocateUint64Array) \
+ DO(allocate_float32_array_stub, AllocateFloat32Array) \
+ DO(allocate_float64_array_stub, AllocateFloat64Array) \
+ DO(allocate_float32x4_array_stub, AllocateFloat32x4Array) \
+ DO(allocate_int32x4_array_stub, AllocateInt32x4Array) \
+ DO(allocate_float64x2_array_stub, AllocateFloat64x2Array) \
DO(allocate_context_stub, AllocateContext) \
DO(allocate_object_stub, AllocateObject) \
DO(allocate_object_parametrized_stub, AllocateObjectParameterized) \
diff --git a/runtime/vm/profiler_test.cc b/runtime/vm/profiler_test.cc
index e3dfb07..1ff4b49 100644
--- a/runtime/vm/profiler_test.cc
+++ b/runtime/vm/profiler_test.cc
@@ -1203,13 +1203,15 @@
EXPECT_EQ(1, profile.sample_count());
ProfileStackWalker walker(&profile);
- EXPECT_STREQ("TypedData_Float32Array_new", walker.VMTagName());
+ EXPECT_STREQ("DRT_AllocateTypedData", walker.VMTagName());
if (FLAG_enable_interpreter) {
EXPECT_STREQ("[Bytecode] new Float32List", walker.CurrentName());
EXPECT(walker.Down());
EXPECT_STREQ("[Bytecode] foo", walker.CurrentName());
EXPECT(!walker.Down());
} else {
+ EXPECT_STREQ("[Stub] AllocateFloat32Array", walker.CurrentName());
+ EXPECT(walker.Down());
EXPECT_STREQ("[Unoptimized] new Float32List", walker.CurrentName());
EXPECT(walker.Down());
EXPECT_STREQ("[Unoptimized] foo", walker.CurrentName());
diff --git a/runtime/vm/runtime_entry.cc b/runtime/vm/runtime_entry.cc
index 1d18cae..685c039 100644
--- a/runtime/vm/runtime_entry.cc
+++ b/runtime/vm/runtime_entry.cc
@@ -303,6 +303,32 @@
array.SetTypeArguments(element_type); // May be null.
}
+// Allocate typed data array of given class id and length.
+// Arg0: class id.
+// Arg1: number of elements.
+// Return value: newly allocated typed data array.
+DEFINE_RUNTIME_ENTRY(AllocateTypedData, 2) {
+ const intptr_t cid = Smi::CheckedHandle(zone, arguments.ArgAt(0)).Value();
+ const auto& length = Instance::CheckedHandle(zone, arguments.ArgAt(1));
+ if (!length.IsInteger()) {
+ const Array& args = Array::Handle(zone, Array::New(1));
+ args.SetAt(0, length);
+ Exceptions::ThrowByType(Exceptions::kArgument, args);
+ }
+ const int64_t len = Integer::Cast(length).AsInt64Value();
+ const intptr_t max = TypedData::MaxElements(cid);
+ if (len < 0) {
+ Exceptions::ThrowRangeError("length", Integer::Cast(length), 0, max);
+ } else if (len > max) {
+ const Instance& exception = Instance::Handle(
+ zone, thread->isolate()->object_store()->out_of_memory());
+ Exceptions::Throw(thread, exception);
+ }
+ const auto& typed_data =
+ TypedData::Handle(zone, TypedData::New(cid, static_cast<intptr_t>(len)));
+ arguments.SetReturn(typed_data);
+}
+
// Helper returning the token position of the Dart caller.
static TokenPosition GetCallerLocation() {
DartFrameIterator iterator(Thread::Current(),
diff --git a/runtime/vm/runtime_entry_list.h b/runtime/vm/runtime_entry_list.h
index c514b573..394c01d 100644
--- a/runtime/vm/runtime_entry_list.h
+++ b/runtime/vm/runtime_entry_list.h
@@ -9,6 +9,7 @@
#define RUNTIME_ENTRY_LIST(V) \
V(AllocateArray) \
+ V(AllocateTypedData) \
V(AllocateContext) \
V(AllocateObject) \
V(AllocateSubtypeTestCache) \
diff --git a/runtime/vm/stub_code.cc b/runtime/vm/stub_code.cc
index 1c9ff6c6..92d8c6c 100644
--- a/runtime/vm/stub_code.cc
+++ b/runtime/vm/stub_code.cc
@@ -260,6 +260,42 @@
return stub.raw();
}
+CodePtr StubCode::GetAllocationStubForTypedData(classid_t class_id) {
+ auto object_store = Thread::Current()->isolate()->object_store();
+ switch (class_id) {
+ case kTypedDataInt8ArrayCid:
+ return object_store->allocate_int8_array_stub();
+ case kTypedDataUint8ArrayCid:
+ return object_store->allocate_uint8_array_stub();
+ case kTypedDataUint8ClampedArrayCid:
+ return object_store->allocate_uint8_clamped_array_stub();
+ case kTypedDataInt16ArrayCid:
+ return object_store->allocate_int16_array_stub();
+ case kTypedDataUint16ArrayCid:
+ return object_store->allocate_uint16_array_stub();
+ case kTypedDataInt32ArrayCid:
+ return object_store->allocate_int32_array_stub();
+ case kTypedDataUint32ArrayCid:
+ return object_store->allocate_uint32_array_stub();
+ case kTypedDataInt64ArrayCid:
+ return object_store->allocate_int64_array_stub();
+ case kTypedDataUint64ArrayCid:
+ return object_store->allocate_uint64_array_stub();
+ case kTypedDataFloat32ArrayCid:
+ return object_store->allocate_float32_array_stub();
+ case kTypedDataFloat64ArrayCid:
+ return object_store->allocate_float64_array_stub();
+ case kTypedDataFloat32x4ArrayCid:
+ return object_store->allocate_float32x4_array_stub();
+ case kTypedDataInt32x4ArrayCid:
+ return object_store->allocate_int32x4_array_stub();
+ case kTypedDataFloat64x2ArrayCid:
+ return object_store->allocate_float64x2_array_stub();
+ }
+ UNREACHABLE();
+ return Code::null();
+}
+
#if !defined(TARGET_ARCH_IA32)
CodePtr StubCode::GetBuildMethodExtractorStub(
compiler::ObjectPoolBuilder* pool) {
diff --git a/runtime/vm/stub_code.h b/runtime/vm/stub_code.h
index 19fd413..016b845 100644
--- a/runtime/vm/stub_code.h
+++ b/runtime/vm/stub_code.h
@@ -62,6 +62,7 @@
#undef STUB_CODE_ACCESSOR
static CodePtr GetAllocationStubForClass(const Class& cls);
+ static CodePtr GetAllocationStubForTypedData(classid_t class_id);
#if !defined(TARGET_ARCH_IA32)
static CodePtr GetBuildMethodExtractorStub(compiler::ObjectPoolBuilder* pool);
diff --git a/runtime/vm/stub_code_list.h b/runtime/vm/stub_code_list.h
index e38740c..395676c 100644
--- a/runtime/vm/stub_code_list.h
+++ b/runtime/vm/stub_code_list.h
@@ -18,6 +18,20 @@
V(WriteBarrierWrappers) \
V(ArrayWriteBarrier) \
V(AllocateArray) \
+ V(AllocateInt8Array) \
+ V(AllocateUint8Array) \
+ V(AllocateUint8ClampedArray) \
+ V(AllocateInt16Array) \
+ V(AllocateUint16Array) \
+ V(AllocateInt32Array) \
+ V(AllocateUint32Array) \
+ V(AllocateInt64Array) \
+ V(AllocateUint64Array) \
+ V(AllocateFloat32Array) \
+ V(AllocateFloat64Array) \
+ V(AllocateFloat32x4Array) \
+ V(AllocateInt32x4Array) \
+ V(AllocateFloat64x2Array) \
V(AllocateMintSharedWithFPURegs) \
V(AllocateMintSharedWithoutFPURegs) \
V(AllocateContext) \
diff --git a/sdk/lib/_internal/vm/lib/typed_data_patch.dart b/sdk/lib/_internal/vm/lib/typed_data_patch.dart
index 6d0cc5a..ccd3183 100644
--- a/sdk/lib/_internal/vm/lib/typed_data_patch.dart
+++ b/sdk/lib/_internal/vm/lib/typed_data_patch.dart
@@ -2146,6 +2146,7 @@
class Int8List {
@patch
@pragma("vm:exact-result-type", _Int8List)
+ @pragma("vm:prefer-inline")
factory Int8List(int length) native "TypedData_Int8Array_new";
@patch
@@ -2194,6 +2195,7 @@
class Uint8List {
@patch
@pragma("vm:exact-result-type", _Uint8List)
+ @pragma("vm:prefer-inline")
factory Uint8List(int length) native "TypedData_Uint8Array_new";
@patch
@@ -2242,6 +2244,7 @@
class Uint8ClampedList {
@patch
@pragma("vm:exact-result-type", _Uint8ClampedList)
+ @pragma("vm:prefer-inline")
factory Uint8ClampedList(int length) native "TypedData_Uint8ClampedArray_new";
@patch
@@ -2290,6 +2293,7 @@
class Int16List {
@patch
@pragma("vm:exact-result-type", _Int16List)
+ @pragma("vm:prefer-inline")
factory Int16List(int length) native "TypedData_Int16Array_new";
@patch
@@ -2358,6 +2362,7 @@
class Uint16List {
@patch
@pragma("vm:exact-result-type", _Uint16List)
+ @pragma("vm:prefer-inline")
factory Uint16List(int length) native "TypedData_Uint16Array_new";
@patch
@@ -2426,6 +2431,7 @@
class Int32List {
@patch
@pragma("vm:exact-result-type", _Int32List)
+ @pragma("vm:prefer-inline")
factory Int32List(int length) native "TypedData_Int32Array_new";
@patch
@@ -2481,6 +2487,7 @@
class Uint32List {
@patch
@pragma("vm:exact-result-type", _Uint32List)
+ @pragma("vm:prefer-inline")
factory Uint32List(int length) native "TypedData_Uint32Array_new";
@patch
@@ -2536,6 +2543,7 @@
class Int64List {
@patch
@pragma("vm:exact-result-type", _Int64List)
+ @pragma("vm:prefer-inline")
factory Int64List(int length) native "TypedData_Int64Array_new";
@patch
@@ -2591,6 +2599,7 @@
class Uint64List {
@patch
@pragma("vm:exact-result-type", _Uint64List)
+ @pragma("vm:prefer-inline")
factory Uint64List(int length) native "TypedData_Uint64Array_new";
@patch
@@ -2646,6 +2655,7 @@
class Float32List {
@patch
@pragma("vm:exact-result-type", _Float32List)
+ @pragma("vm:prefer-inline")
factory Float32List(int length) native "TypedData_Float32Array_new";
@patch
@@ -2702,6 +2712,7 @@
class Float64List {
@patch
@pragma("vm:exact-result-type", _Float64List)
+ @pragma("vm:prefer-inline")
factory Float64List(int length) native "TypedData_Float64Array_new";
@patch
@@ -2758,6 +2769,7 @@
class Float32x4List {
@patch
@pragma("vm:exact-result-type", _Float32x4List)
+ @pragma("vm:prefer-inline")
factory Float32x4List(int length) native "TypedData_Float32x4Array_new";
@patch
@@ -2813,6 +2825,7 @@
class Int32x4List {
@patch
@pragma("vm:exact-result-type", _Int32x4List)
+ @pragma("vm:prefer-inline")
factory Int32x4List(int length) native "TypedData_Int32x4Array_new";
@patch
@@ -2868,6 +2881,7 @@
class Float64x2List {
@patch
@pragma("vm:exact-result-type", _Float64x2List)
+ @pragma("vm:prefer-inline")
factory Float64x2List(int length) native "TypedData_Float64x2Array_new";
@patch
diff --git a/tools/VERSION b/tools/VERSION
index d005fb6..941fd96 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 10
PATCH 0
-PRERELEASE 132
+PRERELEASE 133
PRERELEASE_PATCH 0
\ No newline at end of file
diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json
index 2b30212..12b54ed 100644
--- a/tools/bots/test_matrix.json
+++ b/tools/bots/test_matrix.json
@@ -365,6 +365,7 @@
"pkg/status_file/",
"pkg/test_runner/",
"pkg/vm/",
+ "pkg/vm_snapshot_analysis/",
"runtime/",
"sdk/",
".dart_tool/package_config.json",