Skip to content

Commit bf090b6

Browse files
committed
Updated to PuerTS v2.2.2 for android 16kb alignment
1 parent 3fd7c9d commit bf090b6

89 files changed

Lines changed: 902 additions & 354 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Puerts/Editor/Resources/puerts/templates/dts.tpl.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Tencent is pleased to support the open source community by making Puerts available.
3-
* Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
3+
* Copyright (C) 2020 Tencent. All rights reserved.
44
* Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms.
55
* This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package.
66
*/

Puerts/Editor/Resources/puerts/templates/extension_methods_gen.tpl.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Tencent is pleased to support the open source community by making Puerts available.
3-
* Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
3+
* Copyright (C) 2020 Tencent. All rights reserved.
44
* Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms.
55
* This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package.
66
*/

Puerts/Editor/Resources/puerts/templates/il2cpp_snippets.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Tencent is pleased to support the open source community by making Puerts available.
3-
* Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
3+
* Copyright (C) 2020 Tencent. All rights reserved.
44
* Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms.
55
* This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package.
66
*/

Puerts/Editor/Resources/puerts/templates/il2cppbridge.tpl.mjs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Tencent is pleased to support the open source community by making Puerts available.
3-
* Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
3+
* Copyright (C) 2020 Tencent. All rights reserved.
44
* Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms.
55
* This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package.
66
*/
@@ -40,7 +40,8 @@ function genBridge(bridgeInfo, isOptimizeSize) {
4040
var parameterSignatures = il2cpp_snippets.listToJsArray(bridgeInfo.ParameterSignatures);
4141
let hasVarArgs = parameterSignatures.length > 0 && parameterSignatures[parameterSignatures.length -1][0] == 'V'
4242
return t`
43-
static ${il2cpp_snippets.SToCPPType(bridgeInfo.ReturnSignature)} b_${bridgeInfo.Signature}${isOptimizeSize ? '_inner' : ''}(void* target, ${parameterSignatures.map((S, i) => `${il2cpp_snippets.SToCPPType(S)} p${i}`).map(s => `${s}, `).join('')}MethodInfo* method) {
43+
// ${bridgeInfo.CsName}
44+
static ${il2cpp_snippets.SToCPPType(bridgeInfo.ReturnSignature)} b_${bridgeInfo.Signature}(void* target, ${parameterSignatures.map((S, i) => `${il2cpp_snippets.SToCPPType(S)} p${i}`).map(s => `${s}, `).join('')}MethodInfo* method) {
4445
// PLog("Running b_${bridgeInfo.Signature}");
4546
4647
${IF(bridgeInfo.ReturnSignature && !(il2cpp_snippets.getSignatureWithoutRefAndPrefix(bridgeInfo.ReturnSignature) in il2cpp_snippets.PrimitiveSignatureCppTypeMap))}
@@ -84,11 +85,11 @@ static ${il2cpp_snippets.SToCPPType(bridgeInfo.ReturnSignature)} b_${bridgeInfo.
8485
}
8586
${IF(isOptimizeSize)}
8687
87-
static void b_${bridgeInfo.Signature}(void* target, ${parameterSignatures.map((S, i) => `Il2CppFullySharedGenericAny p${i}`).map(s => `${s}, `).join('')}${bridgeInfo.ReturnSignature != 'v' ? `Il2CppFullySharedGenericAny * il2ppRetVal,` : ''}MethodInfo* method) {
88+
static void b_${bridgeInfo.Signature}_Shared(void* target, ${parameterSignatures.map((S, i) => `Il2CppFullySharedGenericAny p${i}`).map(s => `${s}, `).join('')}${bridgeInfo.ReturnSignature != 'v' ? `Il2CppFullySharedGenericAny * il2ppRetVal,` : ''}MethodInfo* method) {
8889
${IF(bridgeInfo.ReturnSignature != 'v')}
8990
*((${il2cpp_snippets.SToCPPType(bridgeInfo.ReturnSignature)} *)il2ppRetVal) =
9091
${ENDIF()}
91-
b_${bridgeInfo.Signature}_inner(target, ${parameterSignatures.map((S, i) => `${il2cpp_snippets.FromAny(S)}p${i}`).map(s => `${s}, `).join('')}method);
92+
b_${bridgeInfo.Signature}(target, ${parameterSignatures.map((S, i) => `${il2cpp_snippets.FromAny(S)}p${i}`).map(s => `${s}, `).join('')}method);
9293
}
9394
${ENDIF()}
9495
`;
@@ -132,14 +133,23 @@ static BridgeFuncInfo g_bridgeFuncInfos[] = {
132133
{nullptr, nullptr}
133134
};
134135
136+
${genInfos.IsOptimizeSize ? `
137+
static Il2CppMethodPointer g_bridgeSharedFuncs[] = {
138+
${FOR(bridgeInfos, info => t`
139+
(Il2CppMethodPointer)b_${info.Signature}_Shared,
140+
`)}
141+
nullptr
142+
};` : ''
143+
}
144+
135145
136-
Il2CppMethodPointer FindBridgeFunc(const char* signature)
146+
Il2CppMethodPointer FindBridgeFunc(const char* signature, bool IsShared)
137147
{
138148
auto begin = &g_bridgeFuncInfos[0];
139149
auto end = &g_bridgeFuncInfos[sizeof(g_bridgeFuncInfos) / sizeof(BridgeFuncInfo) - 1];
140150
auto first = std::lower_bound(begin, end, signature, [](const BridgeFuncInfo& x, const char* signature) {return strcmp(x.Signature, signature) < 0;});
141151
if (first != end && strcmp(first->Signature, signature) == 0) {
142-
return first->Method;
152+
${genInfos.IsOptimizeSize ? 'return IsShared ? g_bridgeSharedFuncs[first - begin] : first->Method' : 'return first->Method'};
143153
}
144154
return nullptr;
145155
}

Puerts/Editor/Resources/puerts/templates/il2cppfieldwrapper.tpl.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Tencent is pleased to support the open source community by making Puerts available.
3-
* Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
3+
* Copyright (C) 2020 Tencent. All rights reserved.
44
* Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms.
55
* This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package.
66
*/

Puerts/Editor/Resources/puerts/templates/il2cppvaluetype.tpl.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Tencent is pleased to support the open source community by making Puerts available.
3-
* Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
3+
* Copyright (C) 2020 Tencent. All rights reserved.
44
* Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms.
55
* This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package.
66
*/

Puerts/Editor/Resources/puerts/templates/il2cppwrapper.tpl.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Tencent is pleased to support the open source community by making Puerts available.
3-
* Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
3+
* Copyright (C) 2020 Tencent. All rights reserved.
44
* Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms.
55
* This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package.
66
*/

Puerts/Editor/Resources/puerts/templates/il2cppwrapperdef.tpl.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Tencent is pleased to support the open source community by making Puerts available.
3-
* Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
3+
* Copyright (C) 2020 Tencent. All rights reserved.
44
* Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms.
55
* This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package.
66
*/

Puerts/Editor/Resources/puerts/templates/linkxmlgen.tpl.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Tencent is pleased to support the open source community by making Puerts available.
3-
* Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
3+
* Copyright (C) 2020 Tencent. All rights reserved.
44
* Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms.
55
* This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package.
66
*/

Puerts/Editor/Resources/puerts/templates/registerinfo.tpl.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Tencent is pleased to support the open source community by making Puerts available.
3-
* Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
3+
* Copyright (C) 2020 Tencent. All rights reserved.
44
* Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms.
55
* This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package.
66
*/

0 commit comments

Comments
 (0)