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
2ed05f42
Commit
2ed05f42
authored
Sep 01, 2015
by
Laszlo Domoszlai
Browse files
reuse zero arg data constructors + correct semantics with forwarding
parent
3d02c031
Changes
2
Hide whitespace changes
Inline
Side-by-side
interpreter/code.c
View file @
2ed05f42
...
...
@@ -274,8 +274,16 @@ void exec(Code* expr, int frame_ptr, int root_frame_ptr)
}
case
CT_THUNK
:
{
// TODO: set forward
set_return
(
root_frame_ptr
,
&
((
ThunkEntry
*
)
expr
)
->
thunk
);
Thunk
*
target
=
get_dst
(
root_frame_ptr
);
Thunk
*
thunk
=
&
((
ThunkEntry
*
)
expr
)
->
thunk
;
if
(
target
!=
NULL
)
{
target
->
desc
=
(
Desc
*
)
__FORWARD_PTR__
;
target
->
_forward_ptr
=
thunk
;
}
set_return
(
root_frame_ptr
,
thunk
);
destroy_stack_frame
(
root_frame_ptr
);
return
;
}
...
...
interpreter/parse.c
View file @
2ed05f42
...
...
@@ -312,15 +312,13 @@ Code* parseApp(char **ptr, bool dynamic) {
Desc
*
desc
=
parseFunName
(
ptr
);
// can fail
if
(
desc
!=
NULL
)
desc
=
get_slice
(
desc
,
nrArgs
);
/*
if(desc->type == FT_ADT || desc->type == FT_SLICE)
if
(
desc
!=
NULL
&&
(
desc
->
type
==
FT_ADT
||
desc
->
type
==
FT_SLICE
))
{
struct
ThunkEntry
*
entry
=
(
ThunkEntry
*
)
alloc_code
(
sizeof
(
ThunkEntry
));
entry
->
base
.
type
=
CT_THUNK
;
entry
->
thunk
.
desc
=
desc
;
return
(
Code
*
)
entry
;
}
*/
entry
=
(
AppEntry
*
)
alloc_code
(
sizeof
(
AppEntry
));
entry
->
f
=
desc
;
...
...
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