py: Remove 5 TODOs in emitbc, objrange and repl.
These TODOs don't need to be done: - Calling functions with keyword arguments is less common than without them, so adding an extra byte overhead to all calls regardless of whether they use keywords or not would overall increase generated bytecode size. - Restricting `range` objects to machine-sized ints has been adequate for a long time now, so no need to change that and make it more complicated and slower. - Printing spaces in tab completion does not need to be optimised. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
fce3cea244
commit
e00d80d9e2
@ -794,10 +794,10 @@ static void emit_bc_call_function_method_helper(emit_t *emit, int stack_adj, mp_
|
|||||||
// each positional arg is one object, each kwarg is two objects, the key
|
// each positional arg is one object, each kwarg is two objects, the key
|
||||||
// and the value and one extra object for the star args bitmap.
|
// and the value and one extra object for the star args bitmap.
|
||||||
stack_adj -= (int)n_positional + 2 * (int)n_keyword + 1;
|
stack_adj -= (int)n_positional + 2 * (int)n_keyword + 1;
|
||||||
emit_write_bytecode_byte_uint(emit, stack_adj, bytecode_base + 1, (n_keyword << 8) | n_positional); // TODO make it 2 separate uints?
|
emit_write_bytecode_byte_uint(emit, stack_adj, bytecode_base + 1, (n_keyword << 8) | n_positional);
|
||||||
} else {
|
} else {
|
||||||
stack_adj -= (int)n_positional + 2 * (int)n_keyword;
|
stack_adj -= (int)n_positional + 2 * (int)n_keyword;
|
||||||
emit_write_bytecode_byte_uint(emit, stack_adj, bytecode_base, (n_keyword << 8) | n_positional); // TODO make it 2 separate uints?
|
emit_write_bytecode_byte_uint(emit, stack_adj, bytecode_base, (n_keyword << 8) | n_positional);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,6 @@
|
|||||||
|
|
||||||
typedef struct _mp_obj_range_it_t {
|
typedef struct _mp_obj_range_it_t {
|
||||||
mp_obj_base_t base;
|
mp_obj_base_t base;
|
||||||
// TODO make these values generic objects or something
|
|
||||||
mp_int_t cur;
|
mp_int_t cur;
|
||||||
mp_int_t stop;
|
mp_int_t stop;
|
||||||
mp_int_t step;
|
mp_int_t step;
|
||||||
@ -72,7 +71,6 @@ static mp_obj_t mp_obj_new_range_iterator(mp_int_t cur, mp_int_t stop, mp_int_t
|
|||||||
|
|
||||||
typedef struct _mp_obj_range_t {
|
typedef struct _mp_obj_range_t {
|
||||||
mp_obj_base_t base;
|
mp_obj_base_t base;
|
||||||
// TODO make these values generic objects or something
|
|
||||||
mp_int_t start;
|
mp_int_t start;
|
||||||
mp_int_t stop;
|
mp_int_t stop;
|
||||||
mp_int_t step;
|
mp_int_t step;
|
||||||
|
|||||||
@ -225,7 +225,6 @@ static void print_completions(const mp_print_t *print,
|
|||||||
gap += WORD_SLOT_LEN;
|
gap += WORD_SLOT_LEN;
|
||||||
}
|
}
|
||||||
if (line_len + gap + d_len <= MAX_LINE_LEN) {
|
if (line_len + gap + d_len <= MAX_LINE_LEN) {
|
||||||
// TODO optimise printing of gap?
|
|
||||||
for (int j = 0; j < gap; ++j) {
|
for (int j = 0; j < gap; ++j) {
|
||||||
mp_print_str(print, " ");
|
mp_print_str(print, " ");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user