Ignore:
Timestamp:
Mar 2, 2017, 12:35:37 PM (8 years ago)
Author:
[email protected]
Message:

Add support for selective handling of VM traps.
https://bugs.webkit.org/show_bug.cgi?id=169087

Reviewed by Keith Miller.

This is needed because there are some places in the VM where it's appropriate to
handle some types of VM traps but not others.

We implement this selection by using a VMTraps::Mask that allows the user to
specify which traps should be serviced.

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::executeProgram):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::execute):

  • runtime/VM.cpp:

(JSC::VM::handleTraps):

  • runtime/VM.h:
  • runtime/VMTraps.cpp:

(JSC::VMTraps::takeTrap): Deleted.

  • runtime/VMTraps.h:

(JSC::VMTraps::Mask::Mask):
(JSC::VMTraps::Mask::allEventTypes):
(JSC::VMTraps::Mask::bits):
(JSC::VMTraps::Mask::init):
(JSC::VMTraps::needTrapHandling):
(JSC::VMTraps::hasTrapForEvent):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r213107 r213295  
    862862
    863863    if (UNLIKELY(vm.needTrapHandling())) {
    864         vm.handleTraps(callFrame);
     864        VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
     865        vm.handleTraps(callFrame, mask);
    865866        RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
    866867    }
     
    922923
    923924    if (UNLIKELY(vm.needTrapHandling())) {
    924         vm.handleTraps(callFrame);
     925        VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
     926        vm.handleTraps(callFrame, mask);
    925927        RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
    926928    }
     
    987989
    988990    if (UNLIKELY(vm.needTrapHandling())) {
    989         vm.handleTraps(callFrame);
     991        VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
     992        vm.handleTraps(callFrame, mask);
    990993        RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
    991994    }
     
    10511054
    10521055    if (UNLIKELY(vm.needTrapHandling())) {
    1053         vm.handleTraps(closure.oldCallFrame);
     1056        VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
     1057        vm.handleTraps(closure.oldCallFrame, mask);
    10541058        RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
    10551059    }
     
    11541158
    11551159    if (UNLIKELY(vm.needTrapHandling())) {
    1156         vm.handleTraps(callFrame);
     1160        VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
     1161        vm.handleTraps(callFrame, mask);
    11571162        RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
    11581163    }
     
    11951200
    11961201    if (UNLIKELY(vm.needTrapHandling())) {
    1197         vm.handleTraps(callFrame);
     1202        VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);
     1203        vm.handleTraps(callFrame, mask);
    11981204        RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
    11991205    }
Note: See TracChangeset for help on using the changeset viewer.