Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2fc18f3

Browse files
authored
Update QuickJS to 2019年08月10日. (PetterS#5)
* Update QuickJS. * Bump version to 1.6.0.
1 parent 91745fa commit 2fc18f3

File tree

5 files changed

+1618
-384
lines changed

5 files changed

+1618
-384
lines changed

‎setup.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from setuptools import setup, Extension
55

6-
CONFIG_VERSION = '2019-07-28'
6+
CONFIG_VERSION = '2019-08-10'
77
extra_link_args = []
88

99
if sys.platform == "win32":
@@ -48,7 +48,7 @@ def get_c_sources(include_headers=False):
4848
author_email="petter.strandmark@gmail.com",
4949
name='quickjs',
5050
url='https://github.com/PetterS/quickjs',
51-
version='1.5.1',
51+
version='1.6.0',
5252
description='Wrapping the quickjs C library.',
5353
long_description=long_description,
5454
packages=["quickjs"],

‎third-party/quickjs-atom.h‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ DEF(raw, "raw")
144144
DEF(new_target, "new.target")
145145
DEF(this_active_func, "this.active_func")
146146
DEF(home_object, "<home_object>")
147+
DEF(computed_field, "<computed_field>")
148+
DEF(static_computed_field, "<static_computed_field>") /* must come after computed_fields */
149+
DEF(class_fields_init, "<class_fields_init>")
150+
DEF(brand, "<brand>")
151+
DEF(hash_constructor, "#constructor")
147152
DEF(as, "as")
148153
DEF(from, "from")
149154
DEF(_default_, "*default*")
@@ -234,7 +239,8 @@ DEF(SyntaxError, "SyntaxError")
234239
DEF(TypeError, "TypeError")
235240
DEF(URIError, "URIError")
236241
DEF(InternalError, "InternalError")
237-
242+
/* private symbols */
243+
DEF(Private_brand, "<brand>")
238244
/* symbols */
239245
DEF(Symbol_toPrimitive, "Symbol.toPrimitive")
240246
DEF(Symbol_iterator, "Symbol.iterator")

‎third-party/quickjs-opcode.h‎

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,20 @@ FMT(label_u16)
6161
#define def(id, size, n_pop, n_push, f) DEF(id, size, n_pop, n_push, f)
6262
#endif
6363

64-
def(invalid, 1, 0, 0, none) /* never emitted */
64+
DEF(invalid, 1, 0, 0, none) /* never emitted */
6565

6666
/* push values */
6767
DEF( push_i32, 5, 0, 1, i32)
6868
DEF( push_const, 5, 0, 1, const)
6969
DEF( fclosure, 5, 0, 1, const) /* must follow push_const */
7070
DEF(push_atom_value, 5, 0, 1, atom)
71+
DEF( private_symbol, 5, 0, 1, atom)
7172
DEF( undefined, 1, 0, 1, none)
7273
DEF( null, 1, 0, 1, none)
7374
DEF( push_this, 1, 0, 1, none) /* only used at the start of a function */
7475
DEF( push_false, 1, 0, 1, none)
7576
DEF( push_true, 1, 0, 1, none)
7677
DEF( object, 1, 0, 1, none)
77-
DEF( var_object, 1, 0, 1, none)
7878
DEF( special_object, 2, 0, 1, u8) /* only used at the start of a function */
7979
DEF( rest, 3, 0, 1, u16) /* only used at the start of a function */
8080

@@ -109,6 +109,8 @@ DEF( return, 1, 1, 0, none)
109109
DEF( return_undef, 1, 0, 0, none)
110110
DEF(check_ctor_return, 1, 1, 2, none)
111111
DEF( check_ctor, 1, 0, 0, none)
112+
DEF( check_brand, 1, 2, 2, none) /* this_obj func -> this_obj func */
113+
DEF( add_brand, 1, 2, 0, none) /* this_obj home_obj -> */
112114
DEF( return_async, 1, 1, 0, none)
113115
DEF( throw, 1, 1, 0, none)
114116
DEF( throw_var, 6, 0, 0, atom_u8)
@@ -135,6 +137,9 @@ DEF( define_func, 6, 1, 0, atom_u8)
135137
DEF( get_field, 5, 1, 1, atom)
136138
DEF( get_field2, 5, 1, 2, atom)
137139
DEF( put_field, 5, 2, 0, atom)
140+
DEF( get_private_field, 1, 2, 1, none) /* obj prop -> value */
141+
DEF( put_private_field, 1, 3, 0, none) /* obj value prop -> */
142+
DEF(define_private_field, 1, 3, 1, none) /* obj prop value -> obj */
138143
DEF( get_array_el, 1, 2, 1, none)
139144
DEF( get_array_el2, 1, 2, 2, none) /* obj prop -> obj value */
140145
DEF( put_array_el, 1, 3, 0, none)
@@ -144,12 +149,13 @@ DEF( define_field, 5, 2, 1, atom)
144149
DEF( set_name, 5, 1, 1, atom)
145150
DEF(set_name_computed, 1, 2, 2, none)
146151
DEF( set_proto, 1, 2, 1, none)
152+
DEF(set_home_object, 1, 2, 2, none)
147153
DEF(define_array_el, 1, 3, 2, none)
148154
DEF( append, 1, 3, 2, none) /* append enumerated object, update length */
149155
DEF(copy_data_properties, 2, 3, 3, u8)
150156
DEF( define_method, 6, 2, 1, atom_u8)
151157
DEF(define_method_computed, 2, 3, 1, u8) /* must come after define_method */
152-
DEF( define_class, 2, 2, 2, u8)
158+
DEF( define_class, 6, 2, 2, atom_u8)
153159

154160
DEF( get_loc, 3, 0, 1, loc)
155161
DEF( put_loc, 3, 1, 0, loc) /* must come after get_loc */
@@ -161,34 +167,20 @@ DEF( get_var_ref, 3, 0, 1, var_ref)
161167
DEF( put_var_ref, 3, 1, 0, var_ref) /* must come after get_var_ref */
162168
DEF( set_var_ref, 3, 1, 1, var_ref) /* must come after put_var_ref */
163169
DEF(set_loc_uninitialized, 3, 0, 0, loc)
164-
def(set_arg_valid_upto, 3, 0, 0, arg) /* emitted in phase 1, removed in phase 2 */
165170
DEF( get_loc_check, 3, 0, 1, loc)
166171
DEF( put_loc_check, 3, 1, 0, loc) /* must come after get_loc_check */
167172
DEF( put_loc_check_init, 3, 1, 0, loc)
168173
DEF(get_var_ref_check, 3, 0, 1, var_ref)
169174
DEF(put_var_ref_check, 3, 1, 0, var_ref) /* must come after get_var_ref_check */
170175
DEF(put_var_ref_check_init, 3, 1, 0, var_ref)
171176
DEF( close_loc, 3, 0, 0, loc)
172-
def(close_var_object, 1, 0, 0, none) /* emitted in phase 1, removed in phase 2 */
173-
def( enter_scope, 3, 0, 0, u16) /* emitted in phase 1, removed in phase 2 */
174-
def( leave_scope, 3, 0, 0, u16) /* emitted in phase 1, removed in phase 2 */
175-
176177
DEF( if_false, 5, 1, 0, label)
177178
DEF( if_true, 5, 1, 0, label) /* must come after if_false */
178179
DEF( goto, 5, 0, 0, label) /* must come after if_true */
179-
def( label, 5, 0, 0, label) /* emitted in phase 1, removed in phase 3 */
180180
DEF( catch, 5, 0, 1, label)
181181
DEF( gosub, 5, 0, 0, label) /* used to execute the finally block */
182182
DEF( ret, 1, 1, 0, none) /* used to return from the finally block */
183183

184-
def(scope_get_var_undef, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
185-
def( scope_get_var, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
186-
def( scope_put_var, 7, 1, 0, atom_u16) /* emitted in phase 1, removed in phase 2 */
187-
def(scope_delete_var, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
188-
def( scope_make_ref, 11, 0, 2, atom_label_u16) /* emitted in phase 1, removed in phase 2 */
189-
def( scope_get_ref, 7, 0, 2, atom_u16) /* emitted in phase 1, removed in phase 2 */
190-
def(scope_put_var_init, 7, 0, 2, atom_u16) /* emitted in phase 1, removed in phase 2 */
191-
192184
DEF( to_object, 1, 1, 1, none)
193185
//DEF( to_string, 1, 1, 1, none)
194186
DEF( to_propkey, 1, 1, 1, none)
@@ -206,8 +198,6 @@ DEF( make_arg_ref, 7, 0, 2, atom_u16)
206198
DEF(make_var_ref_ref, 7, 0, 2, atom_u16)
207199
DEF( make_var_ref, 5, 0, 2, atom)
208200

209-
def( line_num, 5, 0, 0, u32) /* emitted in phase 1, removed in phase 3 */
210-
211201
DEF( for_in_start, 1, 1, 1, none)
212202
DEF( for_of_start, 1, 1, 3, none)
213203
DEF(for_await_of_start, 1, 1, 3, none)
@@ -270,6 +260,31 @@ DEF( math_div, 1, 2, 1, none)
270260
DEF( math_mod, 1, 2, 1, none)
271261
DEF( math_pow, 1, 2, 1, none)
272262
#endif
263+
/* must be the last non short and non temporary opcode */
264+
DEF( nop, 1, 0, 0, none)
265+
266+
/* temporary opcodes: never emitted in the final bytecode */
267+
268+
def(set_arg_valid_upto, 3, 0, 0, arg) /* emitted in phase 1, removed in phase 2 */
269+
270+
def(close_var_object, 1, 0, 0, none) /* emitted in phase 1, removed in phase 2 */
271+
def( enter_scope, 3, 0, 0, u16) /* emitted in phase 1, removed in phase 2 */
272+
def( leave_scope, 3, 0, 0, u16) /* emitted in phase 1, removed in phase 2 */
273+
274+
def( label, 5, 0, 0, label) /* emitted in phase 1, removed in phase 3 */
275+
276+
def(scope_get_var_undef, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
277+
def( scope_get_var, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
278+
def( scope_put_var, 7, 1, 0, atom_u16) /* emitted in phase 1, removed in phase 2 */
279+
def(scope_delete_var, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
280+
def( scope_make_ref, 11, 0, 2, atom_label_u16) /* emitted in phase 1, removed in phase 2 */
281+
def( scope_get_ref, 7, 0, 2, atom_u16) /* emitted in phase 1, removed in phase 2 */
282+
def(scope_put_var_init, 7, 0, 2, atom_u16) /* emitted in phase 1, removed in phase 2 */
283+
def(scope_get_private_field, 7, 1, 1, atom_u16) /* obj -> value, emitted in phase 1, removed in phase 2 */
284+
def(scope_get_private_field2, 7, 1, 2, atom_u16) /* obj -> obj value, emitted in phase 1, removed in phase 2 */
285+
def(scope_put_private_field, 7, 1, 1, atom_u16) /* obj value ->, emitted in phase 1, removed in phase 2 */
286+
287+
def( line_num, 5, 0, 0, u32) /* emitted in phase 1, removed in phase 3 */
273288

274289
#if SHORT_OPCODES
275290
DEF( push_minus1, 1, 0, 1, none_int)
@@ -345,8 +360,6 @@ DEF( is_null, 1, 1, 1, none)
345360
DEF( is_function, 1, 1, 1, none)
346361
#endif
347362

348-
DEF( nop, 1, 0, 0, none) /* temporary use during code generation */
349-
350363
#undef DEF
351364
#undef def
352365
#endif /* DEF */

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /