-
Notifications
You must be signed in to change notification settings - Fork 201
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Refs: #750
Ex.
class Foo extends Bar { /* no construct() */ }
Emits:
/* super */
emit_op(s, OP_scope_get_var);
emit_atom(s, JS_ATOM_this_active_func);
emit_u16(s, 0);
emit_op(s, OP_get_super);
emit_op(s, OP_scope_get_var);
emit_atom(s, JS_ATOM_new_target);
emit_u16(s, 0);
emit_op(s, OP_array_from);
emit_u16(s, 0);
emit_op(s, OP_push_i32);
emit_u32(s, 0);
/* arguments */
emit_op(s, OP_scope_get_var);
emit_atom(s, JS_ATOM_arguments);
emit_u16(s, 0);
emit_op(s, OP_append);
/* drop the index */
emit_op(s, OP_drop);
emit_op(s, OP_apply);
emit_u16(s, 1);
/* set the 'this' value */
emit_op(s, OP_dup);
emit_op(s, OP_scope_put_var_init);
emit_atom(s, JS_ATOM_this);
emit_u16(s, 0);
emit_class_field_init(s);
Pretty bulky and inefficient (splatting arguments
, doing js_function_apply, etc.) Probably better handled through a dedicated opcode.
Affects WBT benchmarks like babylon that create tons of such objects.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request