Logo
Explore Help
Register Sign In
fengqi/lv_micropython
1
0
Fork 0
You've already forked lv_micropython
Code Issues Pull Requests 1 Actions Packages Projects Releases Wiki Activity
lv_micropython/tests/cmdline/cmd_showbc_opt.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
365 B
Python
Raw Normal View History

py/emit: Suppress unreachable bytecode/native code that follows jump. This new logic tracks when an unconditional jump/raise occurs in the emitted code stream (bytecode or native machine code) and suppresses all subsequent code, until a label is assigned. This eliminates a lot of cases of dead code, with relatively simple logic. This commit combined with the previous one (that removed the existing dead-code finding logic) has the following code size change: bare-arm: -16 -0.028% minimal x86: -60 -0.036% unix x64: -368 -0.070% unix nanbox: -80 -0.017% stm32: -204 -0.052% PYBV10 cc3200: +0 +0.000% esp8266: -232 -0.033% GENERIC esp32: -224 -0.015% GENERIC[incl -40(data)] mimxrt: -192 -0.054% TEENSY40 renesas-ra: -200 -0.032% RA6M2_EK nrf: +28 +0.015% pca10040 rp2: -256 -0.050% PICO samd: -12 -0.009% ADAFRUIT_ITSYBITSY_M4_EXPRESS Signed-off-by: Damien George <damien@micropython.org>
2022-06-17 23:14:32 +10:00
# cmdline: -v -v
# test printing of bytecode when it's optimised away
def f0():
return 0
print(1)
def f1(x):
if x:
return
print(1)
print(2)
def f2(x):
raise Exception
print(1)
def f3(x):
while x:
break
print(1)
print(2)
def f4(x):
while x:
continue
print(1)
print(2)
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 48ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API