forked from qmonnet/rbpf
-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Renames BuiltIn => Builtin. * Adds equivalence of config to BuiltinProgram::eq(). * Exposes the Arc in Executable::get_loader(). * integer_arithmetic => arithmetic_side_effects. * Stop using saturating_div().
- Loading branch information
Showing
31 changed files
with
114 additions
and
110 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
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,4 +1,4 @@ | ||
#![allow(clippy::integer_arithmetic)] | ||
#![allow(clippy::arithmetic_side_effects)] | ||
// Copyright 2017 Rich Lane <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or | ||
|
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,4 +1,4 @@ | ||
#![allow(clippy::integer_arithmetic)] | ||
#![allow(clippy::arithmetic_side_effects)] | ||
// Copyright 2017 Rich Lane <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or | ||
|
@@ -20,7 +20,7 @@ use crate::{ | |
ebpf::{self, Insn}, | ||
elf::{register_internal_function, Executable}, | ||
verifier::TautologyVerifier, | ||
vm::{BuiltInProgram, ContextObject, FunctionRegistry}, | ||
vm::{BuiltinProgram, ContextObject, FunctionRegistry}, | ||
}; | ||
use std::{collections::HashMap, sync::Arc}; | ||
|
||
|
@@ -183,15 +183,15 @@ fn insn(opc: u8, dst: i64, src: i64, off: i64, imm: i64) -> Result<Insn, String> | |
/// # Examples | ||
/// | ||
/// ``` | ||
/// use solana_rbpf::{assembler::assemble, vm::{Config, TestContextObject, BuiltInProgram}}; | ||
/// use solana_rbpf::{assembler::assemble, vm::{Config, TestContextObject, BuiltinProgram}}; | ||
/// let executable = assemble::<TestContextObject>( | ||
/// "add64 r1, 0x605 | ||
/// mov64 r2, 0x32 | ||
/// mov64 r1, r0 | ||
/// be16 r0 | ||
/// neg64 r2 | ||
/// exit", | ||
/// std::sync::Arc::new(BuiltInProgram::new_loader(Config::default())), | ||
/// std::sync::Arc::new(BuiltinProgram::new_loader(Config::default())), | ||
/// ).unwrap(); | ||
/// let program = executable.get_text_bytes().1; | ||
/// println!("{:?}", program); | ||
|
@@ -216,7 +216,7 @@ fn insn(opc: u8, dst: i64, src: i64, off: i64, imm: i64) -> Result<Insn, String> | |
/// ``` | ||
pub fn assemble<C: ContextObject>( | ||
src: &str, | ||
loader: Arc<BuiltInProgram<C>>, | ||
loader: Arc<BuiltinProgram<C>>, | ||
) -> Result<Executable<TautologyVerifier, C>, String> { | ||
fn resolve_label( | ||
insn_ptr: usize, | ||
|
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,4 +1,4 @@ | ||
#![allow(clippy::integer_arithmetic)] | ||
#![allow(clippy::arithmetic_side_effects)] | ||
// Copyright 2017 6WIND S.A. <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or | ||
|
@@ -10,7 +10,7 @@ | |
use crate::ebpf; | ||
use crate::static_analysis::CfgNode; | ||
use crate::vm::{BuiltInProgram, ContextObject, FunctionRegistry}; | ||
use crate::vm::{BuiltinProgram, ContextObject, FunctionRegistry}; | ||
use std::collections::BTreeMap; | ||
|
||
fn resolve_label(cfg_nodes: &BTreeMap<usize, CfgNode>, pc: usize) -> &str { | ||
|
@@ -121,7 +121,7 @@ pub fn disassemble_instruction<C: ContextObject>( | |
insn: &ebpf::Insn, | ||
cfg_nodes: &BTreeMap<usize, CfgNode>, | ||
function_registry: &FunctionRegistry, | ||
loader: &BuiltInProgram<C>, | ||
loader: &BuiltinProgram<C>, | ||
) -> String { | ||
let name; | ||
let desc; | ||
|
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,4 +1,4 @@ | ||
#![allow(clippy::integer_arithmetic)] | ||
#![allow(clippy::arithmetic_side_effects)] | ||
// Copyright 2016 6WIND S.A. <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or | ||
|
Oops, something went wrong.