From 7d118a6e0d847bcd7c0f5cfdb9bb66bae81d1442 Mon Sep 17 00:00:00 2001 From: liu-zelin Date: Tue, 6 Aug 2024 16:48:33 +0800 Subject: [PATCH] Rename Shared** to Sendable** Signed-off-by: liu-zelin --- Sources/FuzzilliCli/Profiles/ArkProfile.swift | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Sources/FuzzilliCli/Profiles/ArkProfile.swift b/Sources/FuzzilliCli/Profiles/ArkProfile.swift index 144d1c6..dd73609 100644 --- a/Sources/FuzzilliCli/Profiles/ArkProfile.swift +++ b/Sources/FuzzilliCli/Profiles/ArkProfile.swift @@ -44,7 +44,7 @@ fileprivate let ArkTSObjectInstanceGenerator = ValueGenerator("ArkTSObjectInstan /// ArkTS collections Generators fileprivate let ArkTSCollectionsObjectInstanceGenerator = ValueGenerator("ArkTSCollectionsObjectInstanceGenerator") { b, n in - let builtin = chooseUniform(from: ["SharedMap", "SharedSet", "SharedArray", "SendableArrayBuffer", "BitVector"]) + let builtin = chooseUniform(from: ["SendableMap", "SendableSet", "SendableArray", "SendableArrayBuffer", "BitVector"]) let constructor = b.loadBuiltin(builtin) b.construct(constructor) } @@ -54,7 +54,7 @@ fileprivate let ArkTsCollectionsTypedArrayValueGenerator = ValueGenerator("ArkTs let size = b.loadInt(b.randomSize(upTo: 0x1000)) let constructor = b.loadBuiltin( chooseUniform( - from: ["SharedUint8Array", "SharedInt8Array", "SharedUint16Array", "SharedInt16Array", "SharedUint32Array", "SharedInt32Array", "SharedUint8ClampedArray"] + from: ["SendableUint8Array", "SendableInt8Array", "SendableUint16Array", "SendableInt16Array", "SendableUint32Array", "SendableInt32Array", "SendableUint8ClampedArray"] ) ) b.construct(constructor, withArgs: [size]) @@ -98,11 +98,11 @@ fileprivate let plainArrayType = ILType.iterable + ILType.object(ofGroup: "Plain /// Tpye of a ArkTS CollectionsMap object -fileprivate let collectionsMap = ILType.iterable + ILType.object(ofGroup: "SharedMap", withProperties: ["size"], withMethods: ["entries", "keys", "values", "clear", "delete", "forEach", "get", "has", "set"]) +fileprivate let collectionsMap = ILType.iterable + ILType.object(ofGroup: "SendableMap", withProperties: ["size"], withMethods: ["entries", "keys", "values", "clear", "delete", "forEach", "get", "has", "set"]) /// Tpye of a ArkTS CollectionsSet object -fileprivate let collectionsSet = ILType.iterable + ILType.object(ofGroup: "SharedSet", withProperties: ["size"], withMethods: ["entries", "keys", "values", "clear", "delete", "forEach", "has", "add"]) +fileprivate let collectionsSet = ILType.iterable + ILType.object(ofGroup: "SendableSet", withProperties: ["size"], withMethods: ["entries", "keys", "values", "clear", "delete", "forEach", "has", "add"]) /// Tpye of a ArkTS CollectionsArray object -fileprivate let collectionsArray = ILType.iterable + ILType.object(ofGroup: "SharedArray", withProperties: ["length"], withMethods: ["create", "from", "pop", "push", "join", "shift", "unshift", "slice", "sort", "indexOf", "forEach", "map", "filter", "reduce", "at", "entries", "keys", "values", "find", "includes", "findIndex", "fill", "shrinkTo", "extendTo", "concat"]) +fileprivate let collectionsArray = ILType.iterable + ILType.object(ofGroup: "SendableArray", withProperties: ["length"], withMethods: ["create", "from", "pop", "push", "join", "shift", "unshift", "slice", "sort", "indexOf", "forEach", "map", "filter", "reduce", "at", "entries", "keys", "values", "find", "includes", "findIndex", "fill", "shrinkTo", "extendTo", "concat"]) /// Type of a ArkTS collectionsBuffer object. fileprivate let collectionsArrayBuffer = ILType.object(ofGroup: "SendableArrayBuffer", withProperties: ["byteLength"], withMethods: ["slice"]) /// Type of a ArkTs collectionsTypedArray object of the given variant. @@ -201,7 +201,7 @@ fileprivate let arkTSHashMaps = ObjectGroup( ///ObjectGroup modelling ArkTs Map objects fileprivate let collectionsMaps = ObjectGroup( - name: "SharedMap", + name: "SendableMap", instanceType: collectionsMap, properties: [ "size" : .number @@ -221,7 +221,7 @@ fileprivate let collectionsMaps = ObjectGroup( ///ObjectGroup modelling ArkTs Set objects fileprivate let collectionsSets = ObjectGroup( - name: "SharedSet", + name: "SendableSet", instanceType: collectionsSet, properties: [ "size" : .number @@ -241,7 +241,7 @@ fileprivate let collectionsSets = ObjectGroup( /// Object group modelling ArkTs arrays fileprivate let collectionsArrays = ObjectGroup( - name: "SharedArray", + name: "SendableArray", instanceType: collectionsArray, properties: [ "length" : .number, @@ -287,7 +287,7 @@ fileprivate let collectionsArrayBuffers = ObjectGroup( ] ) -/// ObjectGroup modelling ArkTs SharedTypedArray objects +/// ObjectGroup modelling ArkTs SendableTypedArray objects fileprivate func collectionsTypedArrays(_ variant: String) -> ObjectGroup { return ObjectGroup( name: variant, @@ -727,17 +727,17 @@ let arkProfile = Profile( "bgc" : .function([] => .undefined), "Stack" : arkTSStackConstructor, "HashMap" : arkTSHashMapConstructor, - "SharedMap" : collectionsMapConstructor, - "SharedSet" : collectionsSetConstructor, - "SharedArray" : collectionsArray, + "SendableMap" : collectionsMapConstructor, + "SendableSet" : collectionsSetConstructor, + "SendableArray" : collectionsArray, "SendableArrayBuffer" : collectionsArrayBuffer, - "SharedInt8Array" : collectionsTypedArrayConstructor("SharedInt8Array"), - "SharedUint8Array" : collectionsTypedArrayConstructor("SharedUint8Array"), - "SharedInt16Array" : collectionsTypedArrayConstructor("SharedInt16Array"), - "SharedUint16Array" : collectionsTypedArrayConstructor("SharedUint16Array"), - "SharedInt32Array" : collectionsTypedArrayConstructor("SharedInt32Array"), - "SharedUint32Array" : collectionsTypedArrayConstructor("SharedUint32Array"), - "SharedUint8ClampedArray" : collectionsTypedArrayConstructor("SharedUint8ClampedArray"), + "SendableInt8Array" : collectionsTypedArrayConstructor("SendableInt8Array"), + "SendableUint8Array" : collectionsTypedArrayConstructor("SendableUint8Array"), + "SendableInt16Array" : collectionsTypedArrayConstructor("SendableInt16Array"), + "SendableUint16Array" : collectionsTypedArrayConstructor("SendableUint16Array"), + "SendableInt32Array" : collectionsTypedArrayConstructor("SendableInt32Array"), + "SendableUint32Array" : collectionsTypedArrayConstructor("SendableUint32Array"), + "SendableUint8ClampedArray" : collectionsTypedArrayConstructor("SendableUint8ClampedArray"), "ASON" : arkTSASONObject, "HashSet" : arkTSHashSetConstructor, "LinkedList" : arkTSLinkedListConstructor, @@ -761,13 +761,13 @@ let arkProfile = Profile( collectionsArrays, collectionsArrayBuffers, collectionsBitVectors, - collectionsTypedArrays("SharedInt8Array"), - collectionsTypedArrays("SharedInt16Array"), - collectionsTypedArrays("SharedInt32Array"), - collectionsTypedArrays("SharedUint8Array"), - collectionsTypedArrays("SharedUint16Array"), - collectionsTypedArrays("SharedUint32Array"), - collectionsTypedArrays("SharedUint8ClampedArray"), + collectionsTypedArrays("SendableInt8Array"), + collectionsTypedArrays("SendableInt16Array"), + collectionsTypedArrays("SendableInt32Array"), + collectionsTypedArrays("SendableUint8Array"), + collectionsTypedArrays("SendableUint16Array"), + collectionsTypedArrays("SendableUint32Array"), + collectionsTypedArrays("SendableUint8ClampedArray"), arkTSASONObjects, arkTSHashSets, arkTSLinkedLists, -- Gitee