micropython/py
Damien George c60a261ef0 py, vm: Replace save_ip, save_sp with code_state->{ip, sp}.
This may seem a bit of a risky change, in that it may introduce crazy
bugs with respect to volatile variables in the VM loop.  But, I think it
should be fine: code_state points to some external memory, so the
compiler should always read/write to that memory when accessing the
ip/sp variables (ie not put them in registers).

Anyway, it passes all tests and improves on all efficiency fronts: about
2-4% faster (64-bit unix), 16 bytes less stack space per call (64-bit
unix) and slightly less executable size (unix and stmhal).

The reason it's more efficient is save_ip and save_sp were volatile
variables, so were anyway stored on the stack (in memory, not regs).
Thus converting them to code_state->{ip, sp} doesn't cost an extra
memory dereference (except maybe to get code_state, but that can be put
in a register and then made more efficient for other uses of it).
2014-06-01 12:32:28 +01:00
..
argcheck.c Merge branch 'master' of https://github.com/micropython/micropython 2014-05-06 16:52:35 +00:00
asmthumb.c py, emitters: Fix dummy_data size for bytecode and thumb. 2014-05-10 18:07:08 +01:00
asmthumb.h py, compiler: Improve passes; add an extra pass for native emitter. 2014-05-07 17:24:22 +01:00
asmx64.c py, compiler: Improve passes; add an extra pass for native emitter. 2014-05-07 17:24:22 +01:00
asmx64.h py, compiler: Improve passes; add an extra pass for native emitter. 2014-05-07 17:24:22 +01:00
bc.h vm: Factor out structure with code execution state and pass it around. 2014-05-31 18:22:01 +03:00
bc0.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
binary.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
binary.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
builtin.c Change const byte* to const char* where sensible. 2014-05-25 22:27:57 +01:00
builtin.h unix modsocket: Make .makefile() method more compliant. 2014-05-24 21:24:37 +03:00
builtinevex.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
builtinimport.c Change const byte* to const char* where sensible. 2014-05-25 22:27:57 +01:00
builtintables.c Rename configuration variables controling Python features. 2014-05-24 23:03:12 +01:00
builtintables.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
compile.c py: Fix stack underflow with optimised for loop. 2014-05-31 17:59:11 +01:00
compile.h py: Rename BYTE_CODE to BYTECODE (this was missed in previous rename). 2014-05-12 22:35:37 +01:00
emit.h py: Fix break from within a for loop. 2014-05-30 15:20:41 +01:00
emitbc.c py: Fix break from within a for loop. 2014-05-30 15:20:41 +01:00
emitcommon.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
emitcpy.c py: Rename byte_code to bytecode everywhere. 2014-05-10 10:36:38 +01:00
emitglue.c py: Remove emit_glue init and deinit. Needed only for debugging. 2014-05-12 23:11:14 +01:00
emitglue.h py: Remove emit_glue init and deinit. Needed only for debugging. 2014-05-12 23:11:14 +01:00
emitinlinethumb.c py: Combine native emitters to 1 glue function; distinguish viper. 2014-05-10 13:40:46 +01:00
emitnative.c py: Fix break from within a for loop. 2014-05-30 15:20:41 +01:00
emitpass1.c py, compiler: Improve passes; add an extra pass for native emitter. 2014-05-07 17:24:22 +01:00
formatfloat.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
formatfloat.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
gc.c py: Compress a little the bytecode emitter structure. 2014-05-10 18:16:21 +01:00
gc.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
grammar.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
lexer.c Tidy up some configuration options. 2014-05-21 20:32:59 +01:00
lexer.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
lexerstr.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
lexerunix.c Tidy up some configuration options. 2014-05-21 20:32:59 +01:00
lexerunix.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
makeqstrdata.py More relaxed parsing of preprocessed qstr header 2014-05-03 10:26:31 +02:00
malloc.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
map.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
misc.h add methods isspace(), isalpha(), isdigit(), isupper() and islower() to str 2014-05-31 07:30:57 +01:00
mkenv.mk Have make remove targets if a recipie fails. 2014-04-16 11:36:44 -07:00
mkrules.mk build: Simplify build directory layout by putting all headers in genhdr. 2014-04-17 18:03:27 +01:00
modarray.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
modcmath.c Rename configuration variables controling Python features. 2014-05-24 23:03:12 +01:00
modcollections.c Rename configuration variables controling Python features. 2014-05-24 23:03:12 +01:00
modgc.c Rename configuration variables controling Python features. 2014-05-24 23:03:12 +01:00
modio.c Rename configuration variables controling Python features. 2014-05-24 23:03:12 +01:00
modmath.c Rename configuration variables controling Python features. 2014-05-24 23:03:12 +01:00
modmicropython.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
modstruct.c Rename configuration variables controling Python features. 2014-05-24 23:03:12 +01:00
modsys.c Rename configuration variables controling Python features. 2014-05-24 23:03:12 +01:00
mpconfig.h py: Don't automatically intern strings in parser. 2014-05-25 22:06:06 +01:00
mpz.c py: Implement bignum '&' with negatives on lhs and rhs. 2014-05-29 15:01:49 +01:00
mpz.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
nlr.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
nlrsetjmp.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
nlrthumb.S Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
nlrx64.S unix: Create __bss_start and _end symbols for Mach-O targets. 2014-05-12 00:13:10 +02:00
nlrx86.S Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
obj.c py: Rename MP_OBJ_NOT_SUPPORTED to MP_OBJ_NULL. 2014-05-21 19:42:43 +01:00
obj.h py: Fix check of small-int overflow when parsing ints. 2014-05-28 14:51:12 +01:00
objarray.c objlist: Implement support for arbitrary (3-arg) slices. 2014-05-25 22:12:56 +03:00
objarray.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
objbool.c py: Rename MP_OBJ_NOT_SUPPORTED to MP_OBJ_NULL. 2014-05-21 19:42:43 +01:00
objboundmeth.c objboundmeth: If detailed reporting enabled, print object content. 2014-05-11 02:27:42 +03:00
objcell.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
objclosure.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
objcomplex.c py: Rename MP_OBJ_NOT_SUPPORTED to MP_OBJ_NULL. 2014-05-21 19:42:43 +01:00
objdict.c py: Rename MP_OBJ_NOT_SUPPORTED to MP_OBJ_NULL. 2014-05-21 19:42:43 +01:00
objenumerate.c Merge branch 'master' of https://github.com/micropython/micropython 2014-05-06 16:52:35 +00:00
objexcept.c Change const byte* to const char* where sensible. 2014-05-25 22:27:57 +01:00
objfilter.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
objfloat.c py: Rename MP_OBJ_NOT_SUPPORTED to MP_OBJ_NULL. 2014-05-21 19:42:43 +01:00
objfun.c objfun: Typo fixes in comments. 2014-05-31 02:24:47 +03:00
objfun.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
objgenerator.c vm: Factor out structure with code execution state and pass it around. 2014-05-31 18:22:01 +03:00
objgenerator.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
objgetitemiter.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
objint.c py: Fix check of small-int overflow when parsing ints. 2014-05-28 14:51:12 +01:00
objint.h py: More const usage. 2014-05-17 11:20:10 +03:00
objint_longlong.c py: Fix check of small-int overflow when parsing ints. 2014-05-28 14:51:12 +01:00
objint_mpz.c py: Fix check of small-int overflow when parsing ints. 2014-05-28 14:51:12 +01:00
objlist.c objlist: Implement support for arbitrary (3-arg) slices. 2014-05-25 22:12:56 +03:00
objlist.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
objmap.c py: More mp_identity usage. 2014-05-17 11:20:10 +03:00
objmodule.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
objmodule.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
objnamedtuple.c Rename configuration variables controling Python features. 2014-05-24 23:03:12 +01:00
objnone.c py: Rename MP_OBJ_NOT_SUPPORTED to MP_OBJ_NULL. 2014-05-21 19:42:43 +01:00
objobject.c py: Initial attempts to actually allow implementing __new__ in Python. 2014-05-22 00:32:00 +03:00
objproperty.c Rename configuration variables controling Python features. 2014-05-24 23:03:12 +01:00
objrange.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
objset.c Rename configuration variables controling Python features. 2014-05-24 23:03:12 +01:00
objslice.c objslice: Support arbitrary objects start, stop, and step. 2014-05-25 01:42:24 +03:00
objstr.c objstr: str_uni_istype(): Spurious whitespace on empty lines. 2014-05-31 11:00:25 +03:00
objstr.h py: Slightly improve efficiency of mp_obj_new_str; rename str_new. 2014-05-25 22:34:34 +01:00
objstringio.c py: Slightly improve efficiency of mp_obj_new_str; rename str_new. 2014-05-25 22:34:34 +01:00
objtuple.c objlist: Implement support for arbitrary (3-arg) slices. 2014-05-25 22:12:56 +03:00
objtuple.h py: Rename globally-accessible tuple functions, prefix with mp_obj_. 2014-05-11 18:00:45 +01:00
objtype.c Rename configuration variables controling Python features. 2014-05-24 23:03:12 +01:00
objtype.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
objzip.c py: Use mp_arg_check_num in more places. 2014-05-11 18:37:21 +01:00
opmethods.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
parse.c py: Fix check of small-int overflow when parsing ints. 2014-05-28 14:51:12 +01:00
parse.h py: Fix check of small-int overflow when parsing ints. 2014-05-28 14:51:12 +01:00
parsehelper.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
parsehelper.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
parsenum.c py: Fix check of small-int overflow when parsing ints. 2014-05-28 14:51:12 +01:00
parsenum.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
parsenumbase.c py: Fix base "detection" for int('0<hexdigit>', 16). 2014-05-10 04:45:15 +03:00
parsenumbase.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
pfenv.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
pfenv.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
py-version.sh py-version.sh: Use --always option of git describe. 2014-05-05 21:28:12 +03:00
py.mk modgc: Add new module for GC-related functionality. 2014-05-06 02:28:49 +03:00
qstr.c Change const byte* to const char* where sensible. 2014-05-25 22:27:57 +01:00
qstr.h Change const byte* to const char* where sensible. 2014-05-25 22:27:57 +01:00
qstrdefs.h add methods isspace(), isalpha(), isdigit(), isupper() and islower() to str 2014-05-31 07:30:57 +01:00
repl.c Tidy up some configuration options. 2014-05-21 20:32:59 +01:00
repl.h Tidy up some configuration options. 2014-05-21 20:32:59 +01:00
runtime.c py: Fix check of small-int overflow when parsing ints. 2014-05-28 14:51:12 +01:00
runtime.h py: Implement long int parsing in int(...). 2014-05-28 14:07:21 +01:00
runtime0.h py: Implement long int parsing in int(...). 2014-05-28 14:07:21 +01:00
scope.c Tidy up some configuration options. 2014-05-21 20:32:59 +01:00
scope.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
sequence.c objlist: Implement support for arbitrary (3-arg) slices. 2014-05-25 22:12:56 +03:00
showbc.c Rename configuration variables controling Python features. 2014-05-24 23:03:12 +01:00
smallint.c py: Fix check of small-int overflow when parsing ints. 2014-05-28 14:51:12 +01:00
smallint.h py: Fix check of small-int overflow when parsing ints. 2014-05-28 14:51:12 +01:00
stream.c py: Slightly improve efficiency of mp_obj_new_str; rename str_new. 2014-05-25 22:34:34 +01:00
stream.h Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00
unicode.c py: Rename some unichar functions for consistency. 2014-05-11 17:53:11 +01:00
vm.c py, vm: Replace save_ip, save_sp with code_state->{ip, sp}. 2014-06-01 12:32:28 +01:00
vmentrytable.h Fix some unused variables, and silence a clang warning about initialization override in vmentrytable.h 2014-05-12 09:06:18 +02:00
vstr.c Add license header to (almost) all files. 2014-05-03 23:27:38 +01:00