Skip to content

Commit e84ac3c

Browse files
committed
address review: check datastack space for extra_bytes, require CO_OPTIMIZED in vectorcall fast path
1 parent 80eeac2 commit e84ac3c

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.cspell.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@
6060
"dedentations",
6161
"dedents",
6262
"deduped",
63-
"compactlong",
64-
"compactlongs",
6563
"deoptimize",
6664
"descrs",
6765
"downcastable",

crates/vm/src/builtins/function.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,6 +1374,7 @@ pub(crate) fn vectorcall_function(
13741374

13751375
let has_kwargs = kwnames.is_some_and(|kw| !kw.is_empty());
13761376
let is_simple = !has_kwargs
1377+
&& code.flags.contains(bytecode::CodeFlags::OPTIMIZED)
13771378
&& !code.flags.contains(bytecode::CodeFlags::VARARGS)
13781379
&& !code.flags.contains(bytecode::CodeFlags::VARKEYWORDS)
13791380
&& code.kwonlyarg_count == 0

crates/vm/src/frame.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// spell-checker: ignore compactlong compactlongs
2+
13
use crate::anystr::AnyStr;
24
#[cfg(feature = "flame")]
35
use crate::bytecode::InstructionMetadata;
@@ -8747,7 +8749,7 @@ impl ExecutingFrame<'_> {
87478749
Some(frame_size) => frame_size
87488750
.checked_add(extra_bytes)
87498751
.is_some_and(|size| vm.datastack_has_space(size)),
8750-
None => true,
8752+
None => extra_bytes == 0 || vm.datastack_has_space(extra_bytes),
87518753
}
87528754
}
87538755

0 commit comments

Comments
 (0)