mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
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:
parent
5be332038b
commit
a8e6c79472
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -13,3 +13,4 @@
|
||||
|
||||
true
|
||||
false
|
||||
true
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user