Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (253608 => 253609)
--- trunk/Source/_javascript_Core/ChangeLog 2019-12-17 02:27:14 UTC (rev 253608)
+++ trunk/Source/_javascript_Core/ChangeLog 2019-12-17 03:26:09 UTC (rev 253609)
@@ -1,3 +1,41 @@
+2019-12-16 Mark Lam <[email protected]>
+
+ Rolling out: r253581 is failing tests on a release build.
+ https://bugs.webkit.org/show_bug.cgi?id=205279
+ <rdar://problem/57971874>
+
+ Not reviewed.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::executeProgram):
+ (JSC::Interpreter::executeCall):
+ (JSC::Interpreter::executeConstruct):
+ (JSC::Interpreter::execute):
+ (JSC::Interpreter::executeModuleProgram):
+ * interpreter/InterpreterInlines.h:
+ (JSC::Interpreter::execute):
+ * jsc.cpp:
+ (startTimeoutThreadIfNeeded):
+ (runJSC):
+ (jscmain):
+ (startTimeoutTimer): Deleted.
+ (timeoutCheckCallback): Deleted.
+ (initializeTimeoutIfNeeded): Deleted.
+ * runtime/JSCConfig.h:
+ * runtime/VM.h:
+ (JSC::VM::notifyNeedDebuggerBreak):
+ (JSC::VM::notifyNeedShellTimeoutCheck): Deleted.
+ * runtime/VMTraps.cpp:
+ (JSC::VMTraps::handleTraps):
+ * runtime/VMTraps.h:
+ (JSC::VMTraps::Mask::Mask):
+ (JSC::VMTraps::Mask::allEventTypes):
+ (JSC::VMTraps::Mask::init):
+ (JSC::VMTraps::interruptingTraps): Deleted.
+ * tools/VMInspector.cpp:
+ (JSC::VMInspector::forEachVM): Deleted.
+ * tools/VMInspector.h:
+
2019-12-16 Yusuke Suzuki <[email protected]>
ASSERTION FAILED: length <= maximumLength in js-fixed-array-out-of-memory.js
Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.cpp (253608 => 253609)
--- trunk/Source/_javascript_Core/interpreter/Interpreter.cpp 2019-12-17 02:27:14 UTC (rev 253608)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.cpp 2019-12-17 03:26:09 UTC (rev 253609)
@@ -820,9 +820,9 @@
codeBlock = jsCast<ProgramCodeBlock*>(tempCodeBlock);
}
- constexpr auto trapsMask = VMTraps::interruptingTraps();
- if (UNLIKELY(vm.needTrapHandling(trapsMask))) {
- vm.handleTraps(globalObject, vm.topCallFrame, trapsMask);
+ VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
+ if (UNLIKELY(vm.needTrapHandling(mask))) {
+ vm.handleTraps(globalObject, vm.topCallFrame, mask);
RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
}
@@ -881,9 +881,9 @@
} else
newCodeBlock = 0;
- constexpr auto trapsMask = VMTraps::interruptingTraps();
- if (UNLIKELY(vm.needTrapHandling(trapsMask))) {
- vm.handleTraps(globalObject, vm.topCallFrame, trapsMask);
+ VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
+ if (UNLIKELY(vm.needTrapHandling(mask))) {
+ vm.handleTraps(globalObject, vm.topCallFrame, mask);
RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
}
@@ -952,9 +952,9 @@
} else
newCodeBlock = 0;
- constexpr auto trapsMask = VMTraps::interruptingTraps();
- if (UNLIKELY(vm.needTrapHandling(trapsMask))) {
- vm.handleTraps(globalObject, vm.topCallFrame, trapsMask);
+ VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
+ if (UNLIKELY(vm.needTrapHandling(mask))) {
+ vm.handleTraps(globalObject, vm.topCallFrame, mask);
RETURN_IF_EXCEPTION(throwScope, nullptr);
}
@@ -1136,9 +1136,9 @@
}
}
- constexpr auto trapsMask = VMTraps::interruptingTraps();
- if (UNLIKELY(vm.needTrapHandling(trapsMask))) {
- vm.handleTraps(globalObject, vm.topCallFrame, trapsMask);
+ VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
+ if (UNLIKELY(vm.needTrapHandling(mask))) {
+ vm.handleTraps(globalObject, vm.topCallFrame, mask);
RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
}
@@ -1186,9 +1186,9 @@
codeBlock = jsCast<ModuleProgramCodeBlock*>(tempCodeBlock);
}
- constexpr auto trapsMask = VMTraps::interruptingTraps();
- if (UNLIKELY(vm.needTrapHandling(trapsMask))) {
- vm.handleTraps(globalObject, vm.topCallFrame, trapsMask);
+ VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
+ if (UNLIKELY(vm.needTrapHandling(mask))) {
+ vm.handleTraps(globalObject, vm.topCallFrame, mask);
RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
}
Modified: trunk/Source/_javascript_Core/interpreter/InterpreterInlines.h (253608 => 253609)
--- trunk/Source/_javascript_Core/interpreter/InterpreterInlines.h 2019-12-17 02:27:14 UTC (rev 253608)
+++ trunk/Source/_javascript_Core/interpreter/InterpreterInlines.h 2019-12-17 03:26:09 UTC (rev 253609)
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 Yusuke Suzuki <[email protected]>
- * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -74,9 +74,9 @@
StackStats::CheckPoint stackCheckPoint;
- constexpr auto trapsMask = VMTraps::interruptingTraps();
- if (UNLIKELY(vm.needTrapHandling(trapsMask))) {
- vm.handleTraps(closure.protoCallFrame->globalObject, closure.oldCallFrame, trapsMask);
+ VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
+ if (UNLIKELY(vm.needTrapHandling(mask))) {
+ vm.handleTraps(closure.protoCallFrame->globalObject, closure.oldCallFrame, mask);
RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
}
Modified: trunk/Source/_javascript_Core/jsc.cpp (253608 => 253609)
--- trunk/Source/_javascript_Core/jsc.cpp 2019-12-17 02:27:14 UTC (rev 253608)
+++ trunk/Source/_javascript_Core/jsc.cpp 2019-12-17 03:26:09 UTC (rev 253609)
@@ -70,7 +70,6 @@
#include "SuperSampler.h"
#include "TestRunnerUtils.h"
#include "TypedArrayInlines.h"
-#include "VMInspector.h"
#include "WasmCapabilities.h"
#include "WasmContext.h"
#include "WasmFaultSignalHandler.h"
@@ -85,7 +84,6 @@
#include <thread>
#include <type_traits>
#include <wtf/Box.h>
-#include <wtf/CPUTime.h>
#include <wtf/CommaPrinter.h>
#include <wtf/FileSystem.h>
#include <wtf/MainThread.h>
@@ -2429,58 +2427,24 @@
static double s_desiredTimeout;
static double s_timeoutMultiplier = 1.0;
-static Seconds s_timeoutDuration;
-static Seconds s_maxAllowedCPUTime;
-static VM* s_vm;
-static void startTimeoutTimer(Seconds duration)
+static void startTimeoutThreadIfNeeded()
{
- Thread::create("jsc Timeout Thread", [=] () {
- sleep(duration);
- VMInspector::forEachVM([&] (VM& vm) -> VMInspector::FunctorStatus {
- if (&vm != s_vm)
- return VMInspector::FunctorStatus::Continue;
- vm.notifyNeedShellTimeoutCheck();
- return VMInspector::FunctorStatus::Done;
- });
- });
-}
-
-static void timeoutCheckCallback(VM& vm)
-{
- RELEASE_ASSERT(&vm == s_vm);
- auto cpuTime = CPUTime::forCurrentThread();
- if (cpuTime >= s_maxAllowedCPUTime) {
- dataLog("Timed out after ", s_timeoutDuration, " seconds!\n");
- CRASH();
- }
- auto remainingTime = s_maxAllowedCPUTime - cpuTime;
- startTimeoutTimer(remainingTime);
-}
-
-static void initializeTimeoutIfNeeded()
-{
if (char* timeoutString = getenv("JSCTEST_timeout")) {
if (sscanf(timeoutString, "%lf", &s_desiredTimeout) != 1) {
dataLog("WARNING: timeout string is malformed, got ", timeoutString,
" but expected a number. Not using a timeout.\n");
- } else
- g_jscConfig.shellTimeoutCheckCallback = timeoutCheckCallback;
+ } else {
+ Thread::create("jsc Timeout Thread", [] () {
+ Seconds timeoutDuration(s_desiredTimeout * s_timeoutMultiplier);
+ sleep(timeoutDuration);
+ dataLog("Timed out after ", timeoutDuration, " seconds!\n");
+ CRASH();
+ });
+ }
}
}
-static void startTimeoutThreadIfNeeded(VM& vm)
-{
- if (!g_jscConfig.shellTimeoutCheckCallback)
- return;
-
- s_vm = &vm;
- s_timeoutDuration = Seconds(s_desiredTimeout * s_timeoutMultiplier);
- s_maxAllowedCPUTime = CPUTime::forCurrentThread() + s_timeoutDuration;
- Seconds timeoutDuration(s_desiredTimeout * s_timeoutMultiplier);
- startTimeoutTimer(timeoutDuration);
-}
-
int main(int argc, char** argv)
{
#if PLATFORM(IOS_FAMILY) && CPU(ARM_THUMB2)
@@ -3035,7 +2999,6 @@
{
JSLockHolder locker(vm);
- startTimeoutThreadIfNeeded(vm);
if (options.m_profile && !vm.m_perBytecodeProfiler)
vm.m_perBytecodeProfiler = makeUnique<Profiler::Database>(vm);
@@ -3136,7 +3099,7 @@
// Initialize JSC before getting VM.
JSC::initializeThreading();
- initializeTimeoutIfNeeded();
+ startTimeoutThreadIfNeeded();
#if ENABLE(WEBASSEMBLY)
JSC::Wasm::enableFastMemory();
#endif
Modified: trunk/Source/_javascript_Core/runtime/JSCConfig.h (253608 => 253609)
--- trunk/Source/_javascript_Core/runtime/JSCConfig.h 2019-12-17 02:27:14 UTC (rev 253608)
+++ trunk/Source/_javascript_Core/runtime/JSCConfig.h 2019-12-17 03:26:09 UTC (rev 253609)
@@ -32,7 +32,6 @@
class ExecutableAllocator;
class FixedVMPoolExecutableAllocator;
-class VM;
#if CPU(ARM64) || PLATFORM(WATCHOS)
constexpr size_t PageSize = 16 * KB;
@@ -83,8 +82,6 @@
#endif
OptionsStorage options;
-
- void (*shellTimeoutCheckCallback)(VM&);
};
char ensureSize[ConfigSizeToProtect];
};
Modified: trunk/Source/_javascript_Core/runtime/VM.h (253608 => 253609)
--- trunk/Source/_javascript_Core/runtime/VM.h 2019-12-17 02:27:14 UTC (rev 253608)
+++ trunk/Source/_javascript_Core/runtime/VM.h 2019-12-17 03:26:09 UTC (rev 253609)
@@ -1067,7 +1067,6 @@
void* needTrapHandlingAddress() { return m_traps.needTrapHandlingAddress(); }
void notifyNeedDebuggerBreak() { m_traps.fireTrap(VMTraps::NeedDebuggerBreak); }
- void notifyNeedShellTimeoutCheck() { m_traps.fireTrap(VMTraps::NeedShellTimeoutCheck); }
void notifyNeedTermination() { m_traps.fireTrap(VMTraps::NeedTermination); }
void notifyNeedWatchdogCheck() { m_traps.fireTrap(VMTraps::NeedWatchdogCheck); }
Modified: trunk/Source/_javascript_Core/runtime/VMTraps.cpp (253608 => 253609)
--- trunk/Source/_javascript_Core/runtime/VMTraps.cpp 2019-12-17 02:27:14 UTC (rev 253608)
+++ trunk/Source/_javascript_Core/runtime/VMTraps.cpp 2019-12-17 03:26:09 UTC (rev 253609)
@@ -357,7 +357,7 @@
dataLog("VM ", RawPointer(&vm), " on pid ", getCurrentProcessID(), " received NeedDebuggerBreak trap\n");
invalidateCodeBlocksOnStack(callFrame);
break;
-
+
case NeedWatchdogCheck:
ASSERT(vm.watchdog());
if (LIKELY(!vm.watchdog()->shouldTerminate(globalObject)))
@@ -364,11 +364,6 @@
continue;
FALLTHROUGH;
- case NeedShellTimeoutCheck:
- RELEASE_ASSERT(g_jscConfig.shellTimeoutCheckCallback);
- g_jscConfig.shellTimeoutCheckCallback(vm);
- break;
-
case NeedTermination:
throwException(globalObject, scope, createTerminatedExecutionException(&vm));
return;
Modified: trunk/Source/_javascript_Core/runtime/VMTraps.h (253608 => 253609)
--- trunk/Source/_javascript_Core/runtime/VMTraps.h 2019-12-17 02:27:14 UTC (rev 253608)
+++ trunk/Source/_javascript_Core/runtime/VMTraps.h 2019-12-17 03:26:09 UTC (rev 253609)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -52,7 +52,6 @@
enum EventType {
// Sorted in servicing priority order from highest to lowest.
NeedDebuggerBreak,
- NeedShellTimeoutCheck,
NeedTermination,
NeedWatchdogCheck,
NumberOfEventTypes, // This entry must be last in this list.
@@ -62,16 +61,13 @@
class Mask {
public:
enum AllEventTypes { AllEventTypesTag };
- constexpr Mask(AllEventTypes)
+ Mask(AllEventTypes)
: m_mask(std::numeric_limits<BitField>::max())
{ }
- static constexpr Mask allEventTypes() { return Mask(AllEventTypesTag); }
+ static Mask allEventTypes() { return Mask(AllEventTypesTag); }
- constexpr Mask(const Mask&) = default;
- constexpr Mask(Mask&&) = default;
-
template<typename... Arguments>
- constexpr Mask(Arguments... args)
+ Mask(Arguments... args)
: m_mask(0)
{
init(args...);
@@ -81,7 +77,7 @@
private:
template<typename... Arguments>
- constexpr void init(EventType eventType, Arguments... args)
+ void init(EventType eventType, Arguments... args)
{
ASSERT(eventType < NumberOfEventTypes);
m_mask |= (1 << eventType);
@@ -88,13 +84,11 @@
init(args...);
}
- constexpr void init() { }
+ void init() { }
BitField m_mask;
};
- static constexpr Mask interruptingTraps() { return Mask(NeedShellTimeoutCheck, NeedTermination, NeedWatchdogCheck); }
-
~VMTraps();
VMTraps();
Modified: trunk/Source/_javascript_Core/tools/VMInspector.cpp (253608 => 253609)
--- trunk/Source/_javascript_Core/tools/VMInspector.cpp 2019-12-17 02:27:14 UTC (rev 253608)
+++ trunk/Source/_javascript_Core/tools/VMInspector.cpp 2019-12-17 03:26:09 UTC (rev 253609)
@@ -106,13 +106,6 @@
};
#endif // ENABLE(JIT)
-void VMInspector::forEachVM(Function<FunctorStatus(VM&)>&& func)
-{
- VMInspector& inspector = instance();
- Locker lock(inspector.getLock());
- inspector.iterate(func);
-}
-
auto VMInspector::isValidExecutableMemory(const VMInspector::Locker&, void* machinePC) -> Expected<bool, Error>
{
#if ENABLE(JIT)
Modified: trunk/Source/_javascript_Core/tools/VMInspector.h (253608 => 253609)
--- trunk/Source/_javascript_Core/tools/VMInspector.h 2019-12-17 02:27:14 UTC (rev 253608)
+++ trunk/Source/_javascript_Core/tools/VMInspector.h 2019-12-17 03:26:09 UTC (rev 253609)
@@ -60,8 +60,6 @@
template <typename Functor>
void iterate(const Locker&, const Functor& functor) { iterate(functor); }
- JS_EXPORT_PRIVATE static void forEachVM(Function<FunctorStatus(VM&)>&&);
-
Expected<Locker, Error> lock(Seconds timeout = Seconds::infinity());
Expected<bool, Error> isValidExecutableMemory(const Locker&, void*);