summaryrefslogtreecommitdiff
path: root/insns.def
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-07-03 16:56:44 +0900
committerGitHub <noreply@github.com>2020-07-03 16:56:44 +0900
commita0f12a0258e4020bd657ee80b7d8f22bd33ea223 (patch)
treef6ebafa85cba2bddddc090f8d3c3b74c2c9f374b /insns.def
parent8655c2e69041cc812d30c2e951a8ac9ea7a60c47 (diff)
Use ID instead of GENTRY for gvars. (#3278)
Use ID instead of GENTRY for gvars. Global variables are compiled into GENTRY (a pointer to struct rb_global_entry). This patch replace this GENTRY to ID and make the code simple. We need to search GENTRY from ID every time (st_lookup), so additional overhead will be introduced. However, the performance of accessing global variables is not important now a day and this simplicity helps Ractor development.
Notes
Notes: Merged-By: ko1 <ko1@atdot.net>
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def14
1 files changed, 6 insertions, 8 deletions
diff --git a/insns.def b/insns.def
index 95f13915a5..c4e80040b6 100644
--- a/insns.def
+++ b/insns.def
@@ -288,25 +288,23 @@ setconstant
/* get global variable id. */
DEFINE_INSN
getglobal
-(GENTRY entry)
+(ID gid)
()
(VALUE val)
-// attr bool leaf = leafness_of_getglobal(entry);
+// attr bool leaf = false;
{
- struct rb_global_entry *gentry = (void *)entry;
- val = rb_gvar_get(gentry);
+ val = rb_gvar_get(gid);
}
/* set global variable id as val. */
DEFINE_INSN
setglobal
-(GENTRY entry)
+(ID gid)
(VALUE val)
()
-// attr bool leaf = leafness_of_setglobal(entry);
+// attr bool leaf = false;
{
- struct rb_global_entry *gentry = (void *)entry;
- rb_gvar_set(gentry, val);
+ rb_gvar_set(gid, val);
}
/**********************************************************/