Skip to content

Commit

Permalink
Update compile_byte_code(…) to accept ExecutionTarget
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasWanke committed Oct 26, 2023
1 parent db33204 commit ce85b57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compiler/vm/src/lir_to_byte_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use candy_frontend::{
cst::CstDb,
error::{CompilerError, CompilerErrorPayload},
hir,
hir_to_mir::ExecutionTarget,
id::CountableId,
lir::{Bodies, Body, BodyId, Constant, ConstantId, Constants, Expression, Id, Lir},
lir_optimize::OptimizeLir,
Expand All @@ -21,15 +22,16 @@ use std::{mem, sync::Arc};

pub fn compile_byte_code<Db>(
db: &Db,
module: Module,
target: ExecutionTarget,
tracing: TracingConfig,
) -> (ByteCode, Arc<FxHashSet<CompilerError>>)
where
Db: CstDb + OptimizeLir,
{
let module = target.module().clone();
#[allow(clippy::map_unwrap_or)]
let (lir, errors) = db
.optimized_lir(module.clone(), tracing)
.optimized_lir(target, tracing)
.map(|(lir, errors)| (lir, errors))
.unwrap_or_else(|error| {
let mut constants = Constants::default();
Expand Down

1 comment on commit ce85b57

@jwbot
Copy link
Collaborator

@jwbot jwbot commented on ce85b57 Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiler

Benchmark suite Current: ce85b57 Previous: d6a655d Ratio
Time: Compiler/hello_world 21987352 ns/iter (± 1195405) 25224884 ns/iter (± 1854066) 0.87
Time: Compiler/fibonacci 200592185 ns/iter (± 6948242) 211108741 ns/iter (± 6034413) 0.95
Time: VM Runtime/hello_world 50200 ns/iter (± 43746) 45450 ns/iter (± 15258) 1.10
Time: VM Runtime/fibonacci/15 297377393 ns/iter (± 6649220) 301077707 ns/iter (± 6852647) 0.99
Time: VM Runtime/PLB/binarytrees/6 1387439693 ns/iter (± 17046093) 1452710372 ns/iter (± 54560207) 0.96

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.