sysjs: improve self-hosted compiler support
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
f15cea9492
commit
4c3a19fc26
1 changed files with 2 additions and 2 deletions
|
|
@ -211,7 +211,7 @@ export fn wasmCallFunction(id: *anyopaque, args: u32, len: u32, captures: [*]Val
|
||||||
if (builtin.zig_backend == .stage1) {
|
if (builtin.zig_backend == .stage1) {
|
||||||
obj.set("return_value", functions.items[@ptrToInt(id) - 1](obj, len, captures_slice));
|
obj.set("return_value", functions.items[@ptrToInt(id) - 1](obj, len, captures_slice));
|
||||||
} else {
|
} else {
|
||||||
var func = @ptrCast(*FunType, @alignCast(std.meta.alignment(*FunType), id));
|
var func = @ptrCast(FunType, @alignCast(std.meta.alignment(FunType), id));
|
||||||
obj.set("return_value", func(obj, len, captures_slice));
|
obj.set("return_value", func(obj, len, captures_slice));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -260,7 +260,7 @@ pub fn createFunction(fun: FunType, captures: []Value) Function {
|
||||||
functions.append(std.heap.page_allocator, fun) catch unreachable;
|
functions.append(std.heap.page_allocator, fun) catch unreachable;
|
||||||
return .{ .ref = js.zigCreateFunction(@intToPtr(*anyopaque, functions.items.len), captures.ptr, @intCast(u32, captures.len)) };
|
return .{ .ref = js.zigCreateFunction(@intToPtr(*anyopaque, functions.items.len), captures.ptr, @intCast(u32, captures.len)) };
|
||||||
}
|
}
|
||||||
return .{ .ref = js.zigCreateFunction(&fun, captures.ptr, captures.len) };
|
return .{ .ref = js.zigCreateFunction(fun, captures.ptr, captures.len) };
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn constructType(t: []const u8, args: []const Value) Object {
|
pub fn constructType(t: []const u8, args: []const Value) Object {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue