Changeset 253609 in webkit


Ignore:
Timestamp:
Dec 16, 2019, 7:26:09 PM (5 years ago)
Author:
mark.lam@apple.com
Message:

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:
Location:
trunk/Source/JavaScriptCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r253608 r253609  
     12019-12-16  Mark Lam  <mark.lam@apple.com>
     2
     3        Rolling out: r253581 is failing tests on a release build.
     4        https://bugs.webkit.org/show_bug.cgi?id=205279
     5        <rdar://problem/57971874>
     6
     7        Not reviewed.
     8
     9        * interpreter/Interpreter.cpp:
     10        (JSC::Interpreter::executeProgram):
     11        (JSC::Interpreter::executeCall):
     12        (JSC::Interpreter::executeConstruct):
     13        (JSC::Interpreter::execute):
     14        (JSC::Interpreter::executeModuleProgram):
     15        * interpreter/InterpreterInlines.h:
     16        (JSC::Interpreter::execute):
     17        * jsc.cpp:
     18        (startTimeoutThreadIfNeeded):
     19        (runJSC):
     20        (jscmain):
     21        (startTimeoutTimer): Deleted.
     22        (timeoutCheckCallback): Deleted.
     23        (initializeTimeoutIfNeeded): Deleted.
     24        * runtime/JSCConfig.h:
     25        * runtime/VM.h:
     26        (JSC::VM::notifyNeedDebuggerBreak):
     27        (JSC::VM::notifyNeedShellTimeoutCheck): Deleted.
     28        * runtime/VMTraps.cpp:
     29        (JSC::VMTraps::handleTraps):
     30        * runtime/VMTraps.h:
     31        (JSC::VMTraps::Mask::Mask):
     32        (JSC::VMTraps::Mask::allEventTypes):
     33        (JSC::VMTraps::Mask::init):
     34        (JSC::VMTraps::interruptingTraps): Deleted.
     35        * tools/VMInspector.cpp:
     36        (JSC::VMInspector::forEachVM): Deleted.
     37        * tools/VMInspector.h:
     38
    1392019-12-16  Yusuke Suzuki  <ysuzuki@apple.com>
    240
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r253581 r253609  
    821821    }
    822822
    823     constexpr auto trapsMask = VMTraps::interruptingTraps();
    824     if (UNLIKELY(vm.needTrapHandling(trapsMask))) {
    825         vm.handleTraps(globalObject, vm.topCallFrame, trapsMask);
     823    VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
     824    if (UNLIKELY(vm.needTrapHandling(mask))) {
     825        vm.handleTraps(globalObject, vm.topCallFrame, mask);
    826826        RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
    827827    }
     
    882882        newCodeBlock = 0;
    883883
    884     constexpr auto trapsMask = VMTraps::interruptingTraps();
    885     if (UNLIKELY(vm.needTrapHandling(trapsMask))) {
    886         vm.handleTraps(globalObject, vm.topCallFrame, trapsMask);
     884    VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
     885    if (UNLIKELY(vm.needTrapHandling(mask))) {
     886        vm.handleTraps(globalObject, vm.topCallFrame, mask);
    887887        RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
    888888    }
     
    953953        newCodeBlock = 0;
    954954
    955     constexpr auto trapsMask = VMTraps::interruptingTraps();
    956     if (UNLIKELY(vm.needTrapHandling(trapsMask))) {
    957         vm.handleTraps(globalObject, vm.topCallFrame, trapsMask);
     955    VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
     956    if (UNLIKELY(vm.needTrapHandling(mask))) {
     957        vm.handleTraps(globalObject, vm.topCallFrame, mask);
    958958        RETURN_IF_EXCEPTION(throwScope, nullptr);
    959959    }
     
    11371137    }
    11381138
    1139     constexpr auto trapsMask = VMTraps::interruptingTraps();
    1140     if (UNLIKELY(vm.needTrapHandling(trapsMask))) {
    1141         vm.handleTraps(globalObject, vm.topCallFrame, trapsMask);
     1139    VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
     1140    if (UNLIKELY(vm.needTrapHandling(mask))) {
     1141        vm.handleTraps(globalObject, vm.topCallFrame, mask);
    11421142        RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
    11431143    }
     
    11871187    }
    11881188
    1189     constexpr auto trapsMask = VMTraps::interruptingTraps();
    1190     if (UNLIKELY(vm.needTrapHandling(trapsMask))) {
    1191         vm.handleTraps(globalObject, vm.topCallFrame, trapsMask);
     1189    VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
     1190    if (UNLIKELY(vm.needTrapHandling(mask))) {
     1191        vm.handleTraps(globalObject, vm.topCallFrame, mask);
    11921192        RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
    11931193    }
  • trunk/Source/JavaScriptCore/interpreter/InterpreterInlines.h

    r253581 r253609  
    11/*
    22 * Copyright (C) 2016 Yusuke Suzuki <utatane.tea@gmail.com>
    3  * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
     3 * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    7575    StackStats::CheckPoint stackCheckPoint;
    7676
    77     constexpr auto trapsMask = VMTraps::interruptingTraps();
    78     if (UNLIKELY(vm.needTrapHandling(trapsMask))) {
    79         vm.handleTraps(closure.protoCallFrame->globalObject, closure.oldCallFrame, trapsMask);
     77    VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
     78    if (UNLIKELY(vm.needTrapHandling(mask))) {
     79        vm.handleTraps(closure.protoCallFrame->globalObject, closure.oldCallFrame, mask);
    8080        RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
    8181    }
  • trunk/Source/JavaScriptCore/jsc.cpp

    r253581 r253609  
    7171#include "TestRunnerUtils.h"
    7272#include "TypedArrayInlines.h"
    73 #include "VMInspector.h"
    7473#include "WasmCapabilities.h"
    7574#include "WasmContext.h"
     
    8685#include <type_traits>
    8786#include <wtf/Box.h>
    88 #include <wtf/CPUTime.h>
    8987#include <wtf/CommaPrinter.h>
    9088#include <wtf/FileSystem.h>
     
    24302428static double s_desiredTimeout;
    24312429static double s_timeoutMultiplier = 1.0;
    2432 static Seconds s_timeoutDuration;
    2433 static Seconds s_maxAllowedCPUTime;
    2434 static VM* s_vm;
    2435 
    2436 static void startTimeoutTimer(Seconds duration)
    2437 {
    2438     Thread::create("jsc Timeout Thread", [=] () {
    2439         sleep(duration);
    2440         VMInspector::forEachVM([&] (VM& vm) -> VMInspector::FunctorStatus {
    2441             if (&vm != s_vm)
    2442                 return VMInspector::FunctorStatus::Continue;
    2443             vm.notifyNeedShellTimeoutCheck();
    2444             return VMInspector::FunctorStatus::Done;
    2445         });
    2446     });
    2447 }
    2448 
    2449 static void timeoutCheckCallback(VM& vm)
    2450 {
    2451     RELEASE_ASSERT(&vm == s_vm);
    2452     auto cpuTime = CPUTime::forCurrentThread();
    2453     if (cpuTime >= s_maxAllowedCPUTime) {
    2454         dataLog("Timed out after ", s_timeoutDuration, " seconds!\n");
    2455         CRASH();
    2456     }
    2457     auto remainingTime = s_maxAllowedCPUTime - cpuTime;
    2458     startTimeoutTimer(remainingTime);
    2459 }
    2460 
    2461 static void initializeTimeoutIfNeeded()
     2430
     2431static void startTimeoutThreadIfNeeded()
    24622432{
    24632433    if (char* timeoutString = getenv("JSCTEST_timeout")) {
     
    24652435            dataLog("WARNING: timeout string is malformed, got ", timeoutString,
    24662436                " but expected a number. Not using a timeout.\n");
    2467         } else
    2468             g_jscConfig.shellTimeoutCheckCallback = timeoutCheckCallback;
    2469     }
    2470 }
    2471 
    2472 static void startTimeoutThreadIfNeeded(VM& vm)
    2473 {
    2474     if (!g_jscConfig.shellTimeoutCheckCallback)
    2475         return;
    2476 
    2477     s_vm = &vm;
    2478     s_timeoutDuration = Seconds(s_desiredTimeout * s_timeoutMultiplier);
    2479     s_maxAllowedCPUTime = CPUTime::forCurrentThread() + s_timeoutDuration;
    2480     Seconds timeoutDuration(s_desiredTimeout * s_timeoutMultiplier);
    2481     startTimeoutTimer(timeoutDuration);
     2437        } else {
     2438            Thread::create("jsc Timeout Thread", [] () {
     2439                Seconds timeoutDuration(s_desiredTimeout * s_timeoutMultiplier);
     2440                sleep(timeoutDuration);
     2441                dataLog("Timed out after ", timeoutDuration, " seconds!\n");
     2442                CRASH();
     2443            });
     2444        }
     2445    }
    24822446}
    24832447
     
    30363000        JSLockHolder locker(vm);
    30373001
    3038         startTimeoutThreadIfNeeded(vm);
    30393002        if (options.m_profile && !vm.m_perBytecodeProfiler)
    30403003            vm.m_perBytecodeProfiler = makeUnique<Profiler::Database>(vm);
     
    31373100    // Initialize JSC before getting VM.
    31383101    JSC::initializeThreading();
    3139     initializeTimeoutIfNeeded();
     3102    startTimeoutThreadIfNeeded();
    31403103#if ENABLE(WEBASSEMBLY)
    31413104    JSC::Wasm::enableFastMemory();
  • trunk/Source/JavaScriptCore/runtime/JSCConfig.h

    r253581 r253609  
    3333class ExecutableAllocator;
    3434class FixedVMPoolExecutableAllocator;
    35 class VM;
    3635
    3736#if CPU(ARM64) || PLATFORM(WATCHOS)
     
    8483
    8584            OptionsStorage options;
    86 
    87             void (*shellTimeoutCheckCallback)(VM&);
    8885        };
    8986        char ensureSize[ConfigSizeToProtect];
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r253598 r253609  
    10681068
    10691069    void notifyNeedDebuggerBreak() { m_traps.fireTrap(VMTraps::NeedDebuggerBreak); }
    1070     void notifyNeedShellTimeoutCheck() { m_traps.fireTrap(VMTraps::NeedShellTimeoutCheck); }
    10711070    void notifyNeedTermination() { m_traps.fireTrap(VMTraps::NeedTermination); }
    10721071    void notifyNeedWatchdogCheck() { m_traps.fireTrap(VMTraps::NeedWatchdogCheck); }
  • trunk/Source/JavaScriptCore/runtime/VMTraps.cpp

    r253581 r253609  
    358358            invalidateCodeBlocksOnStack(callFrame);
    359359            break;
    360 
     360               
    361361        case NeedWatchdogCheck:
    362362            ASSERT(vm.watchdog());
     
    364364                continue;
    365365            FALLTHROUGH;
    366 
    367         case NeedShellTimeoutCheck:
    368             RELEASE_ASSERT(g_jscConfig.shellTimeoutCheckCallback);
    369             g_jscConfig.shellTimeoutCheckCallback(vm);
    370             break;
    371366
    372367        case NeedTermination:
  • trunk/Source/JavaScriptCore/runtime/VMTraps.h

    r253581 r253609  
    11/*
    2  * Copyright (C) 2017-2019 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    5353        // Sorted in servicing priority order from highest to lowest.
    5454        NeedDebuggerBreak,
    55         NeedShellTimeoutCheck,
    5655        NeedTermination,
    5756        NeedWatchdogCheck,
     
    6362    public:
    6463        enum AllEventTypes { AllEventTypesTag };
    65         constexpr Mask(AllEventTypes)
     64        Mask(AllEventTypes)
    6665            : m_mask(std::numeric_limits<BitField>::max())
    6766        { }
    68         static constexpr Mask allEventTypes() { return Mask(AllEventTypesTag); }
    69 
    70         constexpr Mask(const Mask&) = default;
    71         constexpr Mask(Mask&&) = default;
     67        static Mask allEventTypes() { return Mask(AllEventTypesTag); }
    7268
    7369        template<typename... Arguments>
    74         constexpr Mask(Arguments... args)
     70        Mask(Arguments... args)
    7571            : m_mask(0)
    7672        {
     
    8278    private:
    8379        template<typename... Arguments>
    84         constexpr void init(EventType eventType, Arguments... args)
     80        void init(EventType eventType, Arguments... args)
    8581        {
    8682            ASSERT(eventType < NumberOfEventTypes);
     
    8985        }
    9086
    91         constexpr void init() { }
     87        void init() { }
    9288
    9389        BitField m_mask;
    9490    };
    95 
    96     static constexpr Mask interruptingTraps() { return Mask(NeedShellTimeoutCheck, NeedTermination, NeedWatchdogCheck); }
    9791
    9892    ~VMTraps();
  • trunk/Source/JavaScriptCore/tools/VMInspector.cpp

    r253581 r253609  
    107107#endif // ENABLE(JIT)
    108108
    109 void VMInspector::forEachVM(Function<FunctorStatus(VM&)>&& func)
    110 {
    111     VMInspector& inspector = instance();
    112     Locker lock(inspector.getLock());
    113     inspector.iterate(func);
    114 }
    115 
    116109auto VMInspector::isValidExecutableMemory(const VMInspector::Locker&, void* machinePC) -> Expected<bool, Error>
    117110{
  • trunk/Source/JavaScriptCore/tools/VMInspector.h

    r253581 r253609  
    6161    void iterate(const Locker&, const Functor& functor) { iterate(functor); }
    6262
    63     JS_EXPORT_PRIVATE static void forEachVM(Function<FunctorStatus(VM&)>&&);
    64 
    6563    Expected<Locker, Error> lock(Seconds timeout = Seconds::infinity());
    6664
Note: See TracChangeset for help on using the changeset viewer.