-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial outline closure implementation
- Loading branch information
1 parent
7a09996
commit ec50e2c
Showing
12 changed files
with
289 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
#include "frame.hpp" | ||
|
||
Frame::Frame(std::shared_ptr<CompiledFunction> fn, int ip, int base_pointer) : | ||
fn{fn}, ip{ip}, base_pointer{base_pointer} {} | ||
Frame::Frame(std::shared_ptr<Closure> cl, int ip, int base_pointer) : | ||
cl{cl}, ip{ip}, base_pointer{base_pointer} {} | ||
|
||
Instructions Frame::instructions() { | ||
return fn->instructions; | ||
return cl->fn->instructions; | ||
} | ||
|
||
std::shared_ptr<Frame> new_frame(std::shared_ptr<CompiledFunction> fn, int base_pointer) { | ||
return std::make_shared<Frame>(Frame(fn, -1, base_pointer)); | ||
std::shared_ptr<Frame> new_frame(std::shared_ptr<Closure> cl, int base_pointer) { | ||
return std::make_shared<Frame>(Frame(cl, -1, base_pointer)); | ||
} |
Oops, something went wrong.