|
28 | 28 |
|
29 | 29 | // These constants are used by:
|
30 | 30 | // - mp_raw_code_t::is_generator (only MP_SCOPE_FLAG_GENERATOR)
|
| 31 | +// CIRCUITPY-CHANGE: distinguish generator and async |
| 32 | +// - mp_raw_code_t::is_generator (only MP_SCOPE_FLAG_ASYNC) |
31 | 33 | // - scope_t::scope_flags (16 bits)
|
32 | 34 | // - MP_BC_PRELUDE_SIG_ENCODE macro, masked by MP_SCOPE_FLAG_ALL_SIG (4 bits)
|
33 | 35 | // - tools/mpy_ld.py, when generating mpy files (maximum 7 bits)
|
34 |
| -#define MP_SCOPE_FLAG_ALL_SIG (0x0f) |
| 36 | +#define MP_SCOPE_FLAG_ALL_SIG (0x1f) |
35 | 37 | #define MP_SCOPE_FLAG_GENERATOR (0x01)
|
36 | 38 | #define MP_SCOPE_FLAG_VARKEYWORDS (0x02)
|
37 | 39 | #define MP_SCOPE_FLAG_VARARGS (0x04)
|
38 | 40 | #define MP_SCOPE_FLAG_DEFKWARGS (0x08)
|
39 |
| -#define MP_SCOPE_FLAG_REFGLOBALS (0x10) // used only if native emitter enabled |
40 |
| -#define MP_SCOPE_FLAG_HASCONSTS (0x20) // used only if native emitter enabled |
41 |
| -#define MP_SCOPE_FLAG_VIPERRET_POS (6) // 3 bits used for viper return type, to pass from compiler to native emitter |
42 |
| -#define MP_SCOPE_FLAG_VIPERRELOC (0x10) // used only when loading viper from .mpy |
43 |
| -#define MP_SCOPE_FLAG_VIPERRODATA (0x20) // used only when loading viper from .mpy |
44 |
| -#define MP_SCOPE_FLAG_VIPERBSS (0x40) // used only when loading viper from .mpy |
45 | 41 | // CIRCUITPY-CHANGE: FLAG_ASYNC
|
46 |
| -#define MP_SCOPE_FLAG_ASYNC (0x80) |
| 42 | +#define MP_SCOPE_FLAG_ASYNC (0x10) |
| 43 | +#define MP_SCOPE_FLAG_REFGLOBALS (0x20) // used only if native emitter enabled |
| 44 | +#define MP_SCOPE_FLAG_HASCONSTS (0x40) // used only if native emitter enabled |
| 45 | +#define MP_SCOPE_FLAG_VIPERRET_POS (7) // 3 bits used for viper return type, to pass from compiler to native emitter |
| 46 | +#define MP_SCOPE_FLAG_VIPERRELOC (0x20) // used only when loading viper from .mpy |
| 47 | +#define MP_SCOPE_FLAG_VIPERRODATA (0x40) // used only when loading viper from .mpy |
| 48 | +#define MP_SCOPE_FLAG_VIPERBSS (0x80) // used only when loading viper from .mpy |
47 | 49 |
|
48 | 50 | // types for native (viper) function signature
|
49 | 51 | #define MP_NATIVE_TYPE_OBJ (0x00)
|
|
0 commit comments