diff options
author | Moonchild <moonchild@palemoon.org> | 2022-02-20 22:00:59 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-04-22 13:58:16 +0000 |
commit | 5aa65d2aeab36ea8de8129c0babcf70a5e4e662a (patch) | |
tree | 36ed652ffb09104d8a10c01261b851329f34882f /js/src | |
parent | 712ca7303b0835772f8abca85ebec981e254a017 (diff) | |
download | uxp-5aa65d2aeab36ea8de8129c0babcf70a5e4e662a.tar.gz |
Issue #1877 - Resolve NIGHTLY_BUILD conditionals.
Diffstat (limited to 'js/src')
-rw-r--r-- | js/src/builtin/TestingFunctions.cpp | 41 | ||||
-rw-r--r-- | js/src/jit/x86-shared/BaseAssembler-x86-shared.h | 23 | ||||
-rw-r--r-- | js/src/js-config.mozbuild | 6 | ||||
-rw-r--r-- | js/src/jsutil.h | 4 | ||||
-rw-r--r-- | js/src/vm/Debugger.cpp | 10 | ||||
-rw-r--r-- | js/src/vm/Debugger.h | 4 | ||||
-rw-r--r-- | js/src/vm/UnboxedObject.cpp | 10 | ||||
-rw-r--r-- | js/src/wasm/AsmJS.cpp | 5 |
8 files changed, 15 insertions, 88 deletions
diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index f91a53eae2..8bcae4d826 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -2433,39 +2433,6 @@ SharedMemoryEnabled(JSContext* cx, unsigned argc, Value* vp) return true; } -#ifdef NIGHTLY_BUILD -static bool -ObjectAddress(JSContext* cx, unsigned argc, Value* vp) -{ - CallArgs args = CallArgsFromVp(argc, vp); - if (args.length() != 1) { - RootedObject callee(cx, &args.callee()); - ReportUsageErrorASCII(cx, callee, "Wrong number of arguments"); - return false; - } - if (!args[0].isObject()) { - RootedObject callee(cx, &args.callee()); - ReportUsageErrorASCII(cx, callee, "Expected object"); - return false; - } - -#ifdef JS_MORE_DETERMINISTIC - args.rval().setInt32(0); -#else - void* ptr = js::UncheckedUnwrap(&args[0].toObject(), true); - char buffer[64]; - SprintfLiteral(buffer, "%p", ptr); - - JSString* str = JS_NewStringCopyZ(cx, buffer); - if (!str) - return false; - - args.rval().setString(str); -#endif - - return true; -} - static bool SharedAddress(JSContext* cx, unsigned argc, Value* vp) { @@ -2507,7 +2474,6 @@ SharedAddress(JSContext* cx, unsigned argc, Value* vp) return true; } -#endif static bool DumpBacktrace(JSContext* cx, unsigned argc, Value* vp) @@ -4430,16 +4396,9 @@ JS_FN_HELP("rejectPromise", RejectPromise, 2, 0, "sharedMemoryEnabled()", " Return true if SharedArrayBuffer and Atomics are enabled"), -#ifdef NIGHTLY_BUILD - JS_FN_HELP("objectAddress", ObjectAddress, 1, 0, -"objectAddress(obj)", -" Return the current address of the object. For debugging only--this\n" -" address may change during a moving GC."), - JS_FN_HELP("sharedAddress", SharedAddress, 1, 0, "sharedAddress(obj)", " Return the address of the shared storage of a SharedArrayBuffer."), -#endif JS_FN_HELP("evalReturningScope", EvalReturningScope, 1, 0, "evalReturningScope(scriptStr, [global])", diff --git a/js/src/jit/x86-shared/BaseAssembler-x86-shared.h b/js/src/jit/x86-shared/BaseAssembler-x86-shared.h index 54b862a56c..b5f800cdab 100644 --- a/js/src/jit/x86-shared/BaseAssembler-x86-shared.h +++ b/js/src/jit/x86-shared/BaseAssembler-x86-shared.h @@ -2,6 +2,7 @@ * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. + * Portions Copyright (C) 2022 Moonchild Productions. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -3779,28 +3780,6 @@ threeByteOpImmSimd("vblendps", VEX_PD, OP3_BLENDPS_VpsWpsIb, ESCAPE_3A, imm, off return false; if (MOZ_UNLIKELY(size_t(offset) >= size())) { -#ifdef NIGHTLY_BUILD - // Stash some data on the stack so we can retrieve it from minidumps, - // see bug 1124397. - int32_t startOffset = from.offset() - 1; - while (startOffset >= 0 && code[startOffset] == 0xe5) - startOffset--; - int32_t endOffset = from.offset() - 1; - while (endOffset < int32_t(size()) && code[endOffset] == 0xe5) - endOffset++; - volatile uintptr_t dump[10]; - blackbox = dump; - blackbox[0] = uintptr_t(0xABCD1234); - blackbox[1] = uintptr_t(offset); - blackbox[2] = uintptr_t(size()); - blackbox[3] = uintptr_t(from.offset()); - blackbox[4] = uintptr_t(code[from.offset() - 5]); - blackbox[5] = uintptr_t(code[from.offset() - 4]); - blackbox[6] = uintptr_t(code[from.offset() - 3]); - blackbox[7] = uintptr_t(startOffset); - blackbox[8] = uintptr_t(endOffset); - blackbox[9] = uintptr_t(0xFFFF7777); -#endif MOZ_CRASH("nextJump bogus offset"); } diff --git a/js/src/js-config.mozbuild b/js/src/js-config.mozbuild index 4166c0ad16..d90a42466a 100644 --- a/js/src/js-config.mozbuild +++ b/js/src/js-config.mozbuild @@ -10,11 +10,9 @@ DEFINES['ENABLE_SHARED_ARRAY_BUFFER'] = True DEFINES['EXPORT_JS_API'] = True -if CONFIG['NIGHTLY_BUILD']: - DEFINES['ENABLE_BINARYDATA'] = True +DEFINES['ENABLE_BINARYDATA'] = True -if CONFIG['NIGHTLY_BUILD']: - DEFINES['ENABLE_SIMD'] = True +DEFINES['ENABLE_SIMD'] = True if CONFIG['JS_HAS_CTYPES']: DEFINES['JS_HAS_CTYPES'] = True diff --git a/js/src/jsutil.h b/js/src/jsutil.h index daf056ad2f..48141b1592 100644 --- a/js/src/jsutil.h +++ b/js/src/jsutil.h @@ -361,8 +361,8 @@ Poison(void* ptr, uint8_t value, size_t num) return ptr; } -/* Crash diagnostics by default in debug and on nightly channel. */ -#if (defined(DEBUG) || defined(NIGHTLY_BUILD)) && !defined(MOZ_ASAN) +/* Crash diagnostics by default in debug. */ +#if defined(DEBUG) && !defined(MOZ_ASAN) # define JS_CRASH_DIAGNOSTICS 1 #endif diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 305555f414..1c875c606f 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -641,7 +641,7 @@ Debugger::Debugger(JSContext* cx, NativeObject* dbg) environments(cx), wasmInstanceScripts(cx), wasmInstanceSources(cx), -#ifdef NIGHTLY_BUILD +#ifdef DEBUG traceLoggerLastDrainedSize(0), traceLoggerLastDrainedIteration(0), #endif @@ -656,7 +656,7 @@ Debugger::Debugger(JSContext* cx, NativeObject* dbg) #ifdef JS_TRACE_LOGGING TraceLoggerThread* logger = TraceLoggerForMainThread(cx->runtime()); if (logger) { -#ifdef NIGHTLY_BUILD +#ifdef DEBUG logger->getIterationAndSize(&traceLoggerLastDrainedIteration, &traceLoggerLastDrainedSize); #endif logger->getIterationAndSize(&traceLoggerScriptedCallsLastDrainedIteration, @@ -4891,7 +4891,7 @@ DefineProperty(JSContext* cx, HandleObject obj, HandleId id, const char* value, } #ifdef JS_TRACE_LOGGING -# ifdef NIGHTLY_BUILD +# ifdef DEBUG bool Debugger::setupTraceLogger(JSContext* cx, unsigned argc, Value* vp) { @@ -5009,7 +5009,7 @@ Debugger::drainTraceLogger(JSContext* cx, unsigned argc, Value* vp) return true; } -# endif // NIGHTLY_BUILD +# endif // DEBUG bool Debugger::setupTraceLoggerScriptCalls(JSContext* cx, unsigned argc, Value* vp) @@ -5262,7 +5262,7 @@ const JSFunctionSpec Debugger::methods[] = { JS_FN("drainTraceLoggerScriptCalls", Debugger::drainTraceLoggerScriptCalls, 0, 0), JS_FN("startTraceLogger", Debugger::startTraceLogger, 0, 0), JS_FN("endTraceLogger", Debugger::endTraceLogger, 0, 0), -# ifdef NIGHTLY_BUILD +# ifdef DEBUG JS_FN("setupTraceLogger", Debugger::setupTraceLogger, 1, 0), JS_FN("drainTraceLogger", Debugger::drainTraceLogger, 0, 0), # endif diff --git a/js/src/vm/Debugger.h b/js/src/vm/Debugger.h index c8b84d8b14..56a6318ba9 100644 --- a/js/src/vm/Debugger.h +++ b/js/src/vm/Debugger.h @@ -485,7 +485,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger> * Keep track of tracelogger last drained identifiers to know if there are * lost events. */ -#ifdef NIGHTLY_BUILD +#ifdef DEBUG uint32_t traceLoggerLastDrainedSize; uint32_t traceLoggerLastDrainedIteration; #endif @@ -629,7 +629,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger> static bool startTraceLogger(JSContext* cx, unsigned argc, Value* vp); static bool endTraceLogger(JSContext* cx, unsigned argc, Value* vp); static bool isCompilableUnit(JSContext* cx, unsigned argc, Value* vp); -#ifdef NIGHTLY_BUILD +#ifdef DEBUG static bool setupTraceLogger(JSContext* cx, unsigned argc, Value* vp); static bool drainTraceLogger(JSContext* cx, unsigned argc, Value* vp); #endif diff --git a/js/src/vm/UnboxedObject.cpp b/js/src/vm/UnboxedObject.cpp index de6bdef9e3..4912e65db9 100644 --- a/js/src/vm/UnboxedObject.cpp +++ b/js/src/vm/UnboxedObject.cpp @@ -1906,17 +1906,9 @@ js::TryConvertToUnboxedLayout(ExclusiveContext* cx, AutoEnterAnalysis& enter, Sh { bool isArray = !templateShape; - // Unboxed arrays are nightly only for now. The getenv() call will be - // removed when they are on by default. See bug 1153266. + // Unboxed arrays are disabled for now. See bug 1153266. if (isArray) { -#ifdef NIGHTLY_BUILD - if (!getenv("JS_OPTION_USE_UNBOXED_ARRAYS")) { - if (!cx->options().unboxedArrays()) - return true; - } -#else return true; -#endif } else { if (jit::JitOptions.disableUnboxedObjects) return true; diff --git a/js/src/wasm/AsmJS.cpp b/js/src/wasm/AsmJS.cpp index f659c27ffa..8cbbff5370 100644 --- a/js/src/wasm/AsmJS.cpp +++ b/js/src/wasm/AsmJS.cpp @@ -1,6 +1,7 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright 2014 Mozilla Foundation + * Copyright 2022 Moonchild Productions * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -8546,9 +8547,7 @@ LookupAsmJSModuleInCache(ExclusiveContext* cx, AsmJSParser& parser, bool* loaded // Don't punish release users by crashing if there is a programmer error // here, just gracefully return with a cache miss. -#ifdef NIGHTLY_BUILD - MOZ_RELEASE_ASSERT(cursor == entry.memory + entry.serializedSize); -#endif + MOZ_ASSERT(cursor == entry.memory + entry.serializedSize); if (cursor != entry.memory + entry.serializedSize) return true; |