mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-20 02:11:31 +00:00
Use stack IR when emitting text format (#312)
This commit is contained in:
@ -397,9 +397,7 @@ export class Compiler extends DiagnosticEmitter {
|
||||
: 0;
|
||||
module.setMemory(
|
||||
numPages,
|
||||
this.options.isWasm64
|
||||
? Module.MAX_MEMORY_WASM64
|
||||
: Module.MAX_MEMORY_WASM32,
|
||||
Module.UNLIMITED_MEMORY,
|
||||
this.memorySegments,
|
||||
options.target,
|
||||
"memory"
|
||||
|
2
src/glue/js/binaryen.d.ts
vendored
2
src/glue/js/binaryen.d.ts
vendored
@ -5,7 +5,9 @@
|
||||
declare namespace binaryen {
|
||||
class Module {
|
||||
constructor(ref: number);
|
||||
runPasses(passes: string[]): void;
|
||||
emitText(): string;
|
||||
emitStackIR(optimize?: boolean): string;
|
||||
emitAsmjs(): string;
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import "./i64";
|
||||
import { Module } from "../../module";
|
||||
|
||||
Module.prototype.toText = function(this: Module) {
|
||||
return new binaryen.Module(this.ref).emitText();
|
||||
return new binaryen.Module(this.ref).emitStackIR();
|
||||
};
|
||||
|
||||
Module.prototype.toAsmjs = function(this: Module) {
|
||||
|
@ -239,12 +239,6 @@ export class Module {
|
||||
|
||||
private cachedByValue: usize;
|
||||
|
||||
/** Maximum number of pages when targeting WASM32. */
|
||||
static readonly MAX_MEMORY_WASM32: Index = 0xffff;
|
||||
|
||||
/** Maximum number of pages when targeting WASM64. */
|
||||
static readonly MAX_MEMORY_WASM64: Index = 0xffff; // TODO
|
||||
|
||||
static create(): Module {
|
||||
var module = new Module();
|
||||
module.ref = _BinaryenModuleCreate();
|
||||
@ -824,6 +818,9 @@ export class Module {
|
||||
}
|
||||
}
|
||||
|
||||
/** Unlimited memory constant. */
|
||||
static readonly UNLIMITED_MEMORY: Index = <Index>-1;
|
||||
|
||||
setMemory(
|
||||
initial: Index,
|
||||
maximum: Index,
|
||||
|
Reference in New Issue
Block a user