Skip to content

Commit

Permalink
Experiment with borrowing load_fast
Browse files Browse the repository at this point in the history
  • Loading branch information
mpage committed Feb 5, 2025
1 parent e41ec8e commit 155c3b2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
9 changes: 5 additions & 4 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,13 @@ dummy_func(
);
ERROR_IF(1, error);
}
value = PyStackRef_DUP(value_s);
// value = PyStackRef_DUP(value_s);
value = PyStackRef_DupDeferred(value_s);
}

replicate(8) pure inst(LOAD_FAST, (-- value)) {
assert(!PyStackRef_IsNull(GETLOCAL(oparg)));
value = PyStackRef_DUP(GETLOCAL(oparg));
value = PyStackRef_DupDeferred(GETLOCAL(oparg));
}

inst(LOAD_FAST_AND_CLEAR, (-- value)) {
Expand All @@ -278,8 +279,8 @@ dummy_func(
inst(LOAD_FAST_LOAD_FAST, ( -- value1, value2)) {
uint32_t oparg1 = oparg >> 4;
uint32_t oparg2 = oparg & 15;
value1 = PyStackRef_DUP(GETLOCAL(oparg1));
value2 = PyStackRef_DUP(GETLOCAL(oparg2));
value1 = PyStackRef_DupDeferred(GETLOCAL(oparg1));
value2 = PyStackRef_DupDeferred(GETLOCAL(oparg2));
}

family(LOAD_CONST, 0) = {
Expand Down
21 changes: 11 additions & 10 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Tools/cases_generator/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ def has_error_without_pop(op: parser.CodeDef) -> bool:
"PyStackRef_CLEAR",
"PyStackRef_CLOSE_SPECIALIZED",
"PyStackRef_DUP",
"PyStackRef_DupDeferred",
"PyStackRef_False",
"PyStackRef_FromPyObjectImmortal",
"PyStackRef_FromPyObjectNew",
Expand Down

0 comments on commit 155c3b2

Please sign in to comment.