mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
stack pointer: use constants & add a comment
This commit is contained in:
parent
d4a741d483
commit
51b6076322
1 changed files with 4 additions and 4 deletions
|
@ -24,7 +24,7 @@ use crate::wasm_module::{
|
||||||
};
|
};
|
||||||
use crate::{
|
use crate::{
|
||||||
copy_memory, CopyMemoryConfig, Env, BUILTINS_IMPORT_MODULE_NAME, MEMORY_NAME, PTR_TYPE,
|
copy_memory, CopyMemoryConfig, Env, BUILTINS_IMPORT_MODULE_NAME, MEMORY_NAME, PTR_TYPE,
|
||||||
STACK_POINTER_NAME,
|
STACK_POINTER_GLOBAL_ID, STACK_POINTER_NAME,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// The memory address where the constants data will be loaded during module instantiation.
|
/// The memory address where the constants data will be loaded during module instantiation.
|
||||||
|
@ -84,12 +84,12 @@ impl<'a> WasmBackend<'a> {
|
||||||
exports.push(Export {
|
exports.push(Export {
|
||||||
name: STACK_POINTER_NAME.to_string(),
|
name: STACK_POINTER_NAME.to_string(),
|
||||||
ty: ExportType::Global,
|
ty: ExportType::Global,
|
||||||
index: 0,
|
index: STACK_POINTER_GLOBAL_ID,
|
||||||
});
|
});
|
||||||
|
|
||||||
linker_symbols.push(SymInfo::Global(WasmObjectSymbol::Defined {
|
linker_symbols.push(SymInfo::Global(WasmObjectSymbol::Defined {
|
||||||
flags: WASM_SYM_BINDING_WEAK,
|
flags: WASM_SYM_BINDING_WEAK, // TODO: this works but means external .o files decide how much stack we have!
|
||||||
index: 0,
|
index: STACK_POINTER_GLOBAL_ID,
|
||||||
name: STACK_POINTER_NAME.to_string(),
|
name: STACK_POINTER_NAME.to_string(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue