Skip to content

Commit

Permalink
YJIT doesn't need rb_obj_ensure_iv_index_mapping
Browse files Browse the repository at this point in the history
We should make this function static and remove it from YJIT bindings.
  • Loading branch information
tenderlove committed Oct 15, 2022
1 parent 53e0e5e commit 1acc1a5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion internal/variable.h
Expand Up @@ -35,7 +35,6 @@ void rb_gvar_ractor_local(const char *name);
static inline bool ROBJ_TRANSIENT_P(VALUE obj);
static inline void ROBJ_TRANSIENT_SET(VALUE obj);
static inline void ROBJ_TRANSIENT_UNSET(VALUE obj);
uint32_t rb_obj_ensure_iv_index_mapping(VALUE obj, ID id);

struct gen_ivtbl;
int rb_gen_ivtbl_get(VALUE obj, ID id, struct gen_ivtbl **ivtbl);
Expand Down
2 changes: 1 addition & 1 deletion variable.c
Expand Up @@ -1449,7 +1449,7 @@ rb_init_iv_list(VALUE obj)
// @note May raise when there are too many instance variables.
// @note YJIT uses this function at compile time to simplify the work needed to
// access the variable at runtime.
uint32_t
static uint32_t
rb_obj_ensure_iv_index_mapping(VALUE obj, ID id)
{
RUBY_ASSERT(RB_TYPE_P(obj, T_OBJECT));
Expand Down
1 change: 0 additions & 1 deletion yjit/bindgen/src/main.rs
Expand Up @@ -304,7 +304,6 @@ fn main() {

// From internal/variable.h
.allowlist_function("rb_gvar_(get|set)")
.allowlist_function("rb_obj_ensure_iv_index_mapping")

// From include/ruby/internal/intern/variable.h
.allowlist_function("rb_attr_get")
Expand Down
3 changes: 0 additions & 3 deletions yjit/src/cruby_bindings.inc.rs
Expand Up @@ -1015,9 +1015,6 @@ extern "C" {
extern "C" {
pub fn rb_hash_resurrect(hash: VALUE) -> VALUE;
}
extern "C" {
pub fn rb_obj_ensure_iv_index_mapping(obj: VALUE, id: ID) -> u32;
}
extern "C" {
pub fn rb_gvar_get(arg1: ID) -> VALUE;
}
Expand Down

0 comments on commit 1acc1a5

Please sign in to comment.