Move FunctionContext::new's call to push_frame to Interpreter::run_function.

This makes it more consistent with run_block and others, and also means
that FunctionContext::new doesn't need to be passed the function body
and doesn't need to return a Result, which simplify its users.
This commit is contained in:
Dan Gohman
2017-06-02 09:22:03 -07:00
parent 9e32f7bc21
commit 7e63159a1b
3 changed files with 9 additions and 11 deletions

View File

@ -356,7 +356,7 @@ impl ModuleInstanceInterface for ModuleInstance {
let value_stack_limit = outer.value_stack_limit;
let frame_stack_limit = outer.frame_stack_limit;
let locals = prepare_function_locals(actual_function_type, function_body, &mut outer)?;
let mut innner = FunctionContext::new(self, outer.externals, value_stack_limit, frame_stack_limit, actual_function_type, function_code, locals)?;
let mut innner = FunctionContext::new(self, outer.externals, value_stack_limit, frame_stack_limit, actual_function_type, locals);
Interpreter::run_function(&mut innner, function_code)
}
}