Skip to content

Commit

Permalink
Move code around int
Browse files Browse the repository at this point in the history
Summary:
- split `mod int`
- move `inline_int` and `int_or_big` into `int`

Reviewed By: JakobDegen

Differential Revision: D63008442

fbshipit-source-id: 68957584bab5724dbbfb73dd29774a7f7b956aad
  • Loading branch information
stepancheg authored and facebook-github-bot committed Sep 19, 2024
1 parent afa9a3f commit 3235a63
Show file tree
Hide file tree
Showing 23 changed files with 471 additions and 407 deletions.
2 changes: 1 addition & 1 deletion starlark-rust/starlark/src/analysis/dubious.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use crate::codemap::FileSpan;
use crate::codemap::Span;
use crate::syntax::AstModule;
use crate::values::num::value::NumRef;
use crate::values::types::int_or_big::StarlarkInt;
use crate::values::types::int::int_or_big::StarlarkInt;

#[derive(Error, Debug)]
pub(crate) enum Dubious {
Expand Down
2 changes: 1 addition & 1 deletion starlark-rust/starlark/src/eval/bc/instr_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ use crate::eval::DefInfo;
use crate::eval::Evaluator;
use crate::eval::ParametersSpec;
use crate::values::dict::Dict;
use crate::values::int::PointerI32;
use crate::values::int::pointer_i32::PointerI32;
use crate::values::layout::value_not_special::FrozenValueNotSpecial;
use crate::values::string::dot_format::format_one;
use crate::values::string::interpolation::percent_s_one;
Expand Down
4 changes: 2 additions & 2 deletions starlark-rust/starlark/src/eval/compiler/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ use crate::values::string::interpolation::parse_percent_s_one;
use crate::values::types::dict::Dict;
use crate::values::types::ellipsis::Ellipsis;
use crate::values::types::float::StarlarkFloat;
use crate::values::types::inline_int::InlineInt;
use crate::values::types::int_or_big::StarlarkInt;
use crate::values::types::int::inline_int::InlineInt;
use crate::values::types::int::int_or_big::StarlarkInt;
use crate::values::types::list::value::FrozenListData;
use crate::values::types::list::value::ListData;
use crate::values::types::string::dot_format::format_one;
Expand Down
4 changes: 2 additions & 2 deletions starlark-rust/starlark/src/stdlib/funcs/other.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ use starlark_derive::starlark_module;
use crate as starlark;
use crate::environment::GlobalsBuilder;
use crate::eval::Evaluator;
use crate::values::int::PointerI32;
use crate::values::int::pointer_i32::PointerI32;
use crate::values::list::AllocList;
use crate::values::num::value::Num;
use crate::values::num::value::NumRef;
use crate::values::tuple::UnpackTuple;
use crate::values::types::int_or_big::StarlarkInt;
use crate::values::types::int::int_or_big::StarlarkInt;
use crate::values::typing::never::StarlarkNever;
use crate::values::typing::ty::AbstractType;
use crate::values::typing::StarlarkIter;
Expand Down
2 changes: 1 addition & 1 deletion starlark-rust/starlark/src/stdlib/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use crate::environment::GlobalsBuilder;
use crate::typing::Ty;
use crate::values::dict::AllocDict;
use crate::values::type_repr::StarlarkTypeRepr;
use crate::values::types::int_or_big::StarlarkInt;
use crate::values::types::int::int_or_big::StarlarkInt;
use crate::values::AllocFrozenValue;
use crate::values::AllocValue;
use crate::values::FrozenHeap;
Expand Down
2 changes: 1 addition & 1 deletion starlark-rust/starlark/src/values/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub(crate) fn apply_slice<T: Copy>(
#[cfg(test)]
mod tests {
use super::*;
use crate::values::types::inline_int::InlineInt;
use crate::values::types::int::inline_int::InlineInt;
use crate::values::Heap;

#[test]
Expand Down
4 changes: 2 additions & 2 deletions starlark-rust/starlark/src/values/layout/pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ use either::Either;
use static_assertions::assert_eq_size;

use crate::cast;
use crate::values::int::PointerI32;
use crate::values::int::pointer_i32::PointerI32;
use crate::values::layout::heap::repr::AValueHeader;
use crate::values::layout::heap::repr::AValueOrForward;
use crate::values::types::inline_int::InlineInt;
use crate::values::types::int::inline_int::InlineInt;

/// Tagged pointer logically equivalent to `*mut AValueHeader`.
#[derive(Clone, Copy, Dupe, PartialEq, Eq, Hash, Allocative)]
Expand Down
4 changes: 2 additions & 2 deletions starlark-rust/starlark/src/values/layout/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use crate::coerce::CoerceKey;
use crate::typing::Ty;
use crate::values::alloc_value::AllocFrozenStringValue;
use crate::values::alloc_value::AllocStringValue;
use crate::values::int::PointerI32;
use crate::values::int::pointer_i32::PointerI32;
use crate::values::layout::avalue::AValue;
use crate::values::layout::avalue::AValueImpl;
use crate::values::layout::heap::repr::AValueRepr;
Expand Down Expand Up @@ -452,7 +452,7 @@ mod tests {
use crate::assert::Assert;
use crate::environment::GlobalsBuilder;
use crate::tests::util::TestComplexValue;
use crate::values::int::PointerI32;
use crate::values::int::pointer_i32::PointerI32;
use crate::values::none::NoneType;
use crate::values::FrozenValue;
use crate::values::FrozenValueTyped;
Expand Down
8 changes: 4 additions & 4 deletions starlark-rust/starlark/src/values/layout/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ use crate::values::enumeration::FrozenEnumValue;
use crate::values::function::FrozenBoundMethod;
use crate::values::function::NativeFunction;
use crate::values::function::FUNCTION_TYPE;
use crate::values::int::PointerI32;
use crate::values::int::pointer_i32::PointerI32;
use crate::values::iter::StarlarkIterator;
use crate::values::layout::avalue::AValue;
use crate::values::layout::avalue::AValueImpl;
Expand Down Expand Up @@ -104,8 +104,8 @@ use crate::values::string::str_type::StarlarkStr;
use crate::values::structs::value::FrozenStruct;
use crate::values::tuple::value::VALUE_EMPTY_TUPLE;
use crate::values::type_repr::StarlarkTypeRepr;
use crate::values::types::inline_int::InlineInt;
use crate::values::types::int_or_big::StarlarkIntRef;
use crate::values::types::int::inline_int::InlineInt;
use crate::values::types::int::int_or_big::StarlarkIntRef;
use crate::values::types::list::value::FrozenListData;
use crate::values::types::tuple::value::FrozenTuple;
use crate::values::types::tuple::value::Tuple;
Expand Down Expand Up @@ -1395,10 +1395,10 @@ mod tests {
use num_bigint::BigInt;

use crate::assert;
use crate::values::int::pointer_i32::PointerI32;
use crate::values::list::AllocList;
use crate::values::none::NoneType;
use crate::values::string::str_type::StarlarkStr;
use crate::values::types::int::PointerI32;
use crate::values::unpack::UnpackValue;
use crate::values::Heap;
use crate::values::Value;
Expand Down
2 changes: 1 addition & 1 deletion starlark-rust/starlark/src/values/layout/vtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use crate::eval::Evaluator;
use crate::private::Private;
use crate::typing::Ty;
use crate::values::demand::Demand;
use crate::values::int::PointerI32;
use crate::values::int::pointer_i32::PointerI32;
use crate::values::layout::avalue::AValue;
use crate::values::layout::avalue::BlackHole;
use crate::values::layout::const_type_id::ConstTypeId;
Expand Down
6 changes: 3 additions & 3 deletions starlark-rust/starlark/src/values/num/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use crate as starlark;
use crate::collections::StarlarkHashValue;
use crate::values::type_repr::StarlarkTypeRepr;
use crate::values::types::float::StarlarkFloat;
use crate::values::types::int_or_big::StarlarkInt;
use crate::values::types::int_or_big::StarlarkIntRef;
use crate::values::types::int::int_or_big::StarlarkInt;
use crate::values::types::int::int_or_big::StarlarkIntRef;
use crate::values::AllocFrozenValue;
use crate::values::AllocValue;
use crate::values::UnpackValue;
Expand Down Expand Up @@ -230,7 +230,7 @@ mod tests {
use num_bigint::BigInt;

use super::*;
use crate::values::types::inline_int::InlineInt;
use crate::values::types::int::inline_int::InlineInt;
use crate::values::Value;

#[test]
Expand Down
2 changes: 0 additions & 2 deletions starlark-rust/starlark/src/values/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ pub mod enumeration;
pub mod exported_name;
pub mod float;
pub mod function;
pub(crate) mod inline_int;
pub mod int;
pub(crate) mod int_or_big;
pub(crate) mod known_methods;
pub mod list;
pub mod list_or_tuple;
Expand Down
6 changes: 3 additions & 3 deletions starlark-rust/starlark/src/values/types/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ use crate::typing::TypingBinOp;
use crate::values::num::typecheck::typecheck_num_bin_op;
use crate::values::num::typecheck::NumTy;
use crate::values::num::value::NumRef;
use crate::values::types::inline_int::InlineInt;
use crate::values::types::int_or_big::StarlarkInt;
use crate::values::types::int_or_big::StarlarkIntRef;
use crate::values::types::int::inline_int::InlineInt;
use crate::values::types::int::int_or_big::StarlarkInt;
use crate::values::types::int::int_or_big::StarlarkIntRef;
use crate::values::AllocFrozenValue;
use crate::values::AllocValue;
use crate::values::FrozenHeap;
Expand Down
4 changes: 2 additions & 2 deletions starlark-rust/starlark/src/values/types/bigint/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use num_bigint::BigInt;

use crate::typing::Ty;
use crate::values::type_repr::StarlarkTypeRepr;
use crate::values::types::int_or_big::StarlarkInt;
use crate::values::types::int_or_big::StarlarkIntRef;
use crate::values::types::int::int_or_big::StarlarkInt;
use crate::values::types::int::int_or_big::StarlarkIntRef;
use crate::values::AllocFrozenValue;
use crate::values::AllocValue;
use crate::values::FrozenHeap;
Expand Down
Loading

0 comments on commit 3235a63

Please sign in to comment.