Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
sapl-interpreter
Commits
97d04517
Commit
97d04517
authored
Sep 21, 2015
by
Laszlo Domoszlai
Browse files
some inlining. same speed
parent
63c2c25b
Changes
3
Hide whitespace changes
Inline
Side-by-side
interpreter/code.c
View file @
97d04517
...
...
@@ -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
{
...
...
interpreter/thunk.c
View file @
97d04517
...
...
@@ -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
);
...
...
interpreter/thunk.h
View file @
97d04517
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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