Skip to content

Commit 438047c

Browse files
aamcommit-bot@chromium.org
authored and
commit-bot@chromium.org
committed
Reland "[vm/isolates] Introduce fast isolate spawn in AOT."
This reverts commit 922ea3e in patchset 1, fix for assertion triggered in https://ci.chromium.org/b/8883214567628884960 in patchset 2, fix for deadlock around symbols table mutex in patchset 4. Original commit description: Speed up is achieved by sharing most of the dart code, object store and class table between isolates in single isolate group. So instead of bootstrapping isolate from the snapshot, isolate is initialized by setting pointers to existing data structures already set up for first isolate, and only few isolate-specific structures (moved to newly introducted isolate_object_store) are created. To allow for safe cross-isolate switchable call site, type test cache mutations additional synchronization via RunWithStoppedMutators(that relies on safepoints) was added. Besides switchable call sites, no other mutation to the dart code is done in AOT, which allows such sharing. Bug: dart-lang#37835 Bug: dart-lang#36097 Change-Id: I655e337198214c9dfacbe76f7852b941b5a7e910 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143462 Commit-Queue: Alexander Aprelev <aam@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
1 parent 210d1fe commit 438047c

4 files changed

+12
-16
lines changed

assembler_arm.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -2004,8 +2004,8 @@ void Assembler::LoadClassId(Register result, Register object, Condition cond) {
20042004
void Assembler::LoadClassById(Register result, Register class_id) {
20052005
ASSERT(result != class_id);
20062006

2007-
const intptr_t table_offset = target::Isolate::class_table_offset() +
2008-
target::ClassTable::table_offset();
2007+
const intptr_t table_offset =
2008+
target::Isolate::cached_class_table_table_offset();
20092009

20102010
LoadIsolate(result);
20112011
LoadFromOffset(kWord, result, result, table_offset);
@@ -3529,8 +3529,7 @@ void Assembler::LoadAllocationStatsAddress(Register dest, intptr_t cid) {
35293529
ASSERT(cid > 0);
35303530

35313531
const intptr_t shared_table_offset =
3532-
target::Isolate::class_table_offset() +
3533-
target::ClassTable::shared_class_table_offset();
3532+
target::Isolate::shared_class_table_offset();
35343533
const intptr_t table_offset =
35353534
target::SharedClassTable::class_heap_stats_table_offset();
35363535
const intptr_t class_offset = target::ClassTable::ClassOffsetFor(cid);

assembler_arm64.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -1155,8 +1155,8 @@ void Assembler::LoadClassId(Register result, Register object) {
11551155
void Assembler::LoadClassById(Register result, Register class_id) {
11561156
ASSERT(result != class_id);
11571157

1158-
const intptr_t table_offset = target::Isolate::class_table_offset() +
1159-
target::ClassTable::table_offset();
1158+
const intptr_t table_offset =
1159+
target::Isolate::cached_class_table_table_offset();
11601160

11611161
LoadIsolate(result);
11621162
LoadFromOffset(result, result, table_offset);
@@ -1631,8 +1631,7 @@ void Assembler::MaybeTraceAllocation(intptr_t cid,
16311631
ASSERT(cid > 0);
16321632

16331633
const intptr_t shared_table_offset =
1634-
target::Isolate::class_table_offset() +
1635-
target::ClassTable::shared_class_table_offset();
1634+
target::Isolate::shared_class_table_offset();
16361635
const intptr_t table_offset =
16371636
target::SharedClassTable::class_heap_stats_table_offset();
16381637
const intptr_t class_offset = target::ClassTable::ClassOffsetFor(cid);

assembler_ia32.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -2409,8 +2409,7 @@ void Assembler::MaybeTraceAllocation(intptr_t cid,
24092409
Address state_address(kNoRegister, 0);
24102410

24112411
const intptr_t shared_table_offset =
2412-
target::Isolate::class_table_offset() +
2413-
target::ClassTable::shared_class_table_offset();
2412+
target::Isolate::shared_class_table_offset();
24142413
const intptr_t table_offset =
24152414
target::SharedClassTable::class_heap_stats_table_offset();
24162415
const intptr_t class_offset = target::ClassTable::ClassOffsetFor(cid);
@@ -2638,8 +2637,8 @@ void Assembler::LoadClassId(Register result, Register object) {
26382637
void Assembler::LoadClassById(Register result, Register class_id) {
26392638
ASSERT(result != class_id);
26402639

2641-
const intptr_t table_offset = target::Isolate::class_table_offset() +
2642-
target::ClassTable::table_offset();
2640+
const intptr_t table_offset =
2641+
target::Isolate::cached_class_table_table_offset();
26432642
LoadIsolate(result);
26442643
movl(result, Address(result, table_offset));
26452644
movl(result, Address(result, class_id, TIMES_4, 0));

assembler_x64.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -1864,8 +1864,7 @@ void Assembler::MaybeTraceAllocation(intptr_t cid,
18641864
bool near_jump) {
18651865
ASSERT(cid > 0);
18661866
const intptr_t shared_table_offset =
1867-
target::Isolate::class_table_offset() +
1868-
target::ClassTable::shared_class_table_offset();
1867+
target::Isolate::shared_class_table_offset();
18691868
const intptr_t table_offset =
18701869
target::SharedClassTable::class_heap_stats_table_offset();
18711870
const intptr_t class_offset = target::ClassTable::ClassOffsetFor(cid);
@@ -2139,8 +2138,8 @@ void Assembler::LoadClassId(Register result, Register object) {
21392138

21402139
void Assembler::LoadClassById(Register result, Register class_id) {
21412140
ASSERT(result != class_id);
2142-
const intptr_t table_offset = target::Isolate::class_table_offset() +
2143-
target::ClassTable::table_offset();
2141+
const intptr_t table_offset =
2142+
target::Isolate::cached_class_table_table_offset();
21442143

21452144
LoadIsolate(result);
21462145
movq(result, Address(result, table_offset));

0 commit comments

Comments
 (0)