Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
de7c4251
Commit
de7c4251
authored
Apr 17, 2014
by
Damien George
Browse files
py: Simplify objfun/objgenerator connection, no need to call bc_get.
parent
d89b69eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
py/obj.h
View file @
de7c4251
...
...
@@ -496,7 +496,6 @@ typedef struct _mp_obj_fun_native_t { // need this so we can define const object
// such functions won't be able to access the global scope, but that's probably okay
}
mp_obj_fun_native_t
;
void
mp_obj_fun_bc_get
(
mp_obj_t
self_in
,
int
*
n_args
,
const
byte
**
code
);
bool
mp_obj_fun_prepare_simple_args
(
mp_obj_t
self_in
,
uint
n_args
,
uint
n_kw
,
const
mp_obj_t
*
args
,
uint
*
out_args1_len
,
const
mp_obj_t
**
out_args1
,
uint
*
out_args2_len
,
const
mp_obj_t
**
out_args2
);
...
...
py/objfun.c
View file @
de7c4251
...
...
@@ -375,13 +375,6 @@ mp_obj_t mp_obj_new_fun_bc(uint scope_flags, qstr *args, uint n_args, mp_obj_t d
return
o
;
}
void
mp_obj_fun_bc_get
(
mp_obj_t
self_in
,
int
*
n_args
,
const
byte
**
code
)
{
assert
(
MP_OBJ_IS_TYPE
(
self_in
,
&
mp_type_fun_bc
));
mp_obj_fun_bc_t
*
self
=
self_in
;
*
n_args
=
self
->
n_args
;
*
code
=
self
->
bytecode
;
}
/******************************************************************************/
/* inline assembler functions */
...
...
py/objgenerator.c
View file @
de7c4251
...
...
@@ -26,9 +26,6 @@ STATIC mp_obj_t gen_wrap_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp
mp_obj_gen_wrap_t
*
self
=
self_in
;
mp_obj_fun_bc_t
*
self_fun
=
(
mp_obj_fun_bc_t
*
)
self
->
fun
;
assert
(
MP_OBJ_IS_TYPE
(
self_fun
,
&
mp_type_fun_bc
));
int
bc_n_args
;
const
byte
*
bc_code
;
mp_obj_fun_bc_get
(
self_fun
,
&
bc_n_args
,
&
bc_code
);
const
mp_obj_t
*
args1
,
*
args2
;
uint
len1
,
len2
;
...
...
@@ -36,7 +33,7 @@ STATIC mp_obj_t gen_wrap_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp
assert
(
0
);
}
return
mp_obj_new_gen_instance
(
self_fun
->
globals
,
bc_
code
,
len1
,
args1
,
len2
,
args2
);
return
mp_obj_new_gen_instance
(
self_fun
->
globals
,
self_fun
->
byte
code
,
len1
,
args1
,
len2
,
args2
);
}
const
mp_obj_type_t
mp_type_gen_wrap
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment