Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
junyu0312 committed Nov 10, 2023
1 parent 3594c8c commit 64e647d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/specs/src/encode/init_memory_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn encode_init_memory_table_entry<T: FromBn>(
eid: T,
value: T,
) -> T {
const LTYPE_SHIFT: u32 = IS_MUTABLE_SHIFT + 8;
const LTYPE_SHIFT: u32 = IS_MUTABLE_SHIFT + 1;
const IS_MUTABLE_SHIFT: u32 = START_OFFSET_SHIFT + COMMON_RANGE_OFFSET;
const START_OFFSET_SHIFT: u32 = END_OFFSET_SHIFT + COMMON_RANGE_OFFSET;
const END_OFFSET_SHIFT: u32 = EID_OFFSET_SHIFT + 32;
Expand Down
13 changes: 8 additions & 5 deletions crates/zkwasm/src/runtime/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ impl UpdateCompilationTable for CompilationTable {
}
}

let mut init_memory_entries = vec![];
init_memory_entries.append(&mut local_map.into_iter().map(|(_, v)| v).collect::<Vec<_>>());
init_memory_entries.append(&mut global_map.into_iter().map(|(_, v)| v).collect::<Vec<_>>());
init_memory_entries.append(&mut memory_map.into_iter().map(|(_, v)| v).collect::<Vec<_>>());
let init_memory_entries = vec![]
.into_iter()
.chain(local_map.into_values())
.chain(global_map.into_values())
.chain(memory_map.into_values())
.collect();

InitMemoryTable::new(init_memory_entries)
}
Expand All @@ -112,6 +114,7 @@ impl UpdateCompilationTable for CompilationTable {

for entry in execution_table.entries() {
match &entry.step_info {
// TODO: fix hard code
StepInfo::CallHost {
function_name,
args,
Expand All @@ -133,7 +136,7 @@ impl UpdateCompilationTable for CompilationTable {
}
}
StepInfo::ExternalHostCall { .. } => external_host_call_call_index += 1,
StepInfo::Call { .. } | StepInfo::Return { .. } => {
StepInfo::Call { .. } | StepInfo::CallIndirect { .. } | StepInfo::Return { .. } => {
#[cfg(feature = "continuation")]
{
jops += 1;
Expand Down

0 comments on commit 64e647d

Please sign in to comment.