diff options
author | Guido van Rossum <guido@python.org> | 2022-11-23 00:04:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-23 00:04:57 (GMT) |
commit | 8f18ac04d32515eab841172c956a8cb14bcee9c3 (patch) | |
tree | b2c54230bb6a336b40e18c42c0e3cc5f1da41e24 /Include/internal | |
parent | f1a4a6a58736196f766d51f048d19a2b0a0a155a (diff) | |
download | cpython-8f18ac04d32515eab841172c956a8cb14bcee9c3.zip cpython-8f18ac04d32515eab841172c956a8cb14bcee9c3.tar.gz cpython-8f18ac04d32515eab841172c956a8cb14bcee9c3.tar.bz2 |
GH-98831: Add `macro` and `op` and their implementation to DSL (#99495)
Newly supported interpreter definition syntax:
- `op(NAME, (input_stack_effects -- output_stack_effects)) { ... }`
- `macro(NAME) = OP1 + OP2;`
Also some other random improvements:
- Convert `WITH_EXCEPT_START` to use stack effects
- Fix lexer to balk at unrecognized characters, e.g. `@`
- Fix moved output names; support object pointers in cache
- Introduce `error()` method to print errors
- Introduce read_uint16(p) as equivalent to `*p`
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Diffstat (limited to 'Include/internal')
-rw-r--r-- | Include/internal/pycore_code.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h index ba36ee3..80c1bfb 100644 --- a/Include/internal/pycore_code.h +++ b/Include/internal/pycore_code.h @@ -293,6 +293,12 @@ write_obj(uint16_t *p, PyObject *val) memcpy(p, &val, sizeof(val)); } +static inline uint16_t +read_u16(uint16_t *p) +{ + return *p; +} + static inline uint32_t read_u32(uint16_t *p) { |