Just bump framestack limits. (#50)
These limits seems to be picked arbitrary, and I just made it arbitrary larger. We need to reconsider these limits, ideally providing to user a way to customize the limits. FWIW, When the last time I've tried to run gcc's torture testsuite with wasmi it also bumped into this limit. Fixes #41.
This commit is contained in:
parent
31a70aaa8d
commit
e273b9e40a
|
@ -6,10 +6,6 @@ pub mod stack;
|
||||||
pub const DEFAULT_MEMORY_INDEX: u32 = 0;
|
pub const DEFAULT_MEMORY_INDEX: u32 = 0;
|
||||||
/// Index of default table.
|
/// Index of default table.
|
||||||
pub const DEFAULT_TABLE_INDEX: u32 = 0;
|
pub const DEFAULT_TABLE_INDEX: u32 = 0;
|
||||||
/// Maximum number of entries in value stack.
|
|
||||||
pub const DEFAULT_VALUE_STACK_LIMIT: usize = 16384;
|
|
||||||
/// Maximum number of entries in frame stack.
|
|
||||||
pub const DEFAULT_FRAME_STACK_LIMIT: usize = 1024;
|
|
||||||
|
|
||||||
/// Control stack frame.
|
/// Control stack frame.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
|
@ -15,9 +15,13 @@ use value::{
|
||||||
use host::Externals;
|
use host::Externals;
|
||||||
use common::{DEFAULT_MEMORY_INDEX, DEFAULT_TABLE_INDEX, BlockFrame, BlockFrameType};
|
use common::{DEFAULT_MEMORY_INDEX, DEFAULT_TABLE_INDEX, BlockFrame, BlockFrameType};
|
||||||
use common::stack::StackWithLimit;
|
use common::stack::StackWithLimit;
|
||||||
use common::{DEFAULT_FRAME_STACK_LIMIT, DEFAULT_VALUE_STACK_LIMIT};
|
|
||||||
use memory_units::Pages;
|
use memory_units::Pages;
|
||||||
|
|
||||||
|
/// Maximum number of entries in value stack.
|
||||||
|
pub const DEFAULT_VALUE_STACK_LIMIT: usize = 16384;
|
||||||
|
/// Maximum number of entries in frame stack.
|
||||||
|
pub const DEFAULT_FRAME_STACK_LIMIT: usize = 16384;
|
||||||
|
|
||||||
/// Function interpreter.
|
/// Function interpreter.
|
||||||
pub struct Interpreter<'a, E: Externals + 'a> {
|
pub struct Interpreter<'a, E: Externals + 'a> {
|
||||||
externals: &'a mut E,
|
externals: &'a mut E,
|
||||||
|
|
|
@ -10,10 +10,10 @@ use validation::Error;
|
||||||
use common::stack::StackWithLimit;
|
use common::stack::StackWithLimit;
|
||||||
use common::{BlockFrame, BlockFrameType};
|
use common::{BlockFrame, BlockFrameType};
|
||||||
|
|
||||||
/// Maximum number of entries in value stack.
|
/// Maximum number of entries in value stack per function.
|
||||||
const DEFAULT_VALUE_STACK_LIMIT: usize = 16384;
|
const DEFAULT_VALUE_STACK_LIMIT: usize = 16384;
|
||||||
/// Maximum number of entries in frame stack.
|
/// Maximum number of entries in frame stack per function.
|
||||||
const DEFAULT_FRAME_STACK_LIMIT: usize = 1024;
|
const DEFAULT_FRAME_STACK_LIMIT: usize = 16384;
|
||||||
|
|
||||||
/// Function validation context.
|
/// Function validation context.
|
||||||
struct FunctionValidationContext<'a> {
|
struct FunctionValidationContext<'a> {
|
||||||
|
|
Loading…
Reference in New Issue