Repository navigation
Conversation
|
Well, noone wants to implement it, so let's do it in small steps... |
There was a problem hiding this comment.
Is this doing a proper tail call? Important to keep stack usage down for imports, since they already use a lot of stack.
There was a problem hiding this comment.
Yes, it's pretty tail-recursive, and I confirmed that when compiled with optimization on x64, the function ends with jump to do_load_from_lexer.
There was a problem hiding this comment.
I verified it's a jump on stmhal. And with frozen modules not enabled, it just expands do_load_from_lexer in place here.
Only modules (not packages) supported now. Source modules can be converted to frozen module structures using tools/make-frozen.py script.
|
Ok. Feel free to merge. |
There was a problem hiding this comment.
Is it always safe to use MP_OBJ_QSTR_VALUE here instead of mp_obj_str_get_qstr? Just asking because I got bitten by it myself, see #1077
There was a problem hiding this comment.
Probably not. On line 227 the qstr is extracted from module_name using mp_obj_str_get_qstr, so should probably cache that return value and use it here.
There was a problem hiding this comment.
Wel, my general assumption that module name is identifier and thus always qstr, but thinking that it can be called as __import__, yes, need to do that.
Nrf52840 usb hid
Only modules (not packages) supported now. Source modules can be converted
to frozen module structures using tools/make-frozen.py script.