git.delta.rocks / jrsonnet / refs/commits / cfa49ab1b7b8

difftreelog

perf move std.object[Keys]Values[All] to native

Yaroslav Bolyukin2023-08-10parent: #be6e85a.patch.diff
in: master

6 files changed

modifiedcrates/jrsonnet-evaluator/src/arr/spec.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/arr/spec.rs
+++ b/crates/jrsonnet-evaluator/src/arr/spec.rs
@@ -9,8 +9,9 @@
 	error::ErrorKind::InfiniteRecursionDetected,
 	evaluate,
 	function::FuncVal,
+	typed::Typed,
 	val::{StrValue, ThunkValue},
-	Context, Error, Result, Thunk, Val,
+	Context, Error, ObjValue, Result, Thunk, Val,
 };
 
 pub trait ArrayLike: Any + Trace + Debug {
@@ -576,3 +577,103 @@
 		self.data.is_cheap()
 	}
 }
+
+#[derive(Trace, Debug)]
+pub struct PickObjectValues {
+	obj: ObjValue,
+	keys: Vec<IStr>,
+}
+
+impl PickObjectValues {
+	pub fn new(obj: ObjValue, keys: Vec<IStr>) -> Self {
+		Self { obj, keys }
+	}
+}
+
+impl ArrayLike for PickObjectValues {
+	fn len(&self) -> usize {
+		self.keys.len()
+	}
+
+	fn get(&self, index: usize) -> Result<Option<Val>> {
+		let Some(key) = self.keys.get(index) else {
+			return Ok(None);
+		};
+		Ok(Some(self.obj.get_or_bail(key.clone())?))
+	}
+
+	fn get_lazy(&self, index: usize) -> Option<Thunk<Val>> {
+		let Some(key) = self.keys.get(index) else {
+			return None;
+		};
+		Some(self.obj.get_lazy_or_bail(key.clone()))
+	}
+
+	fn get_cheap(&self, _index: usize) -> Option<Val> {
+		None
+	}
+
+	fn is_cheap(&self) -> bool {
+		false
+	}
+}
+
+#[derive(Trace, Debug)]
+pub struct PickObjectKeyValues {
+	obj: ObjValue,
+	keys: Vec<IStr>,
+}
+
+impl PickObjectKeyValues {
+	pub fn new(obj: ObjValue, keys: Vec<IStr>) -> Self {
+		Self { obj, keys }
+	}
+}
+
+#[derive(Typed)]
+pub struct KeyValue {
+	key: IStr,
+	value: Thunk<Val>,
+}
+
+impl ArrayLike for PickObjectKeyValues {
+	fn len(&self) -> usize {
+		self.keys.len()
+	}
+
+	fn get(&self, index: usize) -> Result<Option<Val>> {
+		let Some(key) = self.keys.get(index) else {
+			return Ok(None);
+		};
+		Ok(Some(
+			KeyValue::into_untyped(KeyValue {
+				key: key.clone(),
+				value: Thunk::evaluated(self.obj.get_or_bail(key.clone())?),
+			})
+			.expect("convertible"),
+		))
+	}
+
+	fn get_lazy(&self, index: usize) -> Option<Thunk<Val>> {
+		let Some(key) = self.keys.get(index) else {
+			return None;
+		};
+		// Nothing can fail in the key part, yet value is still
+		// lazy-evaluated
+		Some(Thunk::evaluated(
+			KeyValue::into_untyped(KeyValue {
+				key: key.clone(),
+				value: self.obj.get_lazy_or_bail(key.clone()),
+			})
+			.expect("convertible"),
+		))
+	}
+
+	fn get_cheap(&self, _index: usize) -> Option<Val> {
+		None
+	}
+
+	fn is_cheap(&self) -> bool {
+		false
+	}
+}
modifiedcrates/jrsonnet-evaluator/src/obj.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/obj.rs
+++ b/crates/jrsonnet-evaluator/src/obj.rs
@@ -12,12 +12,13 @@
 use rustc_hash::FxHashMap;
 
 use crate::{
-	error::{Error, ErrorKind::*},
+	arr::{PickObjectKeyValues, PickObjectValues},
+	error::{suggest_object_fields, Error, ErrorKind::*},
 	function::CallLocation,
 	gc::{GcHashMap, GcHashSet, TraceBox},
 	operator::evaluate_add_op,
 	tb, throw,
-	val::ThunkValue,
+	val::{ArrValue, ThunkValue},
 	MaybeUnbound, Result, State, Thunk, Unbound, Val,
 };
 
@@ -398,6 +399,14 @@
 		self.0.get_for(key, this)
 	}
 
+	pub fn get_or_bail(&self, key: IStr) -> Result<Val> {
+		let Some(value) = self.get(key.clone())? else {
+			let suggestions = suggest_object_fields(self, key.clone());
+			throw!(NoSuchField(key, suggestions))
+		};
+		Ok(value)
+	}
+
 	fn get_raw(&self, key: IStr, this: ObjValue) -> Result<Option<Val>> {
 		self.0.get_for_uncached(key, this)
 	}
@@ -452,6 +461,25 @@
 			key,
 		}))
 	}
+	pub fn get_lazy_or_bail(&self, key: IStr) -> Thunk<Val> {
+		#[derive(Trace)]
+		struct ThunkGet {
+			obj: ObjValue,
+			key: IStr,
+		}
+		impl ThunkValue for ThunkGet {
+			type Output = Val;
+
+			fn get(self: Box<Self>) -> Result<Self::Output> {
+				Ok(self.obj.get_or_bail(self.key)?)
+			}
+		}
+
+		Thunk::new(ThunkGet {
+			obj: self.clone(),
+			key,
+		})
+	}
 	pub fn ptr_eq(a: &Self, b: &Self) -> bool {
 		Cc::ptr_eq(&a.0, &b.0)
 	}
@@ -529,6 +557,51 @@
 			preserve_order,
 		)
 	}
+	pub fn values_ex(
+		&self,
+		include_hidden: bool,
+		#[cfg(feature = "exp-preserve-order")] preserve_order: bool,
+	) -> ArrValue {
+		ArrValue::new(PickObjectValues::new(
+			self.clone(),
+			self.fields_ex(
+				include_hidden,
+				#[cfg(feature = "exp-preserve-order")]
+				preserve_order,
+			),
+		))
+	}
+	pub fn values(&self, #[cfg(feature = "exp-preserve-order")] preserve_order: bool) -> ArrValue {
+		self.values_ex(
+			false,
+			#[cfg(feature = "exp-preserve-order")]
+			preserve_order,
+		)
+	}
+	pub fn key_values_ex(
+		&self,
+		include_hidden: bool,
+		#[cfg(feature = "exp-preserve-order")] preserve_order: bool,
+	) -> ArrValue {
+		ArrValue::new(PickObjectKeyValues::new(
+			self.clone(),
+			self.fields_ex(
+				include_hidden,
+				#[cfg(feature = "exp-preserve-order")]
+				preserve_order,
+			),
+		))
+	}
+	pub fn key_values(
+		&self,
+		#[cfg(feature = "exp-preserve-order")] preserve_order: bool,
+	) -> ArrValue {
+		self.key_values_ex(
+			false,
+			#[cfg(feature = "exp-preserve-order")]
+			preserve_order,
+		)
+	}
 }
 
 impl OopObject {
modifiedcrates/jrsonnet-evaluator/src/val.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/val.rs
+++ b/crates/jrsonnet-evaluator/src/val.rs
@@ -1,7 +1,6 @@
 use std::{
 	cell::RefCell,
 	fmt::{self, Debug, Display},
-	hash::Hasher,
 	mem::replace,
 	rc::Rc,
 };
@@ -9,7 +8,6 @@
 use jrsonnet_gcmodule::{Cc, Trace};
 use jrsonnet_interner::IStr;
 use jrsonnet_types::ValType;
-use rustc_hash::FxHasher;
 
 pub use crate::arr::{ArrValue, ArrayLike};
 use crate::{
@@ -50,6 +48,12 @@
 	pub fn errored(e: Error) -> Self {
 		Self(Cc::new(RefCell::new(ThunkInner::Errored(e))))
 	}
+	pub fn result(res: Result<T, Error>) -> Self {
+		match res {
+			Ok(o) => Self::evaluated(o),
+			Err(e) => Self::errored(e),
+		}
+	}
 }
 
 impl<T> Thunk<T>
modifiedcrates/jrsonnet-stdlib/src/lib.rsdiffbeforeafterboth
before · crates/jrsonnet-stdlib/src/lib.rs
1use std::{2	cell::{Ref, RefCell, RefMut},3	collections::HashMap,4	rc::Rc,5};67use jrsonnet_evaluator::{8	error::{ErrorKind::*, Result},9	function::{builtin::Builtin, CallLocation, FuncVal, TlaArg},10	gc::TraceBox,11	tb,12	trace::PathResolver,13	ContextBuilder, IStr, ObjValue, ObjValueBuilder, State, Thunk, Val,14};15use jrsonnet_gcmodule::{Cc, Trace};16use jrsonnet_parser::Source;1718mod expr;19mod types;20pub use types::*;21mod arrays;22pub use arrays::*;23mod math;24pub use math::*;25mod operator;26pub use operator::*;27mod sort;28pub use sort::*;29mod hash;30pub use hash::*;31mod encoding;32pub use encoding::*;33mod objects;34pub use objects::*;35mod manifest;36pub use manifest::*;37mod parse;38pub use parse::*;39mod strings;40pub use strings::*;41mod misc;42pub use misc::*;43mod sets;44pub use sets::*;45mod compat;46pub use compat::*;4748pub fn stdlib_uncached(settings: Rc<RefCell<Settings>>) -> ObjValue {49	let mut builder = ObjValueBuilder::new();5051	let expr = expr::stdlib_expr();52	let eval = jrsonnet_evaluator::evaluate(ContextBuilder::dangerous_empty_state().build(), &expr)53		.expect("stdlib.jsonnet should have no errors")54		.as_obj()55		.expect("stdlib.jsonnet should evaluate to object");5657	builder.with_super(eval);5859	for (name, builtin) in [60		// Types61		("type", builtin_type::INST),62		("isString", builtin_is_string::INST),63		("isNumber", builtin_is_number::INST),64		("isBoolean", builtin_is_boolean::INST),65		("isObject", builtin_is_object::INST),66		("isArray", builtin_is_array::INST),67		("isFunction", builtin_is_function::INST),68		// Arrays69		("makeArray", builtin_make_array::INST),70		("repeat", builtin_repeat::INST),71		("slice", builtin_slice::INST),72		("map", builtin_map::INST),73		("flatMap", builtin_flatmap::INST),74		("filter", builtin_filter::INST),75		("foldl", builtin_foldl::INST),76		("foldr", builtin_foldr::INST),77		("range", builtin_range::INST),78		("join", builtin_join::INST),79		("reverse", builtin_reverse::INST),80		("any", builtin_any::INST),81		("all", builtin_all::INST),82		("member", builtin_member::INST),83		("contains", builtin_member::INST),84		("count", builtin_count::INST),85		("avg", builtin_avg::INST),86		("removeAt", builtin_remove_at::INST),87		("remove", builtin_remove::INST),88		// Math89		("abs", builtin_abs::INST),90		("sign", builtin_sign::INST),91		("max", builtin_max::INST),92		("min", builtin_min::INST),93		("sum", builtin_sum::INST),94		("modulo", builtin_modulo::INST),95		("floor", builtin_floor::INST),96		("ceil", builtin_ceil::INST),97		("log", builtin_log::INST),98		("pow", builtin_pow::INST),99		("sqrt", builtin_sqrt::INST),100		("sin", builtin_sin::INST),101		("cos", builtin_cos::INST),102		("tan", builtin_tan::INST),103		("asin", builtin_asin::INST),104		("acos", builtin_acos::INST),105		("atan", builtin_atan::INST),106		("exp", builtin_exp::INST),107		("mantissa", builtin_mantissa::INST),108		("exponent", builtin_exponent::INST),109		("round", builtin_round::INST),110		("isEven", builtin_is_even::INST),111		("isOdd", builtin_is_odd::INST),112		("isInteger", builtin_is_integer::INST),113		("isDecimal", builtin_is_decimal::INST),114		// Operator115		("mod", builtin_mod::INST),116		("primitiveEquals", builtin_primitive_equals::INST),117		("equals", builtin_equals::INST),118		("xor", builtin_xor::INST),119		("xnor", builtin_xnor::INST),120		("format", builtin_format::INST),121		// Sort122		("sort", builtin_sort::INST),123		("uniq", builtin_uniq::INST),124		("set", builtin_set::INST),125		("minArray", builtin_min_array::INST),126		("maxArray", builtin_max_array::INST),127		// Hash128		("md5", builtin_md5::INST),129		("sha1", builtin_sha1::INST),130		("sha256", builtin_sha256::INST),131		("sha512", builtin_sha512::INST),132		("sha3", builtin_sha3::INST),133		// Encoding134		("encodeUTF8", builtin_encode_utf8::INST),135		("decodeUTF8", builtin_decode_utf8::INST),136		("base64", builtin_base64::INST),137		("base64Decode", builtin_base64_decode::INST),138		("base64DecodeBytes", builtin_base64_decode_bytes::INST),139		// Objects140		("objectFieldsEx", builtin_object_fields_ex::INST),141		("objectHasEx", builtin_object_has_ex::INST),142		("objectRemoveKey", builtin_object_remove_key::INST),143		// Manifest144		("escapeStringJson", builtin_escape_string_json::INST),145		("manifestJsonEx", builtin_manifest_json_ex::INST),146		("manifestYamlDoc", builtin_manifest_yaml_doc::INST),147		("manifestTomlEx", builtin_manifest_toml_ex::INST),148		// Parsing149		("parseJson", builtin_parse_json::INST),150		("parseYaml", builtin_parse_yaml::INST),151		// Strings152		("codepoint", builtin_codepoint::INST),153		("substr", builtin_substr::INST),154		("char", builtin_char::INST),155		("strReplace", builtin_str_replace::INST),156		("isEmpty", builtin_is_empty::INST),157		("equalsIgnoreCase", builtin_equals_ignore_case::INST),158		("splitLimit", builtin_splitlimit::INST),159		("asciiUpper", builtin_ascii_upper::INST),160		("asciiLower", builtin_ascii_lower::INST),161		("findSubstr", builtin_find_substr::INST),162		("parseInt", builtin_parse_int::INST),163		#[cfg(feature = "exp-bigint")]164		("bigint", builtin_bigint::INST),165		("parseOctal", builtin_parse_octal::INST),166		("parseHex", builtin_parse_hex::INST),167		// Misc168		("length", builtin_length::INST),169		("startsWith", builtin_starts_with::INST),170		("endsWith", builtin_ends_with::INST),171		// Sets172		("setMember", builtin_set_member::INST),173		("setInter", builtin_set_inter::INST),174		// Compat175		("__compare", builtin___compare::INST),176	]177	.iter()178	.cloned()179	{180		builder181			.member(name.into())182			.hide()183			.value(Val::Func(FuncVal::StaticBuiltin(builtin)))184			.expect("no conflict");185	}186187	builder188		.member("extVar".into())189		.hide()190		.value(Val::Func(FuncVal::builtin(builtin_ext_var {191			settings: settings.clone(),192		})))193		.expect("no conflict");194	builder195		.member("native".into())196		.hide()197		.value(Val::Func(FuncVal::builtin(builtin_native {198			settings: settings.clone(),199		})))200		.expect("no conflict");201	builder202		.member("trace".into())203		.hide()204		.value(Val::Func(FuncVal::builtin(builtin_trace { settings })))205		.expect("no conflict");206207	builder208		.member("id".into())209		.hide()210		.value(Val::Func(FuncVal::Id))211		.expect("no conflict");212213	builder.build()214}215216pub trait TracePrinter {217	fn print_trace(&self, loc: CallLocation, value: IStr);218}219220pub struct StdTracePrinter {221	resolver: PathResolver,222}223impl StdTracePrinter {224	pub fn new(resolver: PathResolver) -> Self {225		Self { resolver }226	}227}228impl TracePrinter for StdTracePrinter {229	fn print_trace(&self, loc: CallLocation, value: IStr) {230		eprint!("TRACE:");231		if let Some(loc) = loc.0 {232			let locs = loc.0.map_source_locations(&[loc.1]);233			eprint!(234				" {}:{}",235				match loc.0.source_path().path() {236					Some(p) => self.resolver.resolve(p),237					None => loc.0.source_path().to_string(),238				},239				locs[0].line240			);241		}242		eprintln!(" {value}");243	}244}245246pub struct Settings {247	/// Used for `std.extVar`248	pub ext_vars: HashMap<IStr, TlaArg>,249	/// Used for `std.native`250	pub ext_natives: HashMap<IStr, Cc<TraceBox<dyn Builtin>>>,251	/// Used for `std.trace`252	pub trace_printer: Box<dyn TracePrinter>,253	/// Used for `std.thisFile`254	pub path_resolver: PathResolver,255}256257fn extvar_source(name: &str, code: impl Into<IStr>) -> Source {258	let source_name = format!("<extvar:{name}>");259	Source::new_virtual(source_name.into(), code.into())260}261262#[derive(Trace, Clone)]263pub struct ContextInitializer {264	/// When we don't need to support legacy-this-file, we can reuse same context for all files265	#[cfg(not(feature = "legacy-this-file"))]266	context: jrsonnet_evaluator::Context,267	/// For `populate`268	#[cfg(not(feature = "legacy-this-file"))]269	stdlib_thunk: Thunk<Val>,270	/// Otherwise, we can only keep first stdlib layer, and then stack thisFile on top of it271	#[cfg(feature = "legacy-this-file")]272	stdlib_obj: ObjValue,273	settings: Rc<RefCell<Settings>>,274}275impl ContextInitializer {276	pub fn new(_s: State, resolver: PathResolver) -> Self {277		let settings = Settings {278			ext_vars: Default::default(),279			ext_natives: Default::default(),280			trace_printer: Box::new(StdTracePrinter::new(resolver.clone())),281			path_resolver: resolver,282		};283		let settings = Rc::new(RefCell::new(settings));284		let stdlib_obj = stdlib_uncached(settings.clone());285		#[cfg(not(feature = "legacy-this-file"))]286		let stdlib_thunk = Thunk::evaluated(Val::Obj(stdlib_obj));287		Self {288			#[cfg(not(feature = "legacy-this-file"))]289			context: {290				let mut context = ContextBuilder::with_capacity(_s, 1);291				context.bind("std".into(), stdlib_thunk.clone());292				context.build()293			},294			#[cfg(not(feature = "legacy-this-file"))]295			stdlib_thunk,296			#[cfg(feature = "legacy-this-file")]297			stdlib_obj,298			settings,299		}300	}301	pub fn settings(&self) -> Ref<Settings> {302		self.settings.borrow()303	}304	pub fn settings_mut(&self) -> RefMut<Settings> {305		self.settings.borrow_mut()306	}307	pub fn add_ext_var(&self, name: IStr, value: Val) {308		self.settings_mut()309			.ext_vars310			.insert(name, TlaArg::Val(value));311	}312	pub fn add_ext_str(&self, name: IStr, value: IStr) {313		self.settings_mut()314			.ext_vars315			.insert(name, TlaArg::String(value));316	}317	pub fn add_ext_code(&self, name: &str, code: impl Into<IStr>) -> Result<()> {318		let code = code.into();319		let source = extvar_source(name, code.clone());320		let parsed = jrsonnet_parser::parse(321			&code,322			&jrsonnet_parser::ParserSettings {323				source: source.clone(),324			},325		)326		.map_err(|e| ImportSyntaxError {327			path: source,328			error: Box::new(e),329		})?;330		// self.data_mut().volatile_files.insert(source_name, code);331		self.settings_mut()332			.ext_vars333			.insert(name.into(), TlaArg::Code(parsed));334		Ok(())335	}336	pub fn add_native(&self, name: IStr, cb: impl Builtin) {337		self.settings_mut()338			.ext_natives339			.insert(name, Cc::new(tb!(cb)));340	}341}342impl jrsonnet_evaluator::ContextInitializer for ContextInitializer {343	fn reserve_vars(&self) -> usize {344		1345	}346	#[cfg(not(feature = "legacy-this-file"))]347	fn initialize(&self, _s: State, _source: Source) -> jrsonnet_evaluator::Context {348		self.context.clone()349	}350	#[cfg(not(feature = "legacy-this-file"))]351	fn populate(&self, _for_file: Source, builder: &mut ContextBuilder) {352		builder.bind("std".into(), self.stdlib_thunk.clone());353	}354	#[cfg(feature = "legacy-this-file")]355	fn populate(&self, source: Source, builder: &mut ContextBuilder) {356		use jrsonnet_evaluator::val::StrValue;357358		let mut std = ObjValueBuilder::new();359		std.with_super(self.stdlib_obj.clone());360		std.member("thisFile".into())361			.hide()362			.value(Val::Str(StrValue::Flat(363				match source.source_path().path() {364					Some(p) => self.settings().path_resolver.resolve(p).into(),365					None => source.source_path().to_string().into(),366				},367			)))368			.expect("this object builder is empty");369		let stdlib_with_this_file = std.build();370371		builder.bind(372			"std".into(),373			Thunk::evaluated(Val::Obj(stdlib_with_this_file)),374		);375	}376	fn as_any(&self) -> &dyn std::any::Any {377		self378	}379}380381pub trait StateExt {382	/// This method was previously implemented in jrsonnet-evaluator itself383	fn with_stdlib(&self);384}385386impl StateExt for State {387	fn with_stdlib(&self) {388		let initializer = ContextInitializer::new(self.clone(), PathResolver::new_cwd_fallback());389		self.settings_mut().context_initializer = tb!(initializer)390	}391}
modifiedcrates/jrsonnet-stdlib/src/objects.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/objects.rs
+++ b/crates/jrsonnet-stdlib/src/objects.rs
@@ -1,6 +1,6 @@
 use jrsonnet_evaluator::{
 	function::builtin,
-	val::{StrValue, Val},
+	val::{ArrValue, StrValue, Val},
 	IStr, ObjValue, ObjValueBuilder,
 };
 
@@ -23,6 +23,82 @@
 		.collect::<Vec<_>>()
 }
 
+pub fn builtin_object_values_ex(
+	o: ObjValue,
+	include_hidden: bool,
+	#[cfg(feature = "exp-preserve-order")] preserve_order: Option<bool>,
+) -> ArrValue {
+	#[cfg(feature = "exp-preserve-order")]
+	let preserve_order = preserve_order.unwrap_or(false);
+	o.values_ex(
+		include_hidden,
+		#[cfg(feature = "exp-preserve-order")]
+		preserve_order,
+	)
+}
+#[builtin]
+pub fn builtin_object_values(
+	o: ObjValue,
+	#[cfg(feature = "exp-preserve-order")] preserve_order: Option<bool>,
+) -> ArrValue {
+	builtin_object_values_ex(
+		o,
+		false,
+		#[cfg(feature = "exp-preserve-order")]
+		preserve_order,
+	)
+}
+#[builtin]
+pub fn builtin_object_values_all(
+	o: ObjValue,
+	#[cfg(feature = "exp-preserve-order")] preserve_order: Option<bool>,
+) -> ArrValue {
+	builtin_object_values_ex(
+		o,
+		true,
+		#[cfg(feature = "exp-preserve-order")]
+		preserve_order,
+	)
+}
+
+pub fn builtin_object_keys_values_ex(
+	o: ObjValue,
+	include_hidden: bool,
+	#[cfg(feature = "exp-preserve-order")] preserve_order: Option<bool>,
+) -> ArrValue {
+	#[cfg(feature = "exp-preserve-order")]
+	let preserve_order = preserve_order.unwrap_or(false);
+	o.key_values_ex(
+		include_hidden,
+		#[cfg(feature = "exp-preserve-order")]
+		preserve_order,
+	)
+}
+#[builtin]
+pub fn builtin_object_keys_values(
+	o: ObjValue,
+	#[cfg(feature = "exp-preserve-order")] preserve_order: Option<bool>,
+) -> ArrValue {
+	builtin_object_keys_values_ex(
+		o,
+		false,
+		#[cfg(feature = "exp-preserve-order")]
+		preserve_order,
+	)
+}
+#[builtin]
+pub fn builtin_object_keys_values_all(
+	o: ObjValue,
+	#[cfg(feature = "exp-preserve-order")] preserve_order: Option<bool>,
+) -> ArrValue {
+	builtin_object_keys_values_ex(
+		o,
+		true,
+		#[cfg(feature = "exp-preserve-order")]
+		preserve_order,
+	)
+}
+
 #[builtin]
 pub fn builtin_object_has_ex(obj: ObjValue, fname: IStr, hidden: bool) -> bool {
 	obj.has_field_ex(fname, hidden)
modifiedcrates/jrsonnet-stdlib/src/std.jsonnetdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/std.jsonnet
+++ b/crates/jrsonnet-stdlib/src/std.jsonnet
@@ -268,18 +268,6 @@
   objectHasAll(o, f)::
     std.objectHasEx(o, f, true),
 
-  objectValues(o)::
-    [o[k] for k in std.objectFields(o)],
-
-  objectValuesAll(o)::
-    [o[k] for k in std.objectFieldsAll(o)],
-
-  objectKeysValues(o)::
-    [{ key: k, value: o[k] } for k in std.objectFields(o)],
-	
-  objectKeysValuesAll(o)::
-		[{ key: k, value: o[k] } for k in std.objectFieldsAll(o)],
-
   resolvePath(f, r)::
     local arr = std.split(f, '/');
     std.join('/', std.makeArray(std.length(arr) - 1, function(i) arr[i]) + [r]),