Skip to content

Commit b326edf

Browse files
jimmodpgeorge
authored andcommitted
all: Remove MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE.
This commit removes all parts of code associated with the existing MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE optimisation option, including the -mcache-lookup-bc option to mpy-cross. This feature originally provided a significant performance boost for Unix, but wasn't able to be enabled for MCU targets (due to frozen bytecode), and added significant extra complexity to generating and distributing .mpy files. The equivalent performance gain is now provided by the combination of MICROPY_OPT_LOAD_ATTR_FAST_PATH and MICROPY_OPT_MAP_LOOKUP_CACHE (which has been enabled on the unix port in the previous commit). It's hard to provide precise performance numbers, but tests have been run on a wide variety of architectures (x86-64, ARM Cortex, Aarch64, RISC-V, xtensa) and they all generally agree on the qualitative improvements seen by the combination of MICROPY_OPT_LOAD_ATTR_FAST_PATH and MICROPY_OPT_MAP_LOOKUP_CACHE. For example, on a "quiet" Linux x64 environment (i3-5010U @ 2.10GHz) the change from CACHE_MAP_LOOKUP_IN_BYTECODE, to LOAD_ATTR_FAST_PATH combined with MAP_LOOKUP_CACHE is: diff of scores (higher is better) N=2000 M=2000 bccache -> attrmapcache diff diff% (error%) bm_chaos.py 13742.56 -> 13905.67 : +163.11 = +1.187% (+/-3.75%) bm_fannkuch.py 60.13 -> 61.34 : +1.21 = +2.012% (+/-2.11%) bm_fft.py 113083.20 -> 114793.68 : +1710.48 = +1.513% (+/-1.57%) bm_float.py 256552.80 -> 243908.29 : -12644.51 = -4.929% (+/-1.90%) bm_hexiom.py 521.93 -> 625.41 : +103.48 = +19.826% (+/-0.40%) bm_nqueens.py 197544.25 -> 217713.12 : +20168.87 = +10.210% (+/-3.01%) bm_pidigits.py 8072.98 -> 8198.75 : +125.77 = +1.558% (+/-3.22%) misc_aes.py 17283.45 -> 16480.52 : -802.93 = -4.646% (+/-0.82%) misc_mandel.py 99083.99 -> 128939.84 : +29855.85 = +30.132% (+/-5.88%) misc_pystone.py 83860.10 -> 82592.56 : -1267.54 = -1.511% (+/-2.27%) misc_raytrace.py 21490.40 -> 22227.23 : +736.83 = +3.429% (+/-1.88%) This shows that the new optimisations are at least as good as the existing inline-bytecode-caching, and are sometimes much better (because the new ones apply caching to a wider variety of map lookups). The new optimisations can also benefit code generated by the native emitter, because they apply to the runtime rather than the generated code. The improvement for the native emitter when LOAD_ATTR_FAST_PATH and MAP_LOOKUP_CACHE are enabled is (same Linux environment as above): diff of scores (higher is better) N=2000 M=2000 native -> nat-attrmapcache diff diff% (error%) bm_chaos.py 14130.62 -> 15464.68 : +1334.06 = +9.441% (+/-7.11%) bm_fannkuch.py 74.96 -> 76.16 : +1.20 = +1.601% (+/-1.80%) bm_fft.py 166682.99 -> 168221.86 : +1538.87 = +0.923% (+/-4.20%) bm_float.py 233415.23 -> 265524.90 : +32109.67 = +13.756% (+/-2.57%) bm_hexiom.py 628.59 -> 734.17 : +105.58 = +16.796% (+/-1.39%) bm_nqueens.py 225418.44 -> 232926.45 : +7508.01 = +3.331% (+/-3.10%) bm_pidigits.py 6322.00 -> 6379.52 : +57.52 = +0.910% (+/-5.62%) misc_aes.py 20670.10 -> 27223.18 : +6553.08 = +31.703% (+/-1.56%) misc_mandel.py 138221.11 -> 152014.01 : +13792.90 = +9.979% (+/-2.46%) misc_pystone.py 85032.14 -> 105681.44 : +20649.30 = +24.284% (+/-2.25%) misc_raytrace.py 19800.01 -> 23350.73 : +3550.72 = +17.933% (+/-2.79%) In summary, compared to MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE, the new MICROPY_OPT_LOAD_ATTR_FAST_PATH and MICROPY_OPT_MAP_LOOKUP_CACHE options: - are simpler; - take less code size; - are faster (generally); - work with code generated by the native emitter; - can be used on embedded targets with a small and constant RAM overhead; - allow the same .mpy bytecode to run on all targets. See micropython#7680 for further discussion. And see also micropython#7653 for a discussion about simplifying mpy-cross options. Signed-off-by: Jim Mussared <[email protected]>
1 parent 60c6d55 commit b326edf

32 files changed

+42
-260
lines changed

docs/reference/mpyfiles.rst

-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ If importing an .mpy file fails then try the following:
6666
print('mpy flags:', end='')
6767
if arch:
6868
print(' -march=' + arch, end='')
69-
if sys_mpy & 0x100:
70-
print(' -mcache-lookup-bc', end='')
7169
if not sys_mpy & 0x200:
7270
print(' -mno-unicode', end='')
7371
print()

examples/embedding/mpconfigport_minimal.h

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
4646
#define MICROPY_STREAMS_NON_BLOCK (0)
4747
#define MICROPY_OPT_COMPUTED_GOTO (0)
48-
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0)
4948
#define MICROPY_CAN_OVERRIDE_BUILTINS (0)
5049
#define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (0)
5150
#define MICROPY_CPYTHON_COMPAT (0)

mpy-cross/README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ by the target MicroPython runtime (eg onto a pyboard's filesystem), and then
1717
imported like any other Python module using `import foo`.
1818

1919
Different target runtimes may require a different format of the compiled
20-
bytecode, and such options can be passed to the cross compiler. For example,
21-
the unix port of MicroPython requires the following:
22-
23-
$ ./mpy-cross -mcache-lookup-bc foo.py
20+
bytecode, and such options can be passed to the cross compiler.
2421

2522
If the Python code contains `@native` or `@viper` annotations, then you must
2623
specify `-march` to match the target architecture.

mpy-cross/main.c

-6
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ STATIC int usage(char **argv) {
108108
"Target specific options:\n"
109109
"-msmall-int-bits=number : set the maximum bits used to encode a small-int\n"
110110
"-mno-unicode : don't support unicode in compiled strings\n"
111-
"-mcache-lookup-bc : cache map lookups in the bytecode\n"
112111
"-march=<arch> : set architecture for native emitter; x86, x64, armv6, armv7m, armv7em, armv7emsp, armv7emdp, xtensa, xtensawin\n"
113112
"\n"
114113
"Implementation specific options:\n", argv[0]
@@ -205,7 +204,6 @@ MP_NOINLINE int main_(int argc, char **argv) {
205204

206205
// set default compiler configuration
207206
mp_dynamic_compiler.small_int_bits = 31;
208-
mp_dynamic_compiler.opt_cache_map_lookup_in_bytecode = 0;
209207
mp_dynamic_compiler.py_builtins_str_unicode = 1;
210208
#if defined(__i386__)
211209
mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_X86;
@@ -264,10 +262,6 @@ MP_NOINLINE int main_(int argc, char **argv) {
264262
return usage(argv);
265263
}
266264
// TODO check that small_int_bits is within range of host's capabilities
267-
} else if (strcmp(argv[a], "-mno-cache-lookup-bc") == 0) {
268-
mp_dynamic_compiler.opt_cache_map_lookup_in_bytecode = 0;
269-
} else if (strcmp(argv[a], "-mcache-lookup-bc") == 0) {
270-
mp_dynamic_compiler.opt_cache_map_lookup_in_bytecode = 1;
271265
} else if (strcmp(argv[a], "-mno-unicode") == 0) {
272266
mp_dynamic_compiler.py_builtins_str_unicode = 0;
273267
} else if (strcmp(argv[a], "-municode") == 0) {

mpy-cross/mpconfigport.h

-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@
5757
#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (1)
5858
#define MICROPY_COMP_RETURN_IF_EXPR (1)
5959

60-
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0)
61-
6260
#define MICROPY_READER_POSIX (1)
6361
#define MICROPY_ENABLE_RUNTIME (0)
6462
#define MICROPY_ENABLE_GC (1)

ports/cc3200/mpconfigport.h

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
5454
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE)
5555
#define MICROPY_OPT_COMPUTED_GOTO (0)
56-
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0)
5756
#define MICROPY_READER_VFS (1)
5857
#ifndef DEBUG // we need ram on the launchxl while debugging
5958
#define MICROPY_CPYTHON_COMPAT (1)

ports/nrf/mpconfigport.h

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
#endif
6767

6868
#define MICROPY_OPT_COMPUTED_GOTO (0)
69-
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0)
7069
#define MICROPY_OPT_MPZ_BITWISE (0)
7170

7271
// fatfs configuration used in ffconf.h

ports/stm32/mpconfigport.h

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
#ifndef MICROPY_OPT_COMPUTED_GOTO
6060
#define MICROPY_OPT_COMPUTED_GOTO (1)
6161
#endif
62-
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0)
6362
#ifndef MICROPY_OPT_LOAD_ATTR_FAST_PATH
6463
#define MICROPY_OPT_LOAD_ATTR_FAST_PATH (1)
6564
#endif

ports/unix/Makefile

+1-4
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ ifneq ($(FROZEN_MANIFEST)$(FROZEN_MPY_DIR),)
269269
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
270270
CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
271271
CFLAGS += -DMPZ_DIG_SIZE=16 # force 16 bits to work on both 32 and 64 bit archs
272-
MPY_CROSS_FLAGS += -mcache-lookup-bc
273272
endif
274273

275274
ifneq ($(FROZEN_MANIFEST)$(FROZEN_DIR),)
@@ -285,9 +284,7 @@ endif
285284
CXXFLAGS += $(filter-out -Wmissing-prototypes -Wold-style-definition -std=gnu99,$(CFLAGS) $(CXXFLAGS_MOD))
286285

287286
ifeq ($(MICROPY_FORCE_32BIT),1)
288-
RUN_TESTS_MPY_CROSS_FLAGS = --mpy-cross-flags='-mcache-lookup-bc -march=x86'
289-
else
290-
RUN_TESTS_MPY_CROSS_FLAGS = --mpy-cross-flags='-mcache-lookup-bc'
287+
RUN_TESTS_MPY_CROSS_FLAGS = --mpy-cross-flags='-march=x86'
291288
endif
292289

293290
ifeq ($(CROSS_COMPILE),arm-linux-gnueabi-)

ports/unix/mpconfigport.h

-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@
7979
#endif
8080
#define MICROPY_STREAMS_POSIX_API (1)
8181
#define MICROPY_OPT_COMPUTED_GOTO (1)
82-
#ifndef MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE
83-
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (1)
84-
#endif
8582
#ifndef MICROPY_OPT_LOAD_ATTR_FAST_PATH
8683
#define MICROPY_OPT_LOAD_ATTR_FAST_PATH (1)
8784
#endif

ports/unix/variants/minimal/mpconfigvariant.h

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
5656
#define MICROPY_STREAMS_NON_BLOCK (0)
5757
#define MICROPY_OPT_COMPUTED_GOTO (0)
58-
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0)
5958
#define MICROPY_OPT_LOAD_ATTR_FAST_PATH (0)
6059
#define MICROPY_OPT_MAP_LOOKUP_CACHE (0)
6160
#define MICROPY_CAN_OVERRIDE_BUILTINS (0)

ports/windows/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ SRC_QSTR_AUTO_DEPS +=
6060

6161
ifneq ($(FROZEN_MANIFEST),)
6262
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool -DMICROPY_MODULE_FROZEN_MPY=1 -DMPZ_DIG_SIZE=16
63-
MPY_CROSS_FLAGS += -mcache-lookup-bc
6463
endif
6564

6665
include $(TOP)/py/mkrules.mk

ports/windows/mpconfigport.h

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
#define MICROPY_STREAMS_NON_BLOCK (1)
6060
#define MICROPY_STREAMS_POSIX_API (1)
6161
#define MICROPY_OPT_COMPUTED_GOTO (0)
62-
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (1)
6362
#define MICROPY_MODULE_WEAK_LINKS (1)
6463
#define MICROPY_CAN_OVERRIDE_BUILTINS (1)
6564
#define MICROPY_VFS_POSIX_FILE (1)

ports/windows/msvc/genhdr.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
123123
<PreprocessorDefinitions>MICROPY_MODULE_FROZEN_MPY=1;MICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool;%(PreprocessorDefinitions)</PreprocessorDefinitions>
124124
</ClCompile>
125125
</ItemGroup>
126-
<Exec Command="$(PyPython) $(PyBaseDir)tools\makemanifest.py -v MPY_DIR=$(PyBaseDir) -v MPY_LIB_DIR=$(PyBaseDir)../micropython-lib -v PORT_DIR=$(PyWinDir) -f&quot;-mcache-lookup-bc&quot; -o $(PyBuildDir)frozen_content.c -b $(PyBuildDir) $(FrozenManifest)"/>
126+
<Exec Command="$(PyPython) $(PyBaseDir)tools\makemanifest.py -v MPY_DIR=$(PyBaseDir) -v MPY_LIB_DIR=$(PyBaseDir)../micropython-lib -v PORT_DIR=$(PyWinDir) -o $(PyBuildDir)frozen_content.c -b $(PyBuildDir) $(FrozenManifest)"/>
127127
<WriteLinesToFile File="$(TLogLocation)frozen.read.1.tlog" Lines="$(FrozenManifest)" Overwrite="True"/>
128128
</Target>
129129

py/bc.c

-14
Original file line numberDiff line numberDiff line change
@@ -304,24 +304,10 @@ void mp_setup_code_state(mp_code_state_t *code_state, size_t n_args, size_t n_kw
304304

305305
// The following table encodes the number of bytes that a specific opcode
306306
// takes up. Some opcodes have an extra byte, defined by MP_BC_MASK_EXTRA_BYTE.
307-
// There are 4 special opcodes that have an extra byte only when
308-
// MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE is enabled (and they take a qstr):
309-
// MP_BC_LOAD_NAME
310-
// MP_BC_LOAD_GLOBAL
311-
// MP_BC_LOAD_ATTR
312-
// MP_BC_STORE_ATTR
313307
uint mp_opcode_format(const byte *ip, size_t *opcode_size, bool count_var_uint) {
314308
uint f = MP_BC_FORMAT(*ip);
315309
const byte *ip_start = ip;
316310
if (f == MP_BC_FORMAT_QSTR) {
317-
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE_DYNAMIC) {
318-
if (*ip == MP_BC_LOAD_NAME
319-
|| *ip == MP_BC_LOAD_GLOBAL
320-
|| *ip == MP_BC_LOAD_ATTR
321-
|| *ip == MP_BC_STORE_ATTR) {
322-
ip += 1;
323-
}
324-
}
325311
ip += 3;
326312
} else {
327313
int extra_byte = (*ip & MP_BC_MASK_EXTRA_BYTE) == 0;

py/dynruntime.mk

-2
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,13 @@ ifeq ($(ARCH),x86)
4646
# x86
4747
CROSS =
4848
CFLAGS += -m32 -fno-stack-protector
49-
MPY_CROSS_FLAGS += -mcache-lookup-bc
5049
MICROPY_FLOAT_IMPL ?= double
5150

5251
else ifeq ($(ARCH),x64)
5352

5453
# x64
5554
CROSS =
5655
CFLAGS += -fno-stack-protector
57-
MPY_CROSS_FLAGS += -mcache-lookup-bc
5856
MICROPY_FLOAT_IMPL ?= double
5957

6058
else ifeq ($(ARCH),armv7m)

py/emitbc.c

-6
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,6 @@ void mp_emit_bc_load_global(emit_t *emit, qstr qst, int kind) {
560560
MP_STATIC_ASSERT(MP_BC_LOAD_NAME + MP_EMIT_IDOP_GLOBAL_GLOBAL == MP_BC_LOAD_GLOBAL);
561561
(void)qst;
562562
emit_write_bytecode_byte_qstr(emit, 1, MP_BC_LOAD_NAME + kind, qst);
563-
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE_DYNAMIC) {
564-
emit_write_bytecode_raw_byte(emit, 0);
565-
}
566563
}
567564

568565
void mp_emit_bc_load_method(emit_t *emit, qstr qst, bool is_super) {
@@ -596,9 +593,6 @@ void mp_emit_bc_attr(emit_t *emit, qstr qst, int kind) {
596593
}
597594
emit_write_bytecode_byte_qstr(emit, -2, MP_BC_STORE_ATTR, qst);
598595
}
599-
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE_DYNAMIC) {
600-
emit_write_bytecode_raw_byte(emit, 0);
601-
}
602596
}
603597

604598
void mp_emit_bc_store_local(emit_t *emit, qstr qst, mp_uint_t local_num, int kind) {

py/mpconfig.h

-9
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,8 @@
423423

424424
// Configure dynamic compiler macros
425425
#if MICROPY_DYNAMIC_COMPILER
426-
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE_DYNAMIC (mp_dynamic_compiler.opt_cache_map_lookup_in_bytecode)
427426
#define MICROPY_PY_BUILTINS_STR_UNICODE_DYNAMIC (mp_dynamic_compiler.py_builtins_str_unicode)
428427
#else
429-
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE_DYNAMIC MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE
430428
#define MICROPY_PY_BUILTINS_STR_UNICODE_DYNAMIC MICROPY_PY_BUILTINS_STR_UNICODE
431429
#endif
432430

@@ -520,13 +518,6 @@
520518
#define MICROPY_OPT_COMPUTED_GOTO (0)
521519
#endif
522520

523-
// Whether to cache result of map lookups in LOAD_NAME, LOAD_GLOBAL, LOAD_ATTR,
524-
// STORE_ATTR bytecodes. Uses 1 byte extra RAM for each of these opcodes and
525-
// uses a bit of extra code ROM, but greatly improves lookup speed.
526-
#ifndef MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE
527-
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0)
528-
#endif
529-
530521
// Optimise the fast path for loading attributes from instance types. Increases
531522
// Thumb2 code size by about 48 bytes.
532523
#ifndef MICROPY_OPT_LOAD_ATTR_FAST_PATH

py/mpstate.h

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#if MICROPY_DYNAMIC_COMPILER
4545
typedef struct mp_dynamic_compiler_t {
4646
uint8_t small_int_bits; // must be <= host small_int_bits
47-
bool opt_cache_map_lookup_in_bytecode;
4847
bool py_builtins_str_unicode;
4948
uint8_t native_arch;
5049
uint8_t nlr_buf_num_regs;

py/persistentcode.h

+5-6
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,15 @@
4141
#define MPY_FEATURE_ENCODE_ARCH(arch) ((arch) << 2)
4242
#define MPY_FEATURE_DECODE_ARCH(feat) ((feat) >> 2)
4343

44-
// The feature flag bits encode the compile-time config options that
45-
// affect the generate bytecode.
44+
// The feature flag bits encode the compile-time config options that affect
45+
// the generate bytecode. Note: position 0 is now unused
46+
// (formerly MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE).
4647
#define MPY_FEATURE_FLAGS ( \
47-
((MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) << 0) \
48-
| ((MICROPY_PY_BUILTINS_STR_UNICODE) << 1) \
48+
((MICROPY_PY_BUILTINS_STR_UNICODE) << 1) \
4949
)
5050
// This is a version of the flags that can be configured at runtime.
5151
#define MPY_FEATURE_FLAGS_DYNAMIC ( \
52-
((MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE_DYNAMIC) << 0) \
53-
| ((MICROPY_PY_BUILTINS_STR_UNICODE_DYNAMIC) << 1) \
52+
((MICROPY_PY_BUILTINS_STR_UNICODE_DYNAMIC) << 1) \
5453
)
5554

5655
// Define the host architecture

py/profile.c

-12
Original file line numberDiff line numberDiff line change
@@ -540,29 +540,20 @@ STATIC const byte *mp_prof_opcode_decode(const byte *ip, const mp_uint_t *const_
540540
instruction->qstr_opname = MP_QSTR_LOAD_NAME;
541541
instruction->arg = qst;
542542
instruction->argobj = MP_OBJ_NEW_QSTR(qst);
543-
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
544-
instruction->argobjex_cache = MP_OBJ_NEW_SMALL_INT(*ip++);
545-
}
546543
break;
547544

548545
case MP_BC_LOAD_GLOBAL:
549546
DECODE_QSTR;
550547
instruction->qstr_opname = MP_QSTR_LOAD_GLOBAL;
551548
instruction->arg = qst;
552549
instruction->argobj = MP_OBJ_NEW_QSTR(qst);
553-
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
554-
instruction->argobjex_cache = MP_OBJ_NEW_SMALL_INT(*ip++);
555-
}
556550
break;
557551

558552
case MP_BC_LOAD_ATTR:
559553
DECODE_QSTR;
560554
instruction->qstr_opname = MP_QSTR_LOAD_ATTR;
561555
instruction->arg = qst;
562556
instruction->argobj = MP_OBJ_NEW_QSTR(qst);
563-
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
564-
instruction->argobjex_cache = MP_OBJ_NEW_SMALL_INT(*ip++);
565-
}
566557
break;
567558

568559
case MP_BC_LOAD_METHOD:
@@ -618,9 +609,6 @@ STATIC const byte *mp_prof_opcode_decode(const byte *ip, const mp_uint_t *const_
618609
instruction->qstr_opname = MP_QSTR_STORE_ATTR;
619610
instruction->arg = qst;
620611
instruction->argobj = MP_OBJ_NEW_QSTR(qst);
621-
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
622-
instruction->argobjex_cache = MP_OBJ_NEW_SMALL_INT(*ip++);
623-
}
624612
break;
625613

626614
case MP_BC_STORE_SUBSCR:

py/showbc.c

-12
Original file line numberDiff line numberDiff line change
@@ -208,25 +208,16 @@ const byte *mp_bytecode_print_str(const mp_print_t *print, const byte *ip) {
208208
case MP_BC_LOAD_NAME:
209209
DECODE_QSTR;
210210
mp_printf(print, "LOAD_NAME %s", qstr_str(qst));
211-
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
212-
mp_printf(print, " (cache=%u)", *ip++);
213-
}
214211
break;
215212

216213
case MP_BC_LOAD_GLOBAL:
217214
DECODE_QSTR;
218215
mp_printf(print, "LOAD_GLOBAL %s", qstr_str(qst));
219-
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
220-
mp_printf(print, " (cache=%u)", *ip++);
221-
}
222216
break;
223217

224218
case MP_BC_LOAD_ATTR:
225219
DECODE_QSTR;
226220
mp_printf(print, "LOAD_ATTR %s", qstr_str(qst));
227-
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
228-
mp_printf(print, " (cache=%u)", *ip++);
229-
}
230221
break;
231222

232223
case MP_BC_LOAD_METHOD:
@@ -270,9 +261,6 @@ const byte *mp_bytecode_print_str(const mp_print_t *print, const byte *ip) {
270261
case MP_BC_STORE_ATTR:
271262
DECODE_QSTR;
272263
mp_printf(print, "STORE_ATTR %s", qstr_str(qst));
273-
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
274-
mp_printf(print, " (cache=%u)", *ip++);
275-
}
276264
break;
277265

278266
case MP_BC_STORE_SUBSCR:

0 commit comments

Comments
 (0)