Skip to content

Commit 95cc715

Browse files
rmacnak-googlecommit-bot@chromium.org
authored andcommitted
Reapply "[vm, compiler] Fix incorrect derivation of a concrete cid from FutureOr."
Work around checked-mode bug where parameter type checks don't dominate all uses. Test: lib_2/mirrors/invocation_fuzz_test/smi co19/LibTest/isolate/Isolate/spawn_A02_t06 Bug: dart-lang#34128 Change-Id: Ic51b0429d1b2b648042abad18b1acc25c1af60c0 Reviewed-on: https://dart-review.googlesource.com/70460 Reviewed-by: Alexander Markov <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent 7749b86 commit 95cc715

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

assembler_arm.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,12 @@ void Assembler::StoreIntoObjectFilter(Register object,
15481548
// And the result with the negated space bit of the object.
15491549
bic(IP, IP, Operand(object));
15501550
} else {
1551+
#if defined(DEBUG)
1552+
Label okay;
1553+
BranchIfNotSmi(value, &okay);
1554+
Stop("Unexpected Smi!");
1555+
Bind(&okay);
1556+
#endif
15511557
bic(IP, value, Operand(object));
15521558
}
15531559
tst(IP, Operand(kNewObjectAlignmentOffset));

assembler_arm64.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,12 @@ void Assembler::StoreIntoObjectFilter(Register object,
915915
// Write-barrier triggers if the value is in the new space (has bit set) and
916916
// the object is in the old space (has bit cleared).
917917
if (value_can_be_smi == kValueIsNotSmi) {
918+
#if defined(DEBUG)
919+
Label okay;
920+
BranchIfNotSmi(value, &okay);
921+
Stop("Unexpected Smi!");
922+
Bind(&okay);
923+
#endif
918924
// To check that, we compute value & ~object and skip the write barrier
919925
// if the bit is not set. We can't destroy the object.
920926
bic(TMP, value, Operand(object));
@@ -954,7 +960,7 @@ void Assembler::StoreIntoObject(Register object,
954960
ASSERT(object != value);
955961
str(value, dest);
956962
Label done;
957-
StoreIntoObjectFilter(object, value, &done, kValueCanBeSmi, kJumpToNoUpdate);
963+
StoreIntoObjectFilter(object, value, &done, can_be_smi, kJumpToNoUpdate);
958964
if (!lr_reserved) Push(LR);
959965
ldr(LR, Address(THR, Thread::update_store_buffer_wrappers_offset(object)));
960966
blr(LR);

assembler_ia32.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,6 +1840,12 @@ void Assembler::StoreIntoObjectFilter(Register object,
18401840
CanBeSmi can_be_smi,
18411841
BarrierFilterMode how_to_jump) {
18421842
if (can_be_smi == kValueIsNotSmi) {
1843+
#if defined(DEBUG)
1844+
Label okay;
1845+
BranchIfNotSmi(value, &okay);
1846+
Stop("Unexpected Smi!");
1847+
Bind(&okay);
1848+
#endif
18431849
COMPILE_ASSERT((kNewObjectAlignmentOffset == kWordSize) &&
18441850
(kOldObjectAlignmentOffset == 0));
18451851
// Write-barrier triggers if the value is in the new space (has bit set) and

assembler_x64.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,12 @@ void Assembler::StoreIntoObjectFilter(Register object,
12241224
(kOldObjectAlignmentOffset == 0));
12251225

12261226
if (can_be_smi == kValueIsNotSmi) {
1227+
#if defined(DEBUG)
1228+
Label okay;
1229+
BranchIfNotSmi(value, &okay);
1230+
Stop("Unexpected Smi!");
1231+
Bind(&okay);
1232+
#endif
12271233
// Write-barrier triggers if the value is in the new space (has bit set) and
12281234
// the object is in the old space (has bit cleared).
12291235
// To check that we could compute value & ~object and skip the write barrier

0 commit comments

Comments
 (0)