Merge branch 'master' into fix_aot
This commit is contained in:
@@ -264,18 +264,9 @@ enum {
|
||||
JS_CLASS_INIT_COUNT, /* last entry for predefined classes */
|
||||
};
|
||||
|
||||
typedef enum JSErrorEnum {
|
||||
JS_EVAL_ERROR,
|
||||
JS_RANGE_ERROR,
|
||||
JS_REFERENCE_ERROR,
|
||||
JS_SYNTAX_ERROR,
|
||||
JS_TYPE_ERROR,
|
||||
JS_URI_ERROR,
|
||||
JS_INTERNAL_ERROR,
|
||||
JS_AGGREGATE_ERROR,
|
||||
|
||||
JS_NATIVE_ERROR_COUNT, /* number of different error name strings */
|
||||
} JSErrorEnum;
|
||||
/* Log callback — set by engine.cm via $_set_log to route JS_Log through ƿit.
|
||||
For "memory" channel (OOM), the callback is skipped (can't allocate). */
|
||||
typedef void (*JSLogCallback)(JSContext *ctx, const char *channel, const char *msg);
|
||||
|
||||
/* the variable and scope indexes must fit on 16 bits. The (-1) and
|
||||
ARG_SCOPE_END values are reserved. */
|
||||
@@ -313,8 +304,8 @@ void heap_check_fail(void *ptr, struct JSContext *ctx);
|
||||
/* Compatibility: JS_TAG_STRING is an alias for text type checks */
|
||||
#define JS_TAG_STRING JS_TAG_STRING_IMM
|
||||
|
||||
/* JS_ThrowMemoryError is an alias for JS_ThrowOutOfMemory */
|
||||
#define JS_ThrowMemoryError(ctx) JS_ThrowOutOfMemory(ctx)
|
||||
/* JS_ThrowMemoryError is an alias for JS_RaiseOOM */
|
||||
#define JS_ThrowMemoryError(ctx) JS_RaiseOOM(ctx)
|
||||
|
||||
/* Helper to set cap in objhdr */
|
||||
static inline objhdr_t objhdr_set_cap56 (objhdr_t h, uint64_t cap) {
|
||||
@@ -1146,6 +1137,10 @@ struct JSContext {
|
||||
|
||||
JS_BOOL disruption_reported;
|
||||
|
||||
/* Log routing — set by $_set_log intrinsic */
|
||||
JSLogCallback log_callback;
|
||||
JSValue log_callback_js; /* the ƿit log function (rooted) */
|
||||
|
||||
/* Actor identity key — used by wota/nota PRIVATE serialization */
|
||||
JSValue actor_sym;
|
||||
|
||||
@@ -1373,7 +1368,7 @@ JSValue JS_CallRegisterVM(JSContext *ctx, JSCodeRegister *code, JSValue this_obj
|
||||
JSValue cell_native_dispatch(JSContext *ctx, JSValue func_obj, JSValue this_obj, int argc, JSValue *argv);
|
||||
int JS_DeleteProperty (JSContext *ctx, JSValue obj, JSValue prop);
|
||||
JSValue __attribute__ ((format (printf, 2, 3)))
|
||||
JS_ThrowInternalError (JSContext *ctx, const char *fmt, ...);
|
||||
JS_RaiseDisrupt (JSContext *ctx, const char *fmt, ...);
|
||||
__maybe_unused void JS_DumpString (JSRuntime *rt, const JSText *text);
|
||||
__maybe_unused void JS_DumpObjectHeader (JSRuntime *rt);
|
||||
__maybe_unused void JS_DumpObject (JSRuntime *rt, JSRecord *rec);
|
||||
@@ -1436,7 +1431,7 @@ static JSValue js_cell_object (JSContext *ctx, JSValue this_val, int argc, JSVal
|
||||
static JSValue js_cell_text_format (JSContext *ctx, JSValue this_val, int argc, JSValue *argv);
|
||||
static JSValue js_print (JSContext *ctx, JSValue this_val, int argc, JSValue *argv);
|
||||
JSValue JS_GetStack(JSContext *ctx);
|
||||
JSValue JS_ThrowOutOfMemory (JSContext *ctx);
|
||||
JSValue JS_RaiseOOM (JSContext *ctx);
|
||||
|
||||
|
||||
JSValue JS_ToNumber (JSContext *ctx, JSValue val);
|
||||
@@ -1544,16 +1539,11 @@ static inline void set_value (JSContext *ctx, JSValue *pval, JSValue new_val) {
|
||||
*pval = new_val;
|
||||
}
|
||||
|
||||
void JS_ThrowInterrupted (JSContext *ctx);
|
||||
int cell_rt_native_active(void);
|
||||
|
||||
static inline __exception int js_poll_interrupts (JSContext *ctx) {
|
||||
if (unlikely (atomic_load_explicit (&ctx->pause_flag, memory_order_relaxed) >= 2)) {
|
||||
if (cell_rt_native_active ()) {
|
||||
atomic_store_explicit (&ctx->pause_flag, 0, memory_order_relaxed);
|
||||
return 0;
|
||||
}
|
||||
JS_ThrowInterrupted (ctx);
|
||||
JS_RaiseDisrupt (ctx, "interrupted");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@@ -1608,8 +1598,6 @@ uint64_t get_text_hash (JSText *text);
|
||||
void pack_utf32_to_words (const uint32_t *utf32, uint32_t len, uint64_t *packed);
|
||||
int text_equal (JSText *a, const uint64_t *packed_b, uint32_t len_b);
|
||||
|
||||
void print_backtrace (JSContext *ctx, JSValue stack, const char *filename, int line_num, int col_num);
|
||||
JSValue JS_ThrowError2 (JSContext *ctx, JSErrorEnum error_num, const char *fmt, va_list ap, BOOL add_backtrace);
|
||||
JSValue gc_copy_value (JSContext *ctx, JSValue v, uint8_t *from_base, uint8_t *from_end, uint8_t *to_base, uint8_t **to_free, uint8_t *to_end);
|
||||
PPretext *ppretext_init (int capacity);
|
||||
PPretext *ppretext_putc (PPretext *p, uint32_t c);
|
||||
|
||||
Reference in New Issue
Block a user