Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -782,9 +782,10 @@ public struct BridgeJSLink {
printer.indent {
printer.write("const Ctor = taCtors[kind];")
printer.write("const byteLen = count * Ctor.BYTES_PER_ELEMENT;")
printer.write("const start = ptr >>> 0;")
// slice() copies the bytes into a new ArrayBuffer that is properly aligned
printer.write(
"const copy = \(JSGlueVariableScope.reservedMemory).buffer.slice(ptr, ptr + byteLen);"
"const copy = \(JSGlueVariableScope.reservedMemory).buffer.slice(start, start + byteLen);"
)
printer.write("\(JSGlueVariableScope.reservedTaStack).push(Array.from(new Ctor(copy)));")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["swift_js_struct_lower_Point"] = function(objectId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["swift_js_struct_lower_AsyncPoint"] = function(objectId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["swift_js_struct_lower_Account_Credentials"] = function(objectId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["swift_js_struct_lower_Config"] = function(objectId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["swift_js_struct_lower_Counters"] = function(objectId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["swift_js_struct_lower_Point"] = function(objectId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["swift_js_struct_lower_Point"] = function(objectId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["swift_js_struct_lower_Library_Shelf"] = function(objectId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["swift_js_struct_lower_Depot_Crate"] = function(objectId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["swift_js_struct_lower_Meta"] = function(objectId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["swift_js_struct_lower_GenericPoint"] = function(objectId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["swift_js_struct_lower_FooContainer"] = function(objectId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ export async function createInstantiator(options, swift) {
bjs["swift_js_push_typed_array"] = function(kind, ptr, count) {
const Ctor = taCtors[kind];
const byteLen = count * Ctor.BYTES_PER_ELEMENT;
const copy = memory.buffer.slice(ptr, ptr + byteLen);
const start = ptr >>> 0;
const copy = memory.buffer.slice(start, start + byteLen);
taStack.push(Array.from(new Ctor(copy)));
}
bjs["bjs_core_register_type_handles"] = function() {};
Expand Down
Loading
Loading