Compare commits

..
2 Commits
Author SHA1 Message Date
minggoandGitHub 998ab5a93c Merge pull request #362 from cocos/v3.8.0
V3.8.0
2023-06-13 10:08:14 +08:00
qiuguohuaandGitHub bc4dcfbabe Fix harmonyos platform compilation failure. (#356) 2023-06-02 14:55:25 +08:00
17 changed files with 1190968 additions and 1538219 deletions
+1 -17
View File
@@ -1,23 +1,7 @@
declare module 'external:emscripten/*.wasm' { declare module 'external:emscripten/*.wasm' {
/** /**
* This is a wasm url relative from build output chunk. * This is a url relative from build output chunk.
*/ */
const wasmPath: string; const wasmPath: string;
export default wasmPath; export default wasmPath;
} }
declare module 'external:emscripten/*.wasm.fallback' {
/**
* This is a wasm fallback url relative from build output chunk.
*/
const wasmFallbackPath: string;
export default wasmFallbackPath;
}
declare module 'external:emscripten/*.js.mem' {
/**
* This is a js.mem url relative from build output chunk.
*/
const jsMemPath: string;
export default jsMemPath;
}
+1190783 -1538041
View File
File diff suppressed because one or more lines are too long
+125 -75
View File
@@ -575,8 +575,8 @@ var wasmMemory;
// In the wasm backend, we polyfill the WebAssembly object, // In the wasm backend, we polyfill the WebAssembly object,
// so this creates a (non-native-wasm) table for us. // so this creates a (non-native-wasm) table for us.
var wasmTable = new WebAssembly.Table({ var wasmTable = new WebAssembly.Table({
'initial': 5439, 'initial': 5437,
'maximum': 5439 + 0, 'maximum': 5437 + 0,
'element': 'anyfunc' 'element': 'anyfunc'
}); });
@@ -1198,11 +1198,11 @@ function updateGlobalBufferAndViews(buf) {
} }
var STATIC_BASE = 1024, var STATIC_BASE = 1024,
STACK_BASE = 5618720, STACK_BASE = 5608208,
STACKTOP = STACK_BASE, STACKTOP = STACK_BASE,
STACK_MAX = 375840, STACK_MAX = 365328,
DYNAMIC_BASE = 5618720, DYNAMIC_BASE = 5608208,
DYNAMICTOP_PTR = 375680; DYNAMICTOP_PTR = 365168;
@@ -1678,7 +1678,7 @@ var ASM_CONSTS = {
// STATICTOP = STATIC_BASE + 374816; // STATICTOP = STATIC_BASE + 364304;
/* global initializers */ __ATINIT__.push({ func: function() { ___wasm_call_ctors() } }); /* global initializers */ __ATINIT__.push({ func: function() { ___wasm_call_ctors() } });
@@ -1751,10 +1751,14 @@ var ASM_CONSTS = {
} }
}function createNamedFunction(name, body) { }function createNamedFunction(name, body) {
name = makeLegalFunctionName(name); name = makeLegalFunctionName(name);
return function() { /*jshint evil:true*/
"use strict"; return new Function(
return body.apply(this, arguments); "body",
}; "return function " + name + "() {\n" +
" \"use strict\";" +
" return body.apply(this, arguments);\n" +
"};\n"
)(body);
} }
@@ -2759,14 +2763,17 @@ var ASM_CONSTS = {
signature = readLatin1String(signature); signature = readLatin1String(signature);
function makeDynCaller(dynCall) { function makeDynCaller(dynCall) {
var argCache = [rawFunction]; var args = [];
return function() { for (var i = 1; i < signature.length; ++i) {
argCache.length = arguments.length + 1; args.push('a' + i);
for (var i = 0; i < arguments.length; i++) { }
argCache[i + 1] = arguments[i];
} var name = 'dynCall_' + signature + '_' + rawFunction;
return dynCall.apply(null, argCache); var body = 'return function ' + name + '(' + args.join(', ') + ') {\n';
}; body += ' return dynCall(rawFunction' + (args.length ? ', ' : '') + args.join(', ') + ');\n';
body += '};\n';
return (new Function('dynCall', 'rawFunction', body))(dynCall, rawFunction);
} }
var dc = Module['dynCall_' + signature]; var dc = Module['dynCall_' + signature];
@@ -2914,9 +2921,6 @@ var ASM_CONSTS = {
if (!(constructor instanceof Function)) { if (!(constructor instanceof Function)) {
throw new TypeError('new_ called with constructor type ' + typeof(constructor) + " which is not a function"); throw new TypeError('new_ called with constructor type ' + typeof(constructor) + " which is not a function");
} }
if (constructor === Function) {
throw new Error('new_ cannot create a new Function with DYNAMIC_EXECUTION == 0.');
}
/* /*
* Previously, the following line was just: * Previously, the following line was just:
@@ -2971,47 +2975,71 @@ var ASM_CONSTS = {
var returns = (argTypes[0].name !== "void"); var returns = (argTypes[0].name !== "void");
var expectedArgCount = argCount - 2; var argsList = "";
var argsWired = new Array(expectedArgCount); var argsListWired = "";
var invokerFuncArgs = []; for(var i = 0; i < argCount - 2; ++i) {
var destructors = []; argsList += (i!==0?", ":"")+"arg"+i;
return function() { argsListWired += (i!==0?", ":"")+"arg"+i+"Wired";
if (arguments.length !== expectedArgCount) { }
throwBindingError('function ' + humanName + ' called with ' +
arguments.length + ' arguments, expected ' + expectedArgCount +
' args!');
}
destructors.length = 0;
var thisWired;
invokerFuncArgs.length = isClassMethodFunc ? 2 : 1;
invokerFuncArgs[0] = cppTargetFunc;
if (isClassMethodFunc) {
thisWired = argTypes[1].toWireType(destructors, this);
invokerFuncArgs[1] = thisWired;
}
for (var i = 0; i < expectedArgCount; ++i) {
argsWired[i] = argTypes[i + 2].toWireType(destructors, arguments[i]);
invokerFuncArgs.push(argsWired[i]);
}
var rv = cppInvokerFunc.apply(null, invokerFuncArgs); var invokerFnBody =
"return function "+makeLegalFunctionName(humanName)+"("+argsList+") {\n" +
"if (arguments.length !== "+(argCount - 2)+") {\n" +
"throwBindingError('function "+humanName+" called with ' + arguments.length + ' arguments, expected "+(argCount - 2)+" args!');\n" +
"}\n";
if (needsDestructorStack) {
runDestructors(destructors); if (needsDestructorStack) {
} else { invokerFnBody +=
for (var i = isClassMethodFunc ? 1 : 2; i < argTypes.length; i++) { "var destructors = [];\n";
var param = i === 1 ? thisWired : argsWired[i - 2]; }
if (argTypes[i].destructorFunction !== null) {
argTypes[i].destructorFunction(param); var dtorStack = needsDestructorStack ? "destructors" : "null";
} var args1 = ["throwBindingError", "invoker", "fn", "runDestructors", "retType", "classParam"];
var args2 = [throwBindingError, cppInvokerFunc, cppTargetFunc, runDestructors, argTypes[0], argTypes[1]];
if (isClassMethodFunc) {
invokerFnBody += "var thisWired = classParam.toWireType("+dtorStack+", this);\n";
}
for(var i = 0; i < argCount - 2; ++i) {
invokerFnBody += "var arg"+i+"Wired = argType"+i+".toWireType("+dtorStack+", arg"+i+"); // "+argTypes[i+2].name+"\n";
args1.push("argType"+i);
args2.push(argTypes[i+2]);
}
if (isClassMethodFunc) {
argsListWired = "thisWired" + (argsListWired.length > 0 ? ", " : "") + argsListWired;
}
invokerFnBody +=
(returns?"var rv = ":"") + "invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";
if (needsDestructorStack) {
invokerFnBody += "runDestructors(destructors);\n";
} else {
for(var i = isClassMethodFunc?1:2; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here. Also skip class type if not a method.
var paramName = (i === 1 ? "thisWired" : ("arg"+(i - 2)+"Wired"));
if (argTypes[i].destructorFunction !== null) {
invokerFnBody += paramName+"_dtor("+paramName+"); // "+argTypes[i].name+"\n";
args1.push(paramName+"_dtor");
args2.push(argTypes[i].destructorFunction);
}
} }
} }
if (returns) {
invokerFnBody += "var ret = retType.fromWireType(rv);\n" +
"return ret;\n";
} else {
}
invokerFnBody += "}\n";
if (returns) { args1.push(invokerFnBody);
return argTypes[0].fromWireType(rv);
} var invokerFunction = new_(Function, args1).apply(null, args2);
}; return invokerFunction;
} }
function heap32VectorToArray(count, firstElement) { function heap32VectorToArray(count, firstElement) {
@@ -3783,23 +3811,45 @@ var ASM_CONSTS = {
var types = __emval_lookupTypes(argCount, argTypes); var types = __emval_lookupTypes(argCount, argTypes);
var retType = types[0]; var retType = types[0];
var argN = new Array(argCount - 1); var signatureName = retType.name + "_$" + types.slice(1).map(function (t) { return t.name; }).join("_") + "$";
var invokerFunction = function(handle, name, destructors, args) {
var offset = 0; var params = ["retType"];
for (var i = 0; i < argCount - 1; ++i) { var args = [retType];
argN[i] = types[i + 1].readValueFromPointer(args + offset);
offset += types[i + 1].argPackAdvance; var argsList = ""; // 'arg0, arg1, arg2, ... , argN'
} for (var i = 0; i < argCount - 1; ++i) {
var rv = handle[name].apply(handle, argN); argsList += (i !== 0 ? ", " : "") + "arg" + i;
for (var i = 0; i < argCount - 1; ++i) { params.push("argType" + i);
if (types[i + 1].deleteObject) { args.push(types[1 + i]);
types[i + 1].deleteObject(argN[i]); }
var functionName = makeLegalFunctionName("methodCaller_" + signatureName);
var functionBody =
"return function " + functionName + "(handle, name, destructors, args) {\n";
var offset = 0;
for (var i = 0; i < argCount - 1; ++i) {
functionBody +=
" var arg" + i + " = argType" + i + ".readValueFromPointer(args" + (offset ? ("+"+offset) : "") + ");\n";
offset += types[i + 1]['argPackAdvance'];
}
functionBody +=
" var rv = handle[name](" + argsList + ");\n";
for (var i = 0; i < argCount - 1; ++i) {
if (types[i + 1]['deleteObject']) {
functionBody +=
" argType" + i + ".deleteObject(arg" + i + ");\n";
} }
} }
if (!retType.isVoid) { if (!retType.isVoid) {
return retType.toWireType(destructors, rv); functionBody +=
} " return retType.toWireType(destructors, rv);\n";
}; }
functionBody +=
"};\n";
params.push(functionBody);
var invokerFunction = new_(Function, params).apply(null, args);
return __emval_addMethodCaller(invokerFunction); return __emval_addMethodCaller(invokerFunction);
} }
@@ -3853,7 +3903,7 @@ var ASM_CONSTS = {
} }
function _emscripten_get_sbrk_ptr() { function _emscripten_get_sbrk_ptr() {
return 375680; return 365168;
} }
function _emscripten_memcpy_big(dest, src, num) { function _emscripten_memcpy_big(dest, src, num) {
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
+4 -1
View File
@@ -2,7 +2,7 @@ declare module 'external:emscripten/spine/spine.asm.js' {
export default SpineWasm; export default SpineWasm;
} }
declare module 'external:emscripten/spine/spine.wasm.js' { declare module 'external:emscripten/spine/spine.js' {
export default SpineWasm; export default SpineWasm;
} }
@@ -10,7 +10,10 @@ declare module 'external:emscripten/spine/spine.wasm.js' {
declare function SpineWasm (moduleOptions?: any): Promise<void>; declare function SpineWasm (moduleOptions?: any): Promise<void>;
declare namespace SpineWasm { declare namespace SpineWasm {
type ptr = number;
interface instance { interface instance {
spine: any;
memory: any;
spineWasmInit(): void; spineWasmInit(): void;
spineWasmDestroy(): void; spineWasmDestroy(): void;
} }
File diff suppressed because one or more lines are too long
Binary file not shown.
Executable → Regular
BIN
View File
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
+4 -4
View File
@@ -139,7 +139,7 @@ glslang (Built using https://github.com/YunHsiao/glslang/tree/build)
linux: 11.5.0 linux: 11.5.0
openharmony:11.5.0 (commit: 1978c76) openharmony:11.5.0 (commit: 1978c76)
swig ( Built using https://github.com/cocos/swig/tree/cocos-se, executable files are downloaded from https://github.com/cocos/swig/releases/tag/cocos-v1.1.5 ) swig ( Built using https://github.com/cocos/swig/tree/cocos-se, executable files are downloaded from https://github.com/cocos/swig/releases/tag/cocos-v1.1.4 )
win64: cocos-v1.1.5 (commit: 42543c0) win64: cocos-v1.1.4 (commit: 9807544)
mac: cocos-v1.1.5 (commit: 42543c0) mac: cocos-v1.1.4 (commit: 9807544)
linux: cocos-v1.1.5 (commit: 42543c0) linux: cocos-v1.1.4 (commit: 9807544)
Binary file not shown.