Skip to content

Commit 635f7e2

Browse files
committed
Rename function.
1 parent 5d1980e commit 635f7e2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/loader/dag/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ fn build_dag<'a>(
239239
let target = &block_stack[relative_depth as usize];
240240

241241
// The stack part of the input
242-
let mut inputs = t.take_from_stack(target.stack.len());
242+
let mut inputs = t.stack_pop_many(target.stack.len());
243243
assert!(types_matches(&t.nodes, &target.stack, &inputs));
244244

245245
// The locals part of the input
@@ -316,7 +316,7 @@ fn build_dag<'a>(
316316
.unwrap();
317317

318318
// The stack part of the input
319-
let mut inputs = t.take_from_stack(largest_stack.len());
319+
let mut inputs = t.stack_pop_many(largest_stack.len());
320320
assert!(types_matches(&t.nodes, largest_stack, &inputs));
321321

322322
// The locals part of the input is the union of the locals inputs
@@ -376,7 +376,7 @@ fn build_dag<'a>(
376376
// that consumes some inputs and produces some outputs.
377377
Ins::WASMOp(op) => {
378378
let (inputs_types, output_types) = t.get_operator_type(&op).unwrap();
379-
let inputs = t.take_from_stack(inputs_types.len());
379+
let inputs = t.stack_pop_many(inputs_types.len());
380380
assert!(types_matches(&t.nodes, &inputs_types, &inputs));
381381

382382
let node_idx = t.nodes.len();
@@ -400,7 +400,7 @@ fn build_dag<'a>(
400400
// values from the locals and the stack.
401401

402402
// Block inputs are the concatenation of the stack inputs and the locals inputs.
403-
let mut inputs = t.take_from_stack(block.interface_type.ty.params().len());
403+
let mut inputs = t.stack_pop_many(block.interface_type.ty.params().len());
404404

405405
// Sanity check the types
406406
assert!(types_matches(
@@ -645,9 +645,9 @@ impl StackTracker<'_, '_> {
645645
node.output_types[val_type.output_idx as usize]
646646
}
647647

648-
/// Takes the last `count` elements from the stack, converts them to NodeInput,
648+
/// Takes the last `count` elements from the end of the stack, converts them to NodeInput,
649649
/// and truncates the stack. More efficient than split_off as it avoids one allocation.
650-
fn take_from_stack(&mut self, count: usize) -> Vec<NodeInput> {
650+
fn stack_pop_many(&mut self, count: usize) -> Vec<NodeInput> {
651651
let start = self.stack.len() - count;
652652
let inputs: Vec<NodeInput> = self.stack[start..].iter().map(|&v| v.into()).collect();
653653
self.stack.truncate(start);

0 commit comments

Comments
 (0)