From c25ba627dfa4243d6b3c9523f54a7520e43858c9 Mon Sep 17 00:00:00 2001 From: losfair Date: Wed, 18 Mar 2020 23:41:10 +0800 Subject: [PATCH] Add comment for call argument list preprocessing. --- lib/singlepass-backend/src/codegen_x64.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/singlepass-backend/src/codegen_x64.rs b/lib/singlepass-backend/src/codegen_x64.rs index e66a08f1b..38df4e67b 100644 --- a/lib/singlepass-backend/src/codegen_x64.rs +++ b/lib/singlepass-backend/src/codegen_x64.rs @@ -6885,6 +6885,10 @@ impl FunctionCodeGenerator for X64FunctionCode { self.machine.release_locations_only_osr_state(params.len()); + // Pop arguments off the FP stack and canonicalize them if needed. + // + // Canonicalization state will be lost across function calls, so early canonicalization + // is necessary here. while let Some(fp) = self.fp_stack.last() { if fp.depth >= self.value_stack.len() { let index = fp.depth - self.value_stack.len(); @@ -6956,6 +6960,10 @@ impl FunctionCodeGenerator for X64FunctionCode { .collect(); self.machine.release_locations_only_regs(¶ms); + // Pop arguments off the FP stack and canonicalize them if needed. + // + // Canonicalization state will be lost across function calls, so early canonicalization + // is necessary here. while let Some(fp) = self.fp_stack.last() { if fp.depth >= self.value_stack.len() { let index = fp.depth - self.value_stack.len();