-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"other" op code sanity check (#1476)
#1386 ``` block target estimation/other/flag time: [27.326 ms 27.458 ms 27.603 ms] block target estimation/other/gm time: [7.7485 ms 7.7831 ms 7.8231 ms] ``` --------- Co-authored-by: Hannes Karppila <[email protected]> Co-authored-by: xgreenx <[email protected]>
- Loading branch information
1 parent
053c260
commit 2a3b385
Showing
4 changed files
with
62 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,6 @@ pub mod contract; | |
|
||
pub mod memory; | ||
|
||
pub mod other; | ||
|
||
pub mod default_gas_costs; |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use crate::*; | ||
|
||
// ECAL | ||
// FLAG | ||
// GM | ||
// GTF | ||
|
||
pub fn run_other(group: &mut BenchmarkGroup<WallTime>) { | ||
let contract_id = ContractId::zeroed(); | ||
let asset_id = AssetId::zeroed(); | ||
let script_data = script_data(&contract_id, &asset_id); | ||
let mut shared_runner_builder = SanityBenchmarkRunnerBuilder::new_shared(contract_id); | ||
// run_group_ref( | ||
// &mut c.benchmark_group("flag"), | ||
// "flag", | ||
// VmBench::new(op::flag(0x10)), | ||
// ); | ||
run( | ||
"other/flag", | ||
group, | ||
vec![op::flag(0x10), op::jmpb(RegId::ZERO, 0)], | ||
vec![], | ||
); | ||
|
||
// ecal: Skipped because it would exit the VM | ||
|
||
// gm | ||
{ | ||
let contract_instructions = vec![op::gm(0x10, 1), op::jmpb(RegId::ZERO, 0)]; | ||
|
||
let mut instructions = setup_instructions(); | ||
instructions.extend(vec![op::call(0x10, RegId::ZERO, 0x11, 0x12)]); | ||
|
||
let id = "other/gm"; | ||
shared_runner_builder | ||
.build_with_new_contract(contract_instructions) | ||
.run(id, group, instructions, script_data.clone()); | ||
} | ||
|
||
// gtf: TODO: As part of parent issue (https://github.com/FuelLabs/fuel-core/issues/1386) | ||
} |