Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
doehyunbaek committed Feb 13, 2024
1 parent d1591a1 commit f74f5f8
Show file tree
Hide file tree
Showing 7 changed files with 262 additions and 362 deletions.
326 changes: 0 additions & 326 deletions crates/replay_gen/src/jsgen.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/replay_gen/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{fs::File, io::Write};

pub mod irgen;
pub mod jsgen;
pub mod opt;
pub mod trace;
pub mod wasmgen;
Expand Down
13 changes: 3 additions & 10 deletions crates/replay_gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ use std::path::Path;
use std::{env, fs};

use replay_gen::irgen::IRGenerator;
use replay_gen::jsgen::generate_replay_javascript;
use replay_gen::opt::{discard_empty_body, merge_fn_results, split_big_body};
use replay_gen::trace;
use replay_gen::wasmgen::generate_replay_wasm;
use replay_gen::wasmgen::generate_replay;
use walrus::Module;

fn main() -> io::Result<()> {
Expand Down Expand Up @@ -46,16 +45,10 @@ fn main() -> io::Result<()> {
// opt phase
merge_fn_results(&mut generator.replay);
discard_empty_body(&mut generator.replay);
split_big_body(&mut generator.replay);

// codegen phase
let is_standalone = replay_path.is_none();
let is_replay_wasm = !is_standalone && replay_path.unwrap().extension().unwrap() == "wasm";
if is_replay_wasm {
split_big_body(&mut generator.replay); // works only for wasm
generate_replay_wasm(replay_path.unwrap(), &generator.replay)?;
} else {
generate_replay_javascript(replay_path.unwrap(), &generator.replay)?;
}
generate_replay(replay_path.unwrap(), &generator.replay)?;

Ok(())
}
Loading

0 comments on commit f74f5f8

Please sign in to comment.