mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Reduce header complexity
- Remove most __ASSEMBLER__ __LINKER__ ifdefs - Rename libc/intrin/bits.h to libc/serialize.h - Block pthread cancelation in fchmodat() polyfill - Remove `clang-format off` statements in third_party
This commit is contained in:
parent
96f979dfc5
commit
fa20edc44d
3057 changed files with 410 additions and 4398 deletions
1
third_party/quickjs/array.c
vendored
1
third_party/quickjs/array.c
vendored
|
@ -30,7 +30,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
/* Check if an object has a generalized numeric property. Return value:
|
||||
-1 for exception,
|
||||
|
|
1
third_party/quickjs/atof.c
vendored
1
third_party/quickjs/atof.c
vendored
|
@ -33,7 +33,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
/* XXX: remove */
|
||||
static double js_strtod(const char *p, int radix, BOOL is_float)
|
||||
|
|
1
third_party/quickjs/atom.c
vendored
1
third_party/quickjs/atom.c
vendored
|
@ -33,7 +33,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
/* Should only be used for debug. */
|
||||
const char *JS_AtomGetStrRT(JSRuntime *rt, char *buf, int buf_size, JSAtom atom)
|
||||
|
|
1
third_party/quickjs/atomics.c
vendored
1
third_party/quickjs/atomics.c
vendored
|
@ -30,7 +30,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
#ifdef CONFIG_ATOMICS
|
||||
|
||||
|
|
1
third_party/quickjs/bigdecimal.c
vendored
1
third_party/quickjs/bigdecimal.c
vendored
|
@ -31,7 +31,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
JSValue JS_NewBigDecimal(JSContext *ctx)
|
||||
{
|
||||
|
|
1
third_party/quickjs/bigint.c
vendored
1
third_party/quickjs/bigint.c
vendored
|
@ -31,7 +31,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
JSValue JS_NewBigInt(JSContext *ctx)
|
||||
{
|
||||
|
|
1
third_party/quickjs/byte.c
vendored
1
third_party/quickjs/byte.c
vendored
|
@ -35,7 +35,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
BOOL js_class_has_bytecode(JSClassID class_id)
|
||||
{
|
||||
|
|
1
third_party/quickjs/call.c
vendored
1
third_party/quickjs/call.c
vendored
|
@ -33,7 +33,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
static const uint16_t func_kind_to_class_id[] = {
|
||||
[JS_FUNC_NORMAL] = JS_CLASS_BYTECODE_FUNCTION,
|
||||
|
|
1
third_party/quickjs/cutils.c
vendored
1
third_party/quickjs/cutils.c
vendored
|
@ -32,7 +32,6 @@ Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
|||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
void pstrcpy(char *buf, int buf_size, const char *str)
|
||||
{
|
||||
|
|
3
third_party/quickjs/cutils.h
vendored
3
third_party/quickjs/cutils.h
vendored
|
@ -1,9 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_QUICKJS_CUTILS_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_QUICKJS_CUTILS_H_
|
||||
#include "libc/intrin/bswap.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
/* clang-format off */
|
||||
|
||||
/* set if CPU is big endian */
|
||||
#undef WORDS_BIGENDIAN
|
||||
|
@ -258,5 +256,4 @@ void rqsort(void *base, size_t nmemb, size_t size,
|
|||
|
||||
/* clang-format on */
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_QUICKJS_CUTILS_H_ */
|
||||
|
|
1
third_party/quickjs/date.c
vendored
1
third_party/quickjs/date.c
vendored
|
@ -35,7 +35,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
#if 0
|
||||
/* OS dependent: return the UTC time in ms since 1970. */
|
||||
|
|
1
third_party/quickjs/dbuf.c
vendored
1
third_party/quickjs/dbuf.c
vendored
|
@ -33,7 +33,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
static void *dbuf_default_realloc(void *opaque, void *ptr, size_t size)
|
||||
{
|
||||
|
|
2
third_party/quickjs/diglet.h
vendored
2
third_party/quickjs/diglet.h
vendored
|
@ -1,10 +1,8 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_QUICKJS_DIGLET_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_QUICKJS_DIGLET_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int to_digit(int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_QUICKJS_DIGLET_H_ */
|
||||
|
|
1
third_party/quickjs/eq.c
vendored
1
third_party/quickjs/eq.c
vendored
|
@ -31,7 +31,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
/* XXX: Should take JSValueConst arguments */
|
||||
BOOL js_strict_eq2(JSContext *ctx, JSValue op1, JSValue op2,
|
||||
|
|
1
third_party/quickjs/err.c
vendored
1
third_party/quickjs/err.c
vendored
|
@ -32,7 +32,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
int js_parse_error(JSParseState *s, const char *fmt, ...)
|
||||
{
|
||||
|
|
1
third_party/quickjs/float.c
vendored
1
third_party/quickjs/float.c
vendored
|
@ -30,7 +30,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
JSValue JS_NewBigFloat(JSContext *ctx)
|
||||
{
|
||||
|
|
1
third_party/quickjs/gc.c
vendored
1
third_party/quickjs/gc.c
vendored
|
@ -31,7 +31,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
void js_trigger_gc(JSRuntime *rt, size_t size)
|
||||
{
|
||||
|
|
1
third_party/quickjs/gen.c
vendored
1
third_party/quickjs/gen.c
vendored
|
@ -31,7 +31,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
typedef enum JSGeneratorStateEnum {
|
||||
JS_GENERATOR_STATE_SUSPENDED_START,
|
||||
|
|
3
third_party/quickjs/internal.h
vendored
3
third_party/quickjs/internal.h
vendored
|
@ -4,9 +4,7 @@
|
|||
#include "third_party/quickjs/libbf.h"
|
||||
#include "third_party/quickjs/list.h"
|
||||
#include "third_party/quickjs/quickjs.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
/* clang-format off */
|
||||
|
||||
#define OPTIMIZE 1
|
||||
#define SHORT_OPCODES 1
|
||||
|
@ -2210,5 +2208,4 @@ static inline void js_async_function_free(JSRuntime *rt, JSAsyncFunctionData *s)
|
|||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_QUICKJS_INTERNAL_H_ */
|
||||
|
|
1
third_party/quickjs/iter.c
vendored
1
third_party/quickjs/iter.c
vendored
|
@ -29,7 +29,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
JSValue js_iterator_proto_iterator(JSContext *ctx, JSValueConst this_val,
|
||||
int argc, JSValueConst *argv) {
|
||||
|
|
1
third_party/quickjs/json.c
vendored
1
third_party/quickjs/json.c
vendored
|
@ -33,7 +33,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
/* 'c' is the first character. Return JS_ATOM_NULL in case of error */
|
||||
static JSAtom json_parse_ident(JSParseState *s, const uint8_t **pp, int c)
|
||||
|
|
1
third_party/quickjs/leb128.c
vendored
1
third_party/quickjs/leb128.c
vendored
|
@ -30,7 +30,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
int get_leb128(uint32_t *pval, const uint8_t *buf, const uint8_t *buf_end)
|
||||
{
|
||||
|
|
2
third_party/quickjs/leb128.h
vendored
2
third_party/quickjs/leb128.h
vendored
|
@ -1,11 +1,9 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_QUICKJS_LEB128_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_QUICKJS_LEB128_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int get_leb128(uint32_t *, const uint8_t *, const uint8_t *);
|
||||
int get_sleb128(int32_t *, const uint8_t *, const uint8_t *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_QUICKJS_LEB128_H_ */
|
||||
|
|
1
third_party/quickjs/libbf.c
vendored
1
third_party/quickjs/libbf.c
vendored
|
@ -43,7 +43,6 @@ asm(".include \"libc/disclaimer.inc\"");
|
|||
/* #undef __AVX2__ */
|
||||
/* #endif */
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
/* enable it to check the multiplication result */
|
||||
//#define USE_MUL_CHECK
|
||||
|
|
3
third_party/quickjs/libbf.h
vendored
3
third_party/quickjs/libbf.h
vendored
|
@ -2,9 +2,7 @@
|
|||
#define COSMOPOLITAN_THIRD_PARTY_QUICKJS_LIBBF_H_
|
||||
#include "libc/limits.h"
|
||||
#include "libc/literal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
/* clang-format off */
|
||||
|
||||
#if INTPTR_MAX >= INT64_MAX
|
||||
#define LIMB_LOG2_BITS 6
|
||||
|
@ -513,5 +511,4 @@ int bfdec_normalize_and_round(bfdec_t *r, limb_t prec1, bf_flags_t flags);
|
|||
|
||||
/* clang-format on */
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_QUICKJS_LIBBF_H_ */
|
||||
|
|
1
third_party/quickjs/libregexp-opcode.inc
vendored
1
third_party/quickjs/libregexp-opcode.inc
vendored
|
@ -22,7 +22,6 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
#ifdef DEF
|
||||
|
||||
|
|
1
third_party/quickjs/libregexp.c
vendored
1
third_party/quickjs/libregexp.c
vendored
|
@ -37,7 +37,6 @@ Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
|||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
/*
|
||||
TODO:
|
||||
|
|
3
third_party/quickjs/libregexp.h
vendored
3
third_party/quickjs/libregexp.h
vendored
|
@ -1,9 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_QUICKJS_LIBREGEXP_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_QUICKJS_LIBREGEXP_H_
|
||||
#include "third_party/quickjs/libunicode.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
/* clang-format off */
|
||||
|
||||
#define LRE_BOOL int /* for documentation purposes */
|
||||
|
||||
|
@ -68,5 +66,4 @@ static inline int lre_js_is_ident_next(int c)
|
|||
|
||||
/* clang-format on */
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_QUICKJS_LIBREGEXP_H_ */
|
||||
|
|
1
third_party/quickjs/libunicode-table.inc
vendored
1
third_party/quickjs/libunicode-table.inc
vendored
|
@ -1,4 +1,3 @@
|
|||
/* clang-format off */
|
||||
/* Compressed unicode tables */
|
||||
/* Automatically generated file - do not edit */
|
||||
|
||||
|
|
1
third_party/quickjs/libunicode.c
vendored
1
third_party/quickjs/libunicode.c
vendored
|
@ -36,7 +36,6 @@ Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
|||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
#include "third_party/quickjs/libunicode-table.inc"
|
||||
|
||||
|
|
3
third_party/quickjs/libunicode.h
vendored
3
third_party/quickjs/libunicode.h
vendored
|
@ -1,9 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_QUICKJS_LIBUNICODE_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_QUICKJS_LIBUNICODE_H_
|
||||
#include "third_party/quickjs/libunicode.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
/* clang-format off */
|
||||
|
||||
#define LRE_BOOL int /* for documentation purposes */
|
||||
|
||||
|
@ -102,5 +100,4 @@ int unicode_prop(CharRange *cr, const char *prop_name);
|
|||
|
||||
/* clang-format on */
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_QUICKJS_LIBUNICODE_H_ */
|
||||
|
|
3
third_party/quickjs/list.h
vendored
3
third_party/quickjs/list.h
vendored
|
@ -1,8 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_QUICKJS_LIST_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_QUICKJS_LIST_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
/* clang-format off */
|
||||
|
||||
struct list_head {
|
||||
struct list_head *prev;
|
||||
|
@ -75,5 +73,4 @@ static inline int list_empty(struct list_head *el)
|
|||
|
||||
/* clang-format on */
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_QUICKJS_LIST_H_ */
|
||||
|
|
1
third_party/quickjs/map.c
vendored
1
third_party/quickjs/map.c
vendored
|
@ -30,7 +30,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
static JSValue js_map_constructor(JSContext *ctx, JSValueConst new_target,
|
||||
int argc, JSValueConst *argv, int magic)
|
||||
|
|
1
third_party/quickjs/math.c
vendored
1
third_party/quickjs/math.c
vendored
|
@ -31,7 +31,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
/* precondition: a and b are not NaN */
|
||||
static double js_fmin(double a, double b)
|
||||
|
|
1
third_party/quickjs/mem.c
vendored
1
third_party/quickjs/mem.c
vendored
|
@ -31,7 +31,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
JSValue JS_ThrowTypeErrorRevokedProxy(JSContext *ctx)
|
||||
{
|
||||
|
|
1
third_party/quickjs/object.c
vendored
1
third_party/quickjs/object.c
vendored
|
@ -29,7 +29,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
void js_object_data_finalizer(JSRuntime *rt, JSValue val)
|
||||
{
|
||||
|
|
1
third_party/quickjs/parse.c
vendored
1
third_party/quickjs/parse.c
vendored
|
@ -33,7 +33,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
static __exception int js_parse_assign_expr(JSParseState *);
|
||||
static __exception int js_parse_assign_expr2(JSParseState *, int);
|
||||
|
|
1
third_party/quickjs/prim.c
vendored
1
third_party/quickjs/prim.c
vendored
|
@ -29,7 +29,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
JSValue JS_ToPrimitiveFree(JSContext *ctx, JSValue val, int hint)
|
||||
{
|
||||
|
|
1
third_party/quickjs/promise.c
vendored
1
third_party/quickjs/promise.c
vendored
|
@ -30,7 +30,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
typedef enum JSPromiseStateEnum {
|
||||
JS_PROMISE_PENDING,
|
||||
|
|
1
third_party/quickjs/proxy.c
vendored
1
third_party/quickjs/proxy.c
vendored
|
@ -30,7 +30,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
static void js_proxy_finalizer(JSRuntime *rt, JSValue val)
|
||||
{
|
||||
|
|
1
third_party/quickjs/qjs.c
vendored
1
third_party/quickjs/qjs.c
vendored
|
@ -45,7 +45,6 @@ Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
|||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
extern const uint8_t qjsc_repl[];
|
||||
extern const uint32_t qjsc_repl_size;
|
||||
|
|
1
third_party/quickjs/qjsc.c
vendored
1
third_party/quickjs/qjsc.c
vendored
|
@ -42,7 +42,6 @@ Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
|||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
|
|
1
third_party/quickjs/quickjs-libc.c
vendored
1
third_party/quickjs/quickjs-libc.c
vendored
|
@ -60,7 +60,6 @@ asm(".include \"libc/disclaimer.inc\"");
|
|||
|
||||
#define MAXPATH 1024
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
/* TODO:
|
||||
- add socket calls
|
||||
|
|
3
third_party/quickjs/quickjs-libc.h
vendored
3
third_party/quickjs/quickjs-libc.h
vendored
|
@ -1,9 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_QUICKJS_LIBC_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_QUICKJS_LIBC_H_
|
||||
#include "third_party/quickjs/quickjs.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
/* clang-format off */
|
||||
|
||||
JSModuleDef *js_init_module_std(JSContext *ctx, const char *module_name);
|
||||
JSModuleDef *js_init_module_os(JSContext *ctx, const char *module_name);
|
||||
|
@ -26,5 +24,4 @@ void js_std_set_worker_new_context_func(JSContext *(*func)(JSRuntime *rt));
|
|||
|
||||
/* clang-format on */
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_QUICKJS_LIBC_H_ */
|
||||
|
|
1
third_party/quickjs/quickjs-opcode.inc
vendored
1
third_party/quickjs/quickjs-opcode.inc
vendored
|
@ -23,7 +23,6 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
#ifdef FMT
|
||||
FMT(none)
|
||||
|
|
1
third_party/quickjs/quickjs.c
vendored
1
third_party/quickjs/quickjs.c
vendored
|
@ -54,7 +54,6 @@ Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
|||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
static const char js_atom_init[] =
|
||||
#define DEF(name, str) str "\0"
|
||||
|
|
3
third_party/quickjs/quickjs.h
vendored
3
third_party/quickjs/quickjs.h
vendored
|
@ -3,9 +3,7 @@
|
|||
#include "libc/intrin/likely.h"
|
||||
#include "libc/math.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
/* clang-format off */
|
||||
|
||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__STRICT_ANSI__)
|
||||
#define __js_printf_like(f, a) __attribute__((__format__(__printf__, f, a)))
|
||||
|
@ -1010,5 +1008,4 @@ int JS_SetModuleExportList(JSContext *ctx, JSModuleDef *m,
|
|||
|
||||
/* clang-format on */
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_QUICKJS_QUICKJS_H_ */
|
||||
|
|
1
third_party/quickjs/reflect.c
vendored
1
third_party/quickjs/reflect.c
vendored
|
@ -29,7 +29,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
static JSValue js_reflect_apply(JSContext *ctx, JSValueConst this_val,
|
||||
int argc, JSValueConst *argv)
|
||||
|
|
1
third_party/quickjs/regexp.c
vendored
1
third_party/quickjs/regexp.c
vendored
|
@ -32,7 +32,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
void js_regexp_finalizer(JSRuntime *rt, JSValue val)
|
||||
{
|
||||
|
|
1
third_party/quickjs/run-test262.c
vendored
1
third_party/quickjs/run-test262.c
vendored
|
@ -43,7 +43,6 @@ Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
|||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
/* enable test262 thread support to test SharedArrayBuffer and Atomics */
|
||||
/* #define CONFIG_AGENT */
|
||||
|
|
1
third_party/quickjs/shape.c
vendored
1
third_party/quickjs/shape.c
vendored
|
@ -31,7 +31,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
int init_shape_hash(JSRuntime *rt)
|
||||
{
|
||||
|
|
1
third_party/quickjs/str.c
vendored
1
third_party/quickjs/str.c
vendored
|
@ -36,7 +36,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
static int memcmp16_8(const uint16_t *src1, const uint8_t *src2, int len)
|
||||
{
|
||||
|
|
1
third_party/quickjs/strbuf.c
vendored
1
third_party/quickjs/strbuf.c
vendored
|
@ -32,7 +32,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
/* It is valid to call string_buffer_end() and all string_buffer functions even
|
||||
if string_buffer_init() or another string_buffer function returns an error.
|
||||
|
|
1
third_party/quickjs/tok.c
vendored
1
third_party/quickjs/tok.c
vendored
|
@ -31,7 +31,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
/* 'c' is the first character. Return JS_ATOM_NULL in case of error */
|
||||
static JSAtom parse_ident(JSParseState *s, const uint8_t **pp,
|
||||
|
|
1
third_party/quickjs/typedarray.c
vendored
1
third_party/quickjs/typedarray.c
vendored
|
@ -31,7 +31,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
static JSObject *get_typed_array(JSContext *ctx,
|
||||
JSValueConst this_val,
|
||||
|
|
1
third_party/quickjs/unicode_gen.c
vendored
1
third_party/quickjs/unicode_gen.c
vendored
|
@ -38,7 +38,6 @@ Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
|||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
/* define it to be able to test unicode.c */
|
||||
//#define USE_TEST
|
||||
|
|
1
third_party/quickjs/uri.c
vendored
1
third_party/quickjs/uri.c
vendored
|
@ -30,7 +30,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
static int string_get_hex(JSString *p, int k, int n) {
|
||||
int c = 0, h;
|
||||
|
|
1
third_party/quickjs/usage.c
vendored
1
third_party/quickjs/usage.c
vendored
|
@ -31,7 +31,6 @@ QuickJS (MIT License)\\n\
|
|||
Copyright (c) 2017-2021 Fabrice Bellard\\n\
|
||||
Copyright (c) 2017-2021 Charlie Gordon\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
/* Compute memory used by various object types */
|
||||
/* XXX: poor man's approach to handling multiply referenced objects */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue