mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-24 02:30:03 +00:00
!7641 TypedArray.of IR do not consider thisValue is a Derived
Merge pull request !7641 from 贺存茂/TypedArrayof0602
This commit is contained in:
commit
e4156293ae
@ -2468,6 +2468,7 @@ void BuiltinsTypedArrayStubBuilder::Of(GateRef glue, GateRef thisValue,
|
||||
Label thisExists(env);
|
||||
Label isEcmaObject(env);
|
||||
Label isConstructor(env);
|
||||
Label notDerived(env);
|
||||
Label thisObjIsECmaObject(env);
|
||||
Label thisObjIsFastTypedArray(env);
|
||||
Label defaultConstr(env);
|
||||
@ -2478,6 +2479,8 @@ void BuiltinsTypedArrayStubBuilder::Of(GateRef glue, GateRef thisValue,
|
||||
Bind(&isEcmaObject);
|
||||
BRANCH(IsConstructor(thisValue), &isConstructor, slowPath);
|
||||
Bind(&isConstructor);
|
||||
BRANCH(IsDerived(thisValue), slowPath, ¬Derived);
|
||||
Bind(¬Derived);
|
||||
// 3: maximum of numArgs
|
||||
BRANCH(Int32LessThanOrEqual(TruncPtrToInt32(numArgs), Int32(3)), &numArgsInRange, slowPath);
|
||||
Bind(&numArgsInRange);
|
||||
|
@ -195,3 +195,12 @@ true
|
||||
0 0 0 0 0 0 1 2 3
|
||||
-0 -0 0 0 1 2 3 NaN NaN
|
||||
-0 -0 0 0 1 2 3 NaN NaN
|
||||
Class extends Float64Array test success!
|
||||
Class extends Float32Array test success!
|
||||
Class extends Int32Array test success!
|
||||
Class extends Int16Array test success!
|
||||
Class extends Int8Array test success!
|
||||
Class extends Uint32Array test success!
|
||||
Class extends Uint16Array test success!
|
||||
Class extends Uint8Array test success!
|
||||
Class extends Uint8ClampedArray test success!
|
||||
|
@ -877,3 +877,21 @@ function prettyPrinted(value) {
|
||||
}
|
||||
return prettyPrint(value);
|
||||
}
|
||||
|
||||
[
|
||||
Float64Array,
|
||||
Float32Array,
|
||||
Int32Array,
|
||||
Int16Array,
|
||||
Int8Array,
|
||||
Uint32Array,
|
||||
Uint16Array,
|
||||
Uint8Array,
|
||||
Uint8ClampedArray
|
||||
].forEach(function(ctor, i) {
|
||||
class C extends ctor{
|
||||
|
||||
}
|
||||
C.of();
|
||||
print("Class extends "+ ctor.name + " test success!")
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user