Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: recursion working in brillig #1854

Merged
merged 6 commits into from
Jul 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merge master
sirasistant committed Jul 4, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 73b1ed50c8ba7a4fa61ae14f6e34ed10c8c3306e
20 changes: 6 additions & 14 deletions crates/noirc_evaluator/src/ssa_refactor/acir_gen/mod.rs
Original file line number Diff line number Diff line change
@@ -263,19 +263,7 @@ impl Context {
RuntimeType::Brillig => {
let inputs = vecmap(arguments, |arg| self.convert_value(*arg, dfg));

// Create the entry point artifact
let mut entry_point = BrilligArtifact::new_entry_point_artifact(
BrilligFunctionContext::parameters(func),
BrilligFunctionContext::return_values(func),
BrilligFunctionContext::function_id_to_function_label(*id),
);
// Link the entry point with all dependencies
while let Some(unresolved_fn_label) = entry_point.first_unresolved_function_call() {
let artifact = &brillig.find_by_function_label(unresolved_fn_label.clone()).expect("Cannot find linked fn {unresolved_fn_label}");
entry_point.link_with(unresolved_fn_label, artifact);
}
// Generate the final bytecode
let code = entry_point.finish();
let code = self.gen_brillig_for(func, brillig);

let outputs: Vec<AcirType> = vecmap(result_ids, |result_id| dfg.type_of_value(*result_id).into());

@@ -353,7 +341,11 @@ impl Context {

fn gen_brillig_for(&self, func: &Function, brillig: &Brillig) -> Vec<Opcode> {
// Create the entry point artifact
let mut entry_point = BrilligArtifact::to_entry_point_artifact(&brillig[func.id()]);
let mut entry_point = BrilligArtifact::new_entry_point_artifact(
BrilligFunctionContext::parameters(func),
BrilligFunctionContext::return_values(func),
BrilligFunctionContext::function_id_to_function_label(*id),
);
// Link the entry point with all dependencies
while let Some(unresolved_fn_label) = entry_point.first_unresolved_function_call() {
let artifact = &brillig
You are viewing a condensed version of this merge commit. You can view the full changes here.