MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

consolidate helper utilities, inline small functions, remove unused prototypes

+98 -182
+1 -1
meson.build
··· 75 75 build_date = run_command('date', '+%Y-%m-%d', check: true).stdout().strip() 76 76 77 77 version_conf = configuration_data() 78 - version_conf.set('ANT_VERSION', '0.2.0.6') 78 + version_conf.set('ANT_VERSION', '0.2.0.7') 79 79 version_conf.set('ANT_GIT_HASH', git_hash) 80 80 version_conf.set('ANT_BUILD_DATE', build_date) 81 81
+97 -181
src/ant.c
··· 20 20 #include <sys/stat.h> 21 21 #include <utarray.h> 22 22 #include <uthash.h> 23 + #include <float.h> 23 24 24 25 #include "modules/fs.h" 25 26 #include "modules/timer.h" ··· 28 29 29 30 #define MINICORO_IMPL 30 31 #include "minicoro.h" 32 + 33 + _Static_assert(sizeof(double) == 8, "NaN-boxing requires 64-bit IEEE 754 doubles"); 34 + _Static_assert(sizeof(uint64_t) == 8, "NaN-boxing requires 64-bit integers"); 35 + _Static_assert(sizeof(double) == sizeof(uint64_t), "double and uint64_t must have same size"); 36 + 37 + #if defined(__STDC_IEC_559__) || defined(__GCC_IEC_559) 38 + /* IEEE 754 compliance guaranteed */ 39 + #elif defined(__FAST_MATH__) 40 + #error "NaN-boxing is incompatible with -ffast-math" 41 + #elif DBL_MANT_DIG != 53 || DBL_MAX_EXP != 1024 42 + #error "NaN-boxing requires IEEE 754 binary64 doubles" 43 + #endif 31 44 32 45 typedef uint32_t jsoff_t; 33 46 ··· 335 348 static jsoff_t propref_obj(jsval_t v) { return v & 0xffffffU; } 336 349 static jsoff_t propref_key(jsval_t v) { return (v >> 24U) & 0xffffffU; } 337 350 351 + static jsoff_t offtolen(jsoff_t off) { return (off >> 2) - 1; } 352 + static jsoff_t align32(jsoff_t v) { return ((v + 3) >> 2) << 2; } 353 + 354 + static void saveoff(struct js *js, jsoff_t off, jsoff_t val) { memcpy(&js->mem[off], &val, sizeof(val)); } 355 + static void saveval(struct js *js, jsoff_t off, jsval_t val) { memcpy(&js->mem[off], &val, sizeof(val)); } 356 + 338 357 static bool is_nan(jsval_t v) { 339 358 if ((v >> 52U) != 0x7feU) return false; 340 359 // real doubles in 0x7FE range have large mantissa values ··· 369 388 return mkval(T_PROPREF, (obj_off & 0xffffffU) | ((jsval_t)(key_off & 0xffffffU) << 24U)); 370 389 } 371 390 372 - static uint8_t unhex(uint8_t c) { return (c >= '0' && c <= '9') ? (uint8_t) (c - '0') : (c >= 'a' && c <= 'f') ? (uint8_t) (c - 'W') : (c >= 'A' && c <= 'F') ? (uint8_t) (c - '7') : 0; } 373 - static bool is_space(int c) { return c == ' ' || c == '\r' || c == '\n' || c == '\t' || c == '\f' || c == '\v' || c == 0xA0; } 374 - static bool is_digit(int c) { return c >= '0' && c <= '9'; } 375 - static bool is_xdigit(int c) { return is_digit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); } 376 - static bool is_alpha(int c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); } 377 - static bool is_ident_begin(int c) { return c == '_' || c == '$' || is_alpha(c) || (c & 0x80); } 378 - static bool is_ident_continue(int c) { return c == '_' || c == '$' || is_alpha(c) || is_digit(c) || (c & 0x80); } 379 - static bool is_err(jsval_t v) { return vtype(v) == T_ERR; } 380 - static bool is_unary(uint8_t tok) { return (tok >= TOK_POSTINC && tok <= TOK_UMINUS) || tok == TOK_NOT || tok == TOK_TILDA || tok == TOK_TYPEOF || tok == TOK_VOID; } 381 - static bool is_assign(uint8_t tok) { return (tok >= TOK_ASSIGN && tok <= TOK_OR_ASSIGN); } 382 - static bool is_keyword_propname(uint8_t tok) { return (tok >= TOK_ASYNC && tok <= TOK_GLOBAL_THIS) || tok == TOK_TYPEOF; } 391 + static bool is_err(jsval_t v) { 392 + return vtype(v) == T_ERR; 393 + } 394 + 395 + static uint8_t unhex(uint8_t c) { 396 + return (c >= '0' && c <= '9') ? (uint8_t) (c - '0') : (c >= 'a' && c <= 'f') ? (uint8_t) (c - 'W') : (c >= 'A' && c <= 'F') ? (uint8_t) (c - '7') : 0; 397 + } 398 + 399 + static bool is_space(int c) { 400 + return c == ' ' || c == '\r' || c == '\n' || c == '\t' || c == '\f' || c == '\v' || c == 0xA0; 401 + } 402 + 403 + static bool is_digit(int c) { 404 + return c >= '0' && c <= '9'; 405 + } 406 + 407 + static bool is_xdigit(int c) { 408 + return is_digit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); 409 + } 410 + 411 + static bool is_alpha(int c) { 412 + return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); 413 + } 414 + 415 + static bool is_ident_begin(int c) { 416 + return c == '_' || c == '$' || is_alpha(c) || (c & 0x80); 417 + } 418 + 419 + static bool is_ident_continue(int c) { 420 + return c == '_' || c == '$' || is_alpha(c) || is_digit(c) || (c & 0x80); 421 + } 422 + 423 + static bool is_unary(uint8_t tok) { 424 + return (tok >= TOK_POSTINC && tok <= TOK_UMINUS) || tok == TOK_NOT || tok == TOK_TILDA || tok == TOK_TYPEOF || tok == TOK_VOID; 425 + } 426 + 427 + static bool is_assign(uint8_t tok) { 428 + return (tok >= TOK_ASSIGN && tok <= TOK_OR_ASSIGN); 429 + } 430 + 431 + static bool is_keyword_propname(uint8_t tok) { 432 + return (tok >= TOK_ASYNC && tok <= TOK_GLOBAL_THIS) || tok == TOK_TYPEOF; 433 + } 383 434 384 435 static uint32_t js_to_uint32(double d) { 385 436 if (!isfinite(d) || d == 0) return 0; ··· 417 468 (js)->tok = (state).tok; \ 418 469 (js)->consumed = (state).consumed; \ 419 470 } while(0) 420 - static void saveoff(struct js *js, jsoff_t off, jsoff_t val) { memcpy(&js->mem[off], &val, sizeof(val)); } 421 - static void saveval(struct js *js, jsoff_t off, jsval_t val) { memcpy(&js->mem[off], &val, sizeof(val)); } 422 - static jsoff_t loadoff(struct js *js, jsoff_t off) { jsoff_t v = 0; assert(js->brk <= js->size); memcpy(&v, &js->mem[off], sizeof(v)); return v; } 423 - static bool is_arr_off(struct js *js, jsoff_t off) { return (loadoff(js, off) & ARRMASK) != 0; } 424 - static jsoff_t offtolen(jsoff_t off) { return (off >> 2) - 1; } 425 - static jsoff_t vstrlen(struct js *js, jsval_t v) { return offtolen(loadoff(js, (jsoff_t) vdata(v))); } 426 - static jsval_t loadval(struct js *js, jsoff_t off) { jsval_t v = 0; memcpy(&v, &js->mem[off], sizeof(v)); return v; } 427 - static jsval_t upper(struct js *js, jsval_t scope) { return mkval(T_OBJ, loadoff(js, (jsoff_t) (vdata(scope) + sizeof(jsoff_t)))); } 428 - static jsoff_t align32(jsoff_t v) { return ((v + 3) >> 2) << 2; } 471 + 472 + static jsoff_t loadoff(struct js *js, jsoff_t off) { 473 + jsoff_t v = 0; assert(js->brk <= js->size); memcpy(&v, &js->mem[off], sizeof(v)); 474 + return v; 475 + } 476 + 477 + static bool is_arr_off(struct js *js, jsoff_t off) { 478 + return (loadoff(js, off) & ARRMASK) != 0; 479 + } 480 + 481 + static jsoff_t vstrlen(struct js *js, jsval_t v) { 482 + return offtolen(loadoff(js, (jsoff_t) vdata(v))); 483 + } 484 + 485 + static jsval_t loadval(struct js *js, jsoff_t off) { 486 + jsval_t v = 0; memcpy(&v, &js->mem[off], sizeof(v)); 487 + return v; 488 + } 489 + 490 + static jsval_t upper(struct js *js, jsval_t scope) { 491 + return mkval(T_OBJ, loadoff(js, (jsoff_t) (vdata(scope) + sizeof(jsoff_t)))); 492 + } 429 493 430 494 #define CHECKV(_v) do { if (is_err(_v)) { res = (_v); goto done; } } while (0) 431 495 #define EXPECT(_tok, _e) do { if (next(js) != _tok) { _e; return js_mkerr_typed(js, JS_ERR_SYNTAX, "parse error"); }; js->consumed = 1; } while (0) 432 496 497 + static bool is_proxy(struct js *js, jsval_t obj); 433 498 static bool streq(const char *buf, size_t len, const char *p, size_t n); 434 499 static size_t tostr(struct js *js, jsval_t value, char *buf, size_t len); 435 500 static size_t strpromise(struct js *js, jsval_t value, char *buf, size_t len); 436 501 static size_t js_to_pcre2_pattern(const char *src, size_t src_len, char *dst, size_t dst_size); 437 - static jsval_t js_stmt_impl(struct js *js); 502 + 438 503 static bool continue_targets_innermost_loop(void); 439 504 static bool is_continue_target(const char *name, jsoff_t len); 440 505 static bool is_this_loop_continue_target(int depth_at_entry); 441 506 static void clear_continue_label(void); 442 507 static void clear_break_label(void); 443 508 509 + static jsval_t js_stmt_impl(struct js *js); 444 510 static inline jsoff_t esize(jsoff_t w); 511 + 512 + static bool parse_func_params(struct js *js, uint8_t *flags, int *out_count); 513 + static double js_to_number(struct js *js, jsval_t arg); 514 + 445 515 static jsval_t js_expr(struct js *js); 446 516 static jsval_t js_eval_slice(struct js *js, jsoff_t off, jsoff_t len); 447 517 static jsval_t js_eval_str(struct js *js, const char *code, jsoff_t len); ··· 452 522 static jsval_t js_do_while(struct js *js); 453 523 static jsval_t js_block_or_stmt(struct js *js); 454 524 static jsval_t js_var_decl(struct js *js); 455 - static bool parse_func_params(struct js *js, uint8_t *flags, int *out_count); 456 525 static jsval_t js_regex_literal(struct js *js); 457 526 static jsval_t js_try(struct js *js); 458 527 static jsval_t js_switch(struct js *js); 459 528 static jsval_t do_op(struct js *, uint8_t op, jsval_t l, jsval_t r); 460 - static double js_to_number(struct js *js, jsval_t arg); 461 529 static jsval_t do_instanceof(struct js *js, jsval_t l, jsval_t r); 462 530 static jsval_t do_in(struct js *js, jsval_t l, jsval_t r); 463 531 static jsval_t resolveprop(struct js *js, jsval_t v); 464 532 static jsoff_t free_list_allocate(size_t size); 465 533 static jsoff_t lkp(struct js *js, jsval_t obj, const char *buf, size_t len); 466 - static jsval_t builtin_array_push(struct js *js, jsval_t *args, int nargs); 467 - static jsval_t builtin_array_pop(struct js *js, jsval_t *args, int nargs); 468 - static jsval_t builtin_array_slice(struct js *js, jsval_t *args, int nargs); 469 - static jsval_t builtin_array_join(struct js *js, jsval_t *args, int nargs); 470 - static jsval_t builtin_array_includes(struct js *js, jsval_t *args, int nargs); 471 - static jsval_t builtin_array_every(struct js *js, jsval_t *args, int nargs); 472 - static jsval_t builtin_array_reverse(struct js *js, jsval_t *args, int nargs); 473 - static jsval_t builtin_array_map(struct js *js, jsval_t *args, int nargs); 474 - static jsval_t builtin_array_filter(struct js *js, jsval_t *args, int nargs); 475 - static jsval_t builtin_array_reduce(struct js *js, jsval_t *args, int nargs); 476 - static jsval_t builtin_array_flat(struct js *js, jsval_t *args, int nargs); 477 - static jsval_t builtin_array_concat(struct js *js, jsval_t *args, int nargs); 478 - static jsval_t builtin_array_at(struct js *js, jsval_t *args, int nargs); 479 - static jsval_t builtin_array_fill(struct js *js, jsval_t *args, int nargs); 480 - static jsval_t builtin_array_find(struct js *js, jsval_t *args, int nargs); 481 - static jsval_t builtin_array_findIndex(struct js *js, jsval_t *args, int nargs); 482 - static jsval_t builtin_array_findLast(struct js *js, jsval_t *args, int nargs); 483 - static jsval_t builtin_array_findLastIndex(struct js *js, jsval_t *args, int nargs); 484 - static jsval_t builtin_array_flatMap(struct js *js, jsval_t *args, int nargs); 485 - static jsval_t builtin_array_forEach(struct js *js, jsval_t *args, int nargs); 486 - static jsval_t builtin_array_indexOf(struct js *js, jsval_t *args, int nargs); 487 - static jsval_t builtin_array_lastIndexOf(struct js *js, jsval_t *args, int nargs); 488 - static jsval_t builtin_array_reduceRight(struct js *js, jsval_t *args, int nargs); 489 - static jsval_t builtin_array_shift(struct js *js, jsval_t *args, int nargs); 490 - static jsval_t builtin_array_unshift(struct js *js, jsval_t *args, int nargs); 491 - static jsval_t builtin_array_some(struct js *js, jsval_t *args, int nargs); 492 - static jsval_t builtin_array_sort(struct js *js, jsval_t *args, int nargs); 493 - static jsval_t builtin_array_splice(struct js *js, jsval_t *args, int nargs); 494 - static jsval_t builtin_array_copyWithin(struct js *js, jsval_t *args, int nargs); 495 - static jsval_t builtin_array_toReversed(struct js *js, jsval_t *args, int nargs); 496 - static jsval_t builtin_array_toSorted(struct js *js, jsval_t *args, int nargs); 497 - static jsval_t builtin_array_toSpliced(struct js *js, jsval_t *args, int nargs); 498 - static jsval_t builtin_array_with(struct js *js, jsval_t *args, int nargs); 499 - static jsval_t builtin_array_keys(struct js *js, jsval_t *args, int nargs); 500 - static jsval_t builtin_array_values(struct js *js, jsval_t *args, int nargs); 501 - static jsval_t builtin_array_entries(struct js *js, jsval_t *args, int nargs); 502 - static jsval_t builtin_array_toString(struct js *js, jsval_t *args, int nargs); 503 - static jsval_t builtin_Array_isArray(struct js *js, jsval_t *args, int nargs); 504 - static jsval_t builtin_Array_from(struct js *js, jsval_t *args, int nargs); 505 - static jsval_t builtin_Array_of(struct js *js, jsval_t *args, int nargs); 506 - static jsval_t builtin_Error(struct js *js, jsval_t *args, int nargs); 507 - static jsval_t builtin_EvalError(struct js *js, jsval_t *args, int nargs); 508 - static jsval_t builtin_RangeError(struct js *js, jsval_t *args, int nargs); 509 - static jsval_t builtin_ReferenceError(struct js *js, jsval_t *args, int nargs); 510 - static jsval_t builtin_SyntaxError(struct js *js, jsval_t *args, int nargs); 511 - static jsval_t builtin_TypeError(struct js *js, jsval_t *args, int nargs); 512 - static jsval_t builtin_URIError(struct js *js, jsval_t *args, int nargs); 513 - static jsval_t builtin_InternalError(struct js *js, jsval_t *args, int nargs); 534 + 514 535 static jsval_t js_import_stmt(struct js *js); 515 536 static jsval_t js_export_stmt(struct js *js); 516 - static jsval_t builtin_import(struct js *js, jsval_t *args, int nargs); 517 - static jsval_t builtin_import_meta_resolve(struct js *js, jsval_t *args, int nargs); 518 - static jsval_t builtin_string_indexOf(struct js *js, jsval_t *args, int nargs); 519 - static jsval_t builtin_string_substring(struct js *js, jsval_t *args, int nargs); 520 - static jsval_t builtin_string_split(struct js *js, jsval_t *args, int nargs); 521 - static jsval_t builtin_string_slice(struct js *js, jsval_t *args, int nargs); 522 - static jsval_t builtin_string_includes(struct js *js, jsval_t *args, int nargs); 523 - static jsval_t builtin_string_startsWith(struct js *js, jsval_t *args, int nargs); 524 - static jsval_t builtin_string_endsWith(struct js *js, jsval_t *args, int nargs); 525 - static jsval_t builtin_string_replace(struct js *js, jsval_t *args, int nargs); 526 - static jsval_t builtin_string_replaceAll(struct js *js, jsval_t *args, int nargs); 527 - static jsval_t builtin_string_match(struct js *js, jsval_t *args, int nargs); 528 - static jsval_t builtin_string_template(struct js *js, jsval_t *args, int nargs); 529 - static jsval_t builtin_string_charCodeAt(struct js *js, jsval_t *args, int nargs); 530 - static jsval_t builtin_string_toLowerCase(struct js *js, jsval_t *args, int nargs); 531 - static jsval_t builtin_string_toUpperCase(struct js *js, jsval_t *args, int nargs); 532 - static jsval_t builtin_string_trim(struct js *js, jsval_t *args, int nargs); 533 - static jsval_t builtin_string_trimStart(struct js *js, jsval_t *args, int nargs); 534 - static jsval_t builtin_string_trimEnd(struct js *js, jsval_t *args, int nargs); 535 - static jsval_t builtin_string_repeat(struct js *js, jsval_t *args, int nargs); 536 - static jsval_t builtin_string_padStart(struct js *js, jsval_t *args, int nargs); 537 - static jsval_t builtin_string_padEnd(struct js *js, jsval_t *args, int nargs); 538 - static jsval_t builtin_string_charAt(struct js *js, jsval_t *args, int nargs); 539 - static jsval_t builtin_string_at(struct js *js, jsval_t *args, int nargs); 540 - static jsval_t builtin_string_lastIndexOf(struct js *js, jsval_t *args, int nargs); 541 - static jsval_t builtin_string_concat(struct js *js, jsval_t *args, int nargs); 542 - static jsval_t builtin_string_fromCharCode(struct js *js, jsval_t *args, int nargs); 543 - static jsval_t builtin_number_toString(struct js *js, jsval_t *args, int nargs); 544 - static jsval_t builtin_number_toFixed(struct js *js, jsval_t *args, int nargs); 545 - static jsval_t builtin_number_toPrecision(struct js *js, jsval_t *args, int nargs); 546 - static jsval_t builtin_number_toExponential(struct js *js, jsval_t *args, int nargs); 547 - static jsval_t builtin_parseInt(struct js *js, jsval_t *args, int nargs); 548 - static jsval_t builtin_parseFloat(struct js *js, jsval_t *args, int nargs); 549 - static jsval_t builtin_btoa(struct js *js, jsval_t *args, int nargs); 550 - static jsval_t builtin_atob(struct js *js, jsval_t *args, int nargs); 537 + 551 538 static jsval_t builtin_Object(struct js *js, jsval_t *args, int nargs); 552 - static jsval_t builtin_RegExp(struct js *js, jsval_t *args, int nargs); 553 - static jsval_t builtin_regexp_test(struct js *js, jsval_t *args, int nargs); 554 - static jsval_t builtin_regexp_exec(struct js *js, jsval_t *args, int nargs); 555 - static jsval_t builtin_regexp_toString(struct js *js, jsval_t *args, int nargs); 556 - static jsval_t builtin_string_search(struct js *js, jsval_t *args, int nargs); 557 539 static jsval_t builtin_Promise(struct js *js, jsval_t *args, int nargs); 558 540 static jsval_t builtin_Promise_resolve(struct js *js, jsval_t *args, int nargs); 559 541 static jsval_t builtin_Promise_reject(struct js *js, jsval_t *args, int nargs); ··· 563 545 static jsval_t builtin_promise_then(struct js *js, jsval_t *args, int nargs); 564 546 static jsval_t builtin_promise_catch(struct js *js, jsval_t *args, int nargs); 565 547 static jsval_t builtin_promise_finally(struct js *js, jsval_t *args, int nargs); 566 - static jsval_t builtin_Date(struct js *js, jsval_t *args, int nargs); 567 - static jsval_t builtin_Date_now(struct js *js, jsval_t *args, int nargs); 568 - static jsval_t builtin_Map(struct js *js, jsval_t *args, int nargs); 569 - static jsval_t builtin_Set(struct js *js, jsval_t *args, int nargs); 570 - static jsval_t builtin_WeakMap(struct js *js, jsval_t *args, int nargs); 571 - static jsval_t builtin_WeakSet(struct js *js, jsval_t *args, int nargs); 572 - static jsval_t builtin_Proxy(struct js *js, jsval_t *args, int nargs); 573 - static jsval_t builtin_Proxy_revocable(struct js *js, jsval_t *args, int nargs); 574 - static bool is_proxy(struct js *js, jsval_t obj); 548 + 575 549 static jsval_t proxy_get(struct js *js, jsval_t proxy, const char *key, size_t key_len); 576 550 static jsval_t proxy_set(struct js *js, jsval_t proxy, const char *key, size_t key_len, jsval_t value); 577 551 static jsval_t proxy_has(struct js *js, jsval_t proxy, const char *key, size_t key_len); 578 552 static jsval_t proxy_delete(struct js *js, jsval_t proxy, const char *key, size_t key_len); 579 - static jsval_t map_set(struct js *js, jsval_t *args, int nargs); 580 - static jsval_t map_get(struct js *js, jsval_t *args, int nargs); 581 - static jsval_t map_has(struct js *js, jsval_t *args, int nargs); 582 - static jsval_t map_delete(struct js *js, jsval_t *args, int nargs); 583 - static jsval_t map_clear(struct js *js, jsval_t *args, int nargs); 584 - static jsval_t map_size(struct js *js, jsval_t *args, int nargs); 585 - static jsval_t map_entries(struct js *js, jsval_t *args, int nargs); 586 - static jsval_t map_keys(struct js *js, jsval_t *args, int nargs); 587 - static jsval_t map_values(struct js *js, jsval_t *args, int nargs); 588 - static jsval_t map_forEach(struct js *js, jsval_t *args, int nargs); 589 - static jsval_t set_add(struct js *js, jsval_t *args, int nargs); 590 - static jsval_t set_has(struct js *js, jsval_t *args, int nargs); 591 - static jsval_t set_delete(struct js *js, jsval_t *args, int nargs); 592 - static jsval_t set_clear(struct js *js, jsval_t *args, int nargs); 593 - static jsval_t set_size(struct js *js, jsval_t *args, int nargs); 594 - static jsval_t set_values(struct js *js, jsval_t *args, int nargs); 595 - static jsval_t set_forEach(struct js *js, jsval_t *args, int nargs); 596 - static jsval_t weakmap_set(struct js *js, jsval_t *args, int nargs); 597 - static jsval_t weakmap_get(struct js *js, jsval_t *args, int nargs); 598 - static jsval_t weakmap_has(struct js *js, jsval_t *args, int nargs); 599 - static jsval_t weakmap_delete(struct js *js, jsval_t *args, int nargs); 600 - static jsval_t weakset_add(struct js *js, jsval_t *args, int nargs); 601 - static jsval_t weakset_has(struct js *js, jsval_t *args, int nargs); 602 - static jsval_t weakset_delete(struct js *js, jsval_t *args, int nargs); 553 + 603 554 static jsval_t builtin_function_call(struct js *js, jsval_t *args, int nargs); 604 555 static jsval_t builtin_function_apply(struct js *js, jsval_t *args, int nargs); 605 556 static jsval_t builtin_function_bind(struct js *js, jsval_t *args, int nargs); 606 557 607 - static jsval_t builtin_Math_abs(struct js *js, jsval_t *args, int nargs); 608 - static jsval_t builtin_Math_acos(struct js *js, jsval_t *args, int nargs); 609 - static jsval_t builtin_Math_acosh(struct js *js, jsval_t *args, int nargs); 610 - static jsval_t builtin_Math_asin(struct js *js, jsval_t *args, int nargs); 611 - static jsval_t builtin_Math_asinh(struct js *js, jsval_t *args, int nargs); 612 - static jsval_t builtin_Math_atan(struct js *js, jsval_t *args, int nargs); 613 - static jsval_t builtin_Math_atanh(struct js *js, jsval_t *args, int nargs); 614 - static jsval_t builtin_Math_atan2(struct js *js, jsval_t *args, int nargs); 615 - static jsval_t builtin_Math_cbrt(struct js *js, jsval_t *args, int nargs); 616 - static jsval_t builtin_Math_ceil(struct js *js, jsval_t *args, int nargs); 617 - static jsval_t builtin_Math_clz32(struct js *js, jsval_t *args, int nargs); 618 - static jsval_t builtin_Math_cos(struct js *js, jsval_t *args, int nargs); 619 - static jsval_t builtin_Math_cosh(struct js *js, jsval_t *args, int nargs); 620 - static jsval_t builtin_Math_exp(struct js *js, jsval_t *args, int nargs); 621 - static jsval_t builtin_Math_expm1(struct js *js, jsval_t *args, int nargs); 622 - static jsval_t builtin_Math_floor(struct js *js, jsval_t *args, int nargs); 623 - static jsval_t builtin_Math_fround(struct js *js, jsval_t *args, int nargs); 624 - static jsval_t builtin_Math_hypot(struct js *js, jsval_t *args, int nargs); 625 - static jsval_t builtin_Math_imul(struct js *js, jsval_t *args, int nargs); 626 - static jsval_t builtin_Math_log(struct js *js, jsval_t *args, int nargs); 627 - static jsval_t builtin_Math_log1p(struct js *js, jsval_t *args, int nargs); 628 - static jsval_t builtin_Math_log10(struct js *js, jsval_t *args, int nargs); 629 - static jsval_t builtin_Math_log2(struct js *js, jsval_t *args, int nargs); 630 - static jsval_t builtin_Math_max(struct js *js, jsval_t *args, int nargs); 631 - static jsval_t builtin_Math_min(struct js *js, jsval_t *args, int nargs); 632 - static jsval_t builtin_Math_pow(struct js *js, jsval_t *args, int nargs); 633 - static jsval_t builtin_Math_random(struct js *js, jsval_t *args, int nargs); 634 - static jsval_t builtin_Math_round(struct js *js, jsval_t *args, int nargs); 635 - static jsval_t builtin_Math_sign(struct js *js, jsval_t *args, int nargs); 636 - static jsval_t builtin_Math_sin(struct js *js, jsval_t *args, int nargs); 637 - static jsval_t builtin_Math_sinh(struct js *js, jsval_t *args, int nargs); 638 - static jsval_t builtin_Math_sqrt(struct js *js, jsval_t *args, int nargs); 639 - static jsval_t builtin_Math_tan(struct js *js, jsval_t *args, int nargs); 640 - static jsval_t builtin_Math_tanh(struct js *js, jsval_t *args, int nargs); 641 - static jsval_t builtin_Math_trunc(struct js *js, jsval_t *args, int nargs); 642 - 643 558 static jsval_t call_js(struct js *js, const char *fn, jsoff_t fnlen, jsval_t closure_scope); 644 559 static jsval_t call_js_internal(struct js *js, const char *fn, jsoff_t fnlen, jsval_t closure_scope, jsval_t *bound_args, int bound_argc); 645 560 static jsval_t call_js_internal_nfe(struct js *js, const char *fn, jsoff_t fnlen, jsval_t closure_scope, jsval_t *bound_args, int bound_argc, jsval_t func_name, jsval_t func_val); 561 + 646 562 static jsval_t call_js_with_args(struct js *js, jsval_t func, jsval_t *args, int nargs); 647 563 static jsval_t call_js_code_with_args(struct js *js, const char *fn, jsoff_t fnlen, jsval_t closure_scope, jsval_t *args, int nargs); 648 564 static jsval_t call_js_code_with_args_nfe(struct js *js, const char *fn, jsoff_t fnlen, jsval_t closure_scope, jsval_t *args, int nargs, jsval_t func_name, jsval_t func_val); 649 - static jsval_t start_async_in_coroutine(struct js *js, const char *code, size_t code_len, jsval_t closure_scope, jsval_t *args, int nargs); 565 + 650 566 static inline bool push_this(jsval_t this_value); 651 567 static inline jsval_t pop_this(void); 652 568 static inline jsval_t peek_this(void);