Commit 97d04517 authored by Laszlo Domoszlai's avatar Laszlo Domoszlai
Browse files

some inlining. same speed

parent 63c2c25b
......@@ -87,9 +87,12 @@ struct Thunk* create_thunk_var_strict(Code* expr, int frame_ptr)
{
Thunk* arg = local(frame_ptr, ((VarEntry*) expr)->index);
// TODO: check how often happens
if(arg->desc->unboxable)
{
return createT(arg);
Thunk* target = (Thunk*) alloc_heap(sizeof (Thunk));
memcpy(target, arg, sizeof(Thunk));
return target;
}
else
{
......@@ -377,9 +380,10 @@ void exec(Code* expr, int frame_ptr, int root_frame_ptr)
assert(is_hnf(arg));
// TODO: check how often happens
if(arg->desc->unboxable)
{
arg = updateT(get_dst(root_frame_ptr), arg);
memcpy(get_dst(root_frame_ptr), arg, sizeof(Thunk));
}
else
{
......
......@@ -33,11 +33,6 @@ int readB(Thunk* thunk) {
return thunk->_bool;
}
#endif
struct Thunk* updateT(Thunk* target, Thunk* source) {
memcpy(target, source, sizeof(Thunk));
return target;
}
struct Thunk* updateF(Thunk* target, Desc* f) {
assert(f != NULL);
......
......@@ -46,10 +46,7 @@ int readB(Thunk* thunk);
#endif
struct Thunk* updateT(Thunk* target, Thunk* source);
struct Thunk* updateF(Thunk* target, Desc* f);
struct Thunk* createT(Thunk* source);
struct Thunk* createF(Desc* f);
bool is_hnf(Thunk* thunk);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment