Skip to content

Commit

Permalink
Bug 1527860 - Remove ENABLE_BIGINT #ifdef r=jandem,froydnj
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D19766

--HG--
extra : moz-landing-system : lando
  • Loading branch information
wingo committed Feb 14, 2019
1 parent 7e50e9d commit 7d559ef
Show file tree
Hide file tree
Showing 125 changed files with 142 additions and 866 deletions.
2 changes: 0 additions & 2 deletions dom/bindings/BindingUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -967,15 +967,13 @@ MOZ_ALWAYS_INLINE bool MaybeWrapValue(JSContext* cx,
if (rval.isObject()) {
return MaybeWrapObjectValue(cx, rval);
}
#ifdef ENABLE_BIGINT
// This could be optimized by checking the zone first, similar to
// the way strings are handled. At present, this is used primarily
// for structured cloning, so avoiding the overhead of JS_WrapValue
// calls is less important than for other types.
if (rval.isBigInt()) {
return JS_WrapValue(cx, rval);
}
#endif
MOZ_ASSERT(rval.isSymbol());
JS_MarkCrossZoneId(cx, SYMBOL_TO_JSID(rval.toSymbol()));
}
Expand Down
13 changes: 0 additions & 13 deletions js/moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,6 @@ def disable_export_js(value):
die('Setting %s is deprecated, use %s instead.',
value.format('DISABLE_EXPORT_JS'), suggestion)

# Experimental BigInt support
# =======================================================
js_option('--disable-bigint',
help='{Enable|Disable} BigInt')

@depends('--disable-bigint')
def enable_bigint(value):
if value:
return True

set_config('ENABLE_BIGINT', enable_bigint)
set_define('ENABLE_BIGINT', enable_bigint)

# JIT support
# =======================================================
@depends(target)
Expand Down
2 changes: 0 additions & 2 deletions js/public/Class.h
Original file line number Diff line number Diff line change
Expand Up @@ -1038,9 +1038,7 @@ enum class ESClass {
SetIterator,
Arguments,
Error,
#ifdef ENABLE_BIGINT
BigInt,
#endif

/** None of the above. */
Other
Expand Down
2 changes: 0 additions & 2 deletions js/public/CompileOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ class JS_PUBLIC_API TransitiveCompileOptions {
bool allowHTMLComments = true;
bool isProbablySystemCode = false;
bool hideScriptFromDebugger = false;
#ifdef ENABLE_BIGINT
bool bigIntEnabledOption = false;
#endif

/**
* |introductionType| is a statically allocated C string: one of "eval",
Expand Down
2 changes: 1 addition & 1 deletion js/public/GCPolicyAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
// Expand the given macro D for each public GC pointer.
#define FOR_EACH_PUBLIC_GC_POINTER_TYPE(D) \
D(JS::Symbol*) \
IF_BIGINT(D(JS::BigInt*), ) \
D(JS::BigInt*) \
D(JSAtom*) \
D(JSFunction*) \
D(JSObject*) \
Expand Down
8 changes: 3 additions & 5 deletions js/public/MemoryMetrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ struct UnusedGCThingSizes {
MACRO(Other, GCHeapUnused, objectGroup) \
MACRO(Other, GCHeapUnused, string) \
MACRO(Other, GCHeapUnused, symbol) \
IF_BIGINT(MACRO(Other, GCHeapUnused, bigInt), ) \
MACRO(Other, GCHeapUnused, bigInt) \
MACRO(Other, GCHeapUnused, jitcode) \
MACRO(Other, GCHeapUnused, scope) \
MACRO(Other, GCHeapUnused, regExpShared)
Expand All @@ -590,11 +590,9 @@ struct UnusedGCThingSizes {
case JS::TraceKind::Symbol:
symbol += n;
break;
#ifdef ENABLE_BIGINT
case JS::TraceKind::BigInt:
bigInt += n;
break;
#endif
case JS::TraceKind::Script:
script += n;
break;
Expand Down Expand Up @@ -648,8 +646,8 @@ struct UnusedGCThingSizes {
struct ZoneStats {
#define FOR_EACH_SIZE(MACRO) \
MACRO(Other, GCHeapUsed, symbolsGCHeap) \
IF_BIGINT(MACRO(Other, GCHeapUsed, bigIntsGCHeap), ) \
IF_BIGINT(MACRO(Other, MallocHeap, bigIntsMallocHeap), ) \
MACRO(Other, GCHeapUsed, bigIntsGCHeap) \
MACRO(Other, MallocHeap, bigIntsMallocHeap) \
MACRO(Other, GCHeapAdmin, gcHeapArenaAdmin) \
MACRO(Other, GCHeapUsed, lazyScriptsGCHeap) \
MACRO(Other, MallocHeap, lazyScriptsMallocHeap) \
Expand Down
7 changes: 3 additions & 4 deletions js/public/ProtoKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#endif

#define JS_FOR_PROTOTYPES_(REAL, IMAGINARY, REAL_IF_INTL, REAL_IF_BDATA, \
REAL_IF_SAB, REAL_IF_BIGINT) \
REAL_IF_SAB) \
IMAGINARY(Null, InitNullClass, dummy) \
REAL(Object, InitViaClassSpec, OCLASP(Plain)) \
REAL(Function, InitViaClassSpec, &JSFunction::class_) \
Expand Down Expand Up @@ -90,7 +90,7 @@
REAL(Float32Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Float32)) \
REAL(Float64Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Float64)) \
REAL(Uint8ClampedArray, InitViaClassSpec, TYPED_ARRAY_CLASP(Uint8Clamped)) \
REAL_IF_BIGINT(BigInt, InitViaClassSpec, OCLASP(BigInt)) \
REAL(BigInt, InitViaClassSpec, OCLASP(BigInt)) \
REAL(Proxy, InitProxyClass, &js::ProxyClass) \
REAL(WeakMap, InitViaClassSpec, OCLASP(WeakMap)) \
REAL(Map, InitViaClassSpec, OCLASP(Map)) \
Expand Down Expand Up @@ -131,8 +131,7 @@

#define JS_FOR_PROTOTYPES(REAL, IMAGINARY) \
JS_FOR_PROTOTYPES_(REAL, IMAGINARY, IF_INTL(REAL, IMAGINARY), \
IF_BDATA(REAL, IMAGINARY), IF_SAB(REAL, IMAGINARY), \
IF_BIGINT(REAL, IMAGINARY))
IF_BDATA(REAL, IMAGINARY), IF_SAB(REAL, IMAGINARY))

#define JS_FOR_EACH_PROTOTYPE(MACRO) JS_FOR_PROTOTYPES(MACRO, MACRO)

Expand Down
4 changes: 1 addition & 3 deletions js/public/TraceKind.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ enum class TraceKind {
LazyScript = 0x2F,
Scope = 0x3F,
RegExpShared = 0x4F,
#ifdef ENABLE_BIGINT
BigInt = 0x5F
#endif
};
const static uintptr_t OutOfLineTraceKindMask = 0x07;

Expand Down Expand Up @@ -113,7 +111,7 @@ struct MapTypeToTraceKind {
D(Shape, js::Shape, true) \
D(String, JSString, false) \
D(Symbol, JS::Symbol, false) \
IF_BIGINT(D(BigInt, JS::BigInt, false), ) \
D(BigInt, JS::BigInt, false) \
D(RegExpShared, js::RegExpShared, true)

// Map from all public types to their trace kind.
Expand Down
4 changes: 0 additions & 4 deletions js/public/TracingAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ class JS_PUBLIC_API CallbackTracer : public JSTracer {
virtual void onSymbolEdge(JS::Symbol** symp) {
onChild(JS::GCCellPtr(*symp));
}
#ifdef ENABLE_BIGINT
virtual void onBigIntEdge(JS::BigInt** bip) { onChild(JS::GCCellPtr(*bip)); }
#endif
virtual void onScriptEdge(JSScript** scriptp) {
onChild(JS::GCCellPtr(*scriptp));
}
Expand Down Expand Up @@ -259,9 +257,7 @@ class JS_PUBLIC_API CallbackTracer : public JSTracer {
void dispatchToOnEdge(JSObject** objp) { onObjectEdge(objp); }
void dispatchToOnEdge(JSString** strp) { onStringEdge(strp); }
void dispatchToOnEdge(JS::Symbol** symp) { onSymbolEdge(symp); }
#ifdef ENABLE_BIGINT
void dispatchToOnEdge(JS::BigInt** bip) { onBigIntEdge(bip); }
#endif
void dispatchToOnEdge(JSScript** scriptp) { onScriptEdge(scriptp); }
void dispatchToOnEdge(js::Shape** shapep) { onShapeEdge(shapep); }
void dispatchToOnEdge(js::ObjectGroup** groupp) { onObjectGroupEdge(groupp); }
Expand Down
16 changes: 0 additions & 16 deletions js/public/TypeDecls.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ struct PropertyKey;
typedef unsigned char Latin1Char;

class Symbol;
#ifdef ENABLE_BIGINT
class BigInt;
#endif
union Value;

class Compartment;
Expand All @@ -65,9 +63,7 @@ typedef Handle<JSObject*> HandleObject;
typedef Handle<JSScript*> HandleScript;
typedef Handle<JSString*> HandleString;
typedef Handle<JS::Symbol*> HandleSymbol;
#ifdef ENABLE_BIGINT
typedef Handle<JS::BigInt*> HandleBigInt;
#endif
typedef Handle<Value> HandleValue;

typedef MutableHandle<JSFunction*> MutableHandleFunction;
Expand All @@ -76,19 +72,15 @@ typedef MutableHandle<JSObject*> MutableHandleObject;
typedef MutableHandle<JSScript*> MutableHandleScript;
typedef MutableHandle<JSString*> MutableHandleString;
typedef MutableHandle<JS::Symbol*> MutableHandleSymbol;
#ifdef ENABLE_BIGINT
typedef MutableHandle<JS::BigInt*> MutableHandleBigInt;
#endif
typedef MutableHandle<Value> MutableHandleValue;

typedef Rooted<JSObject*> RootedObject;
typedef Rooted<JSFunction*> RootedFunction;
typedef Rooted<JSScript*> RootedScript;
typedef Rooted<JSString*> RootedString;
typedef Rooted<JS::Symbol*> RootedSymbol;
#ifdef ENABLE_BIGINT
typedef Rooted<JS::BigInt*> RootedBigInt;
#endif
typedef Rooted<PropertyKey> RootedId;
typedef Rooted<JS::Value> RootedValue;

Expand All @@ -98,19 +90,11 @@ typedef PersistentRooted<JSObject*> PersistentRootedObject;
typedef PersistentRooted<JSScript*> PersistentRootedScript;
typedef PersistentRooted<JSString*> PersistentRootedString;
typedef PersistentRooted<JS::Symbol*> PersistentRootedSymbol;
#ifdef ENABLE_BIGINT
typedef PersistentRooted<JS::BigInt*> PersistentRootedBigInt;
#endif
typedef PersistentRooted<Value> PersistentRootedValue;

} // namespace JS

using jsid = JS::PropertyKey;

#ifdef ENABLE_BIGINT
# define IF_BIGINT(x, y) x
#else
# define IF_BIGINT(x, y) y
#endif

#endif /* js_TypeDecls_h */
2 changes: 0 additions & 2 deletions js/public/UbiNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,6 @@ class JS_PUBLIC_API Concrete<JS::Symbol> : TracerConcrete<JS::Symbol> {
static const char16_t concreteTypeName[];
};

#ifdef ENABLE_BIGINT
template <>
class JS_PUBLIC_API Concrete<JS::BigInt> : TracerConcrete<JS::BigInt> {
protected:
Expand All @@ -1096,7 +1095,6 @@ class JS_PUBLIC_API Concrete<JS::BigInt> : TracerConcrete<JS::BigInt> {
const char16_t* typeName() const override { return concreteTypeName; }
static const char16_t concreteTypeName[];
};
#endif

template <>
class JS_PUBLIC_API Concrete<JSScript> : TracerConcreteWithRealm<JSScript> {
Expand Down
Loading

0 comments on commit 7d559ef

Please sign in to comment.