@@ -1378,8 +1378,6 @@ static JSValue js_int64(int64_t v)
1378
1378
return js_float64(v);
1379
1379
}
1380
1380
1381
- #define JS_NewInt64(ctx, val) js_int64(val)
1382
-
1383
1381
static JSValue js_number(double d)
1384
1382
{
1385
1383
if (double_is_int32(d))
@@ -13815,7 +13813,7 @@ static no_inline __exception int js_unary_arith_slow(JSContext *ctx,
13815
13813
default:
13816
13814
abort();
13817
13815
}
13818
- sp[-1] = JS_NewInt64(ctx, v64);
13816
+ sp[-1] = js_int64( v64);
13819
13817
}
13820
13818
break;
13821
13819
case JS_TAG_SHORT_BIG_INT:
@@ -13951,7 +13949,7 @@ static no_inline int js_not_slow(JSContext *ctx, JSValue *sp)
13951
13949
int32_t v1;
13952
13950
if (unlikely(JS_ToInt32Free(ctx, &v1, op1)))
13953
13951
goto exception;
13954
- sp[-1] = JS_NewInt32(ctx, ~v1);
13952
+ sp[-1] = js_int32( ~v1);
13955
13953
}
13956
13954
return 0;
13957
13955
exception:
@@ -14224,7 +14222,7 @@ static no_inline __exception int js_add_slow(JSContext *ctx, JSValue *sp)
14224
14222
v1 = JS_VALUE_GET_INT(op1);
14225
14223
v2 = JS_VALUE_GET_INT(op2);
14226
14224
v = (int64_t)v1 + (int64_t)v2;
14227
- sp[-2] = JS_NewInt64(ctx, v);
14225
+ sp[-2] = js_int64( v);
14228
14226
} else if ((tag1 == JS_TAG_BIG_INT || tag1 == JS_TAG_SHORT_BIG_INT) &&
14229
14227
(tag2 == JS_TAG_BIG_INT || tag2 == JS_TAG_SHORT_BIG_INT)) {
14230
14228
JSBigInt *p1, *p2, *r;
@@ -15019,7 +15017,7 @@ static __exception int js_operator_private_in(JSContext *ctx, JSValue *sp)
15019
15017
}
15020
15018
JS_FreeValue(ctx, op1);
15021
15019
JS_FreeValue(ctx, op2);
15022
- sp[-2] = JS_NewBool(ctx, ret);
15020
+ sp[-2] = js_bool( ret);
15023
15021
return 0;
15024
15022
}
15025
15023
@@ -42625,7 +42623,7 @@ static JSValue js_number_constructor(JSContext *ctx, JSValueConst new_target,
42625
42623
return val;
42626
42624
switch(JS_VALUE_GET_TAG(val)) {
42627
42625
case JS_TAG_SHORT_BIG_INT:
42628
- val = JS_NewInt64(ctx, JS_VALUE_GET_SHORT_BIG_INT(val));
42626
+ val = js_int64( JS_VALUE_GET_SHORT_BIG_INT(val));
42629
42627
if (JS_IsException(val))
42630
42628
return val;
42631
42629
break;
@@ -42635,7 +42633,7 @@ static JSValue js_number_constructor(JSContext *ctx, JSValueConst new_target,
42635
42633
double d;
42636
42634
d = js_bigint_to_float64(ctx, p);
42637
42635
JS_FreeValue(ctx, val);
42638
- val = JS_NewFloat64(ctx, d);
42636
+ val = js_float64( d);
42639
42637
}
42640
42638
break;
42641
42639
default:
@@ -52856,7 +52854,7 @@ static JSValue js_Date_parse(JSContext *ctx, JSValueConst this_val,
52856
52854
for(i = 0; i < 7; i++)
52857
52855
fields1[i] = fields[i];
52858
52856
d = set_date_fields(fields1, is_local) - fields[8] * 60000;
52859
- rv = JS_NewFloat64(ctx, d);
52857
+ rv = js_float64( d);
52860
52858
}
52861
52859
}
52862
52860
JS_FreeValue(ctx, s);
@@ -57724,7 +57722,7 @@ static JSValue js_callsite_isnative(JSContext *ctx, JSValueConst this_val, int a
57724
57722
JSCallSiteData *csd = JS_GetOpaque2(ctx, this_val, JS_CLASS_CALL_SITE);
57725
57723
if (!csd)
57726
57724
return JS_EXCEPTION;
57727
- return JS_NewBool(ctx, csd->native);
57725
+ return js_bool( csd->native);
57728
57726
}
57729
57727
57730
57728
static JSValue js_callsite_getnumber(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
@@ -57733,7 +57731,7 @@ static JSValue js_callsite_getnumber(JSContext *ctx, JSValueConst this_val, int
57733
57731
if (!csd)
57734
57732
return JS_EXCEPTION;
57735
57733
int *field = (void *)((char *)csd + magic);
57736
- return JS_NewInt32(ctx, *field);
57734
+ return js_int32( *field);
57737
57735
}
57738
57736
57739
57737
static const JSCFunctionListEntry js_callsite_proto_funcs[] = {
0 commit comments