Fix bug of creating collection objects

Modified newobjectstubbuilder:createjscollectioniterator (Changed memory attribute of variable linked in createjscollectioniterator to non-share);
Added one more method to memoryattribute;
Add test case (Modified aottest/setobjwithproto).

Issue:  IALSOA
Signed-off-by: mothbuzzing <liuyuyan7@h-partners.com>
This commit is contained in:
MothBuzzing 2024-08-22 16:13:06 +08:00
parent 5be332038b
commit a8e6c79472
4 changed files with 20 additions and 2 deletions

View File

@ -375,6 +375,11 @@ public:
return Create(NOT_ATOMIC, NEED_BARRIER);
}
static MemoryAttribute UnknownBarrier()
{
return Create(NOT_ATOMIC, UNKNOWN_BARRIER);
}
static MemoryAttribute DefaultWithShareBarrier()
{
return Create(NOT_ATOMIC, UNKNOWN_BARRIER, SHARED);

View File

@ -2075,7 +2075,7 @@ void NewObjectStubBuilder::CreateJSCollectionIterator(
// SetIterated
GateRef iteratorOffset = IntPtr(iterOffset);
Store(VariableType::JS_POINTER(), glue_, result->ReadVariable(), iteratorOffset, linked,
MemoryAttribute::NeedBarrier());
MemoryAttribute::UnknownBarrier());
// SetIteratorNextIndex
GateRef nextIndexOffset = IntPtr(IteratorType::NEXT_INDEX_OFFSET);

View File

@ -13,3 +13,4 @@
true
false
true

View File

@ -20,4 +20,16 @@ var obj ={
__proto__: proto
}
print(obj.__proto__ == proto)
print(obj.__proto__ == proto2);
print(obj.__proto__ == proto2);
class C12 extends Set {
}
const v13 = new C12();
const o59 = {
__proto__: v13,
};
try {
o59.values();
} catch (error) {
print(o59.__proto__ == v13);
}