support normal arrays

This commit is contained in:
dcode
2019-05-25 01:14:26 +02:00
parent 9620f18249
commit c34ed66fd9
42 changed files with 831 additions and 468 deletions

View File

@ -4164,6 +4164,7 @@ export function compileRTTI(compiler: Compiler): void {
var off = 4;
var abvInstance = program.arrayBufferViewInstance;
var abvPrototype = abvInstance.prototype;
var arrayPrototype = program.arrayPrototype;
var setPrototype = program.setPrototype;
var mapPrototype = program.mapPrototype;
var lastId = 0;
@ -4173,7 +4174,9 @@ export function compileRTTI(compiler: Compiler): void {
if (instance.isAcyclic) flags |= TypeinfoFlags.ACYCLIC;
if (instance !== abvInstance && instance.extends(abvPrototype)) {
let valueType = instance.getArrayValueType();
flags |= TypeinfoFlags.ARRAY;
flags |= instance.extends(arrayPrototype)
? TypeinfoFlags.ARRAY
: TypeinfoFlags.ARRAYBUFFERVIEW;
flags |= TypeinfoFlags.VALUE_ALIGN_0 * typeToRuntimeFlags(valueType);
} else if (instance.extends(setPrototype)) {
let typeArguments = assert(instance.getTypeArgumentsTo(setPrototype));