Skip to content

Commit a6816be

Browse files
author
Fabrice Bellard
committed
optimized global variable access
1 parent eb2c890 commit a6816be

File tree

3 files changed

+788
-524
lines changed

3 files changed

+788
-524
lines changed

quickjs-opcode.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,14 @@ DEF( regexp, 1, 2, 1, none) /* create a RegExp object from the pattern a
123123
DEF( get_super, 1, 1, 1, none)
124124
DEF( import, 1, 2, 1, none) /* dynamic module import */
125125

126-
DEF( get_var_undef, 5, 0, 1, atom) /* push undefined if the variable does not exist */
127-
DEF( get_var, 5, 0, 1, atom) /* throw an exception if the variable does not exist */
128-
DEF( put_var, 5, 1, 0, atom) /* must come after get_var */
129-
DEF( put_var_init, 5, 1, 0, atom) /* must come after put_var. Used to initialize a global lexical variable */
126+
DEF( get_var_undef, 3, 0, 1, var_ref) /* push undefined if the variable does not exist */
127+
DEF( get_var, 3, 0, 1, var_ref) /* throw an exception if the variable does not exist */
128+
DEF( put_var, 3, 1, 0, var_ref) /* must come after get_var */
129+
DEF( put_var_init, 3, 1, 0, var_ref) /* must come after put_var. Used to initialize a global lexical variable */
130130

131131
DEF( get_ref_value, 1, 2, 3, none)
132132
DEF( put_ref_value, 1, 3, 0, none)
133133

134-
DEF( define_var, 6, 0, 0, atom_u8)
135-
DEF(check_define_var, 6, 0, 0, atom_u8)
136-
DEF( define_func, 6, 1, 0, atom_u8)
137134
DEF( get_field, 5, 1, 1, atom)
138135
DEF( get_field2, 5, 1, 2, atom)
139136
DEF( put_field, 5, 2, 0, atom)

0 commit comments

Comments
 (0)