Changeset 213367 in webkit
- Timestamp:
- Mar 3, 2017, 9:48:42 AM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r213356 r213367 1 2017-03-03 Mark Lam <mark.lam@apple.com> 2 3 We should only check for traps that we're able to handle. 4 https://bugs.webkit.org/show_bug.cgi?id=169136 5 6 Reviewed by Michael Saboff. 7 8 The execute methods in interpreter were checking for the existence of any traps 9 (without masking) and only handling a subset of those via a mask. This can 10 result in a failed assertion on debug builds. 11 12 This patch fixes this by applying the same mask for both the needTrapHandling() 13 check and the handleTraps() call. Also added a few assertions. 14 15 * interpreter/Interpreter.cpp: 16 (JSC::Interpreter::executeProgram): 17 (JSC::Interpreter::executeCall): 18 (JSC::Interpreter::executeConstruct): 19 (JSC::Interpreter::execute): 20 * jit/JITOperations.cpp: 21 * llint/LLIntSlowPaths.cpp: 22 (JSC::LLInt::LLINT_SLOW_PATH_DECL): 23 1 24 2017-03-02 Carlos Garcia Campos <cgarcia@igalia.com> 2 25 -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r213295 r213367 861 861 } 862 862 863 if (UNLIKELY(vm.needTrapHandling())) {864 VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);863 VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck); 864 if (UNLIKELY(vm.needTrapHandling(mask))) { 865 865 vm.handleTraps(callFrame, mask); 866 866 RETURN_IF_EXCEPTION(throwScope, throwScope.exception()); … … 922 922 newCodeBlock = 0; 923 923 924 if (UNLIKELY(vm.needTrapHandling())) {925 VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);924 VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck); 925 if (UNLIKELY(vm.needTrapHandling(mask))) { 926 926 vm.handleTraps(callFrame, mask); 927 927 RETURN_IF_EXCEPTION(throwScope, throwScope.exception()); … … 988 988 newCodeBlock = 0; 989 989 990 if (UNLIKELY(vm.needTrapHandling())) {991 VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);990 VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck); 991 if (UNLIKELY(vm.needTrapHandling(mask))) { 992 992 vm.handleTraps(callFrame, mask); 993 993 RETURN_IF_EXCEPTION(throwScope, throwScope.exception()); … … 1053 1053 StackStats::CheckPoint stackCheckPoint; 1054 1054 1055 if (UNLIKELY(vm.needTrapHandling())) {1056 VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);1055 VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck); 1056 if (UNLIKELY(vm.needTrapHandling(mask))) { 1057 1057 vm.handleTraps(closure.oldCallFrame, mask); 1058 1058 RETURN_IF_EXCEPTION(throwScope, throwScope.exception()); … … 1157 1157 } 1158 1158 1159 if (UNLIKELY(vm.needTrapHandling())) {1160 VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);1159 VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck); 1160 if (UNLIKELY(vm.needTrapHandling(mask))) { 1161 1161 vm.handleTraps(callFrame, mask); 1162 1162 RETURN_IF_EXCEPTION(throwScope, throwScope.exception()); … … 1199 1199 } 1200 1200 1201 if (UNLIKELY(vm.needTrapHandling())) {1202 VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck);1201 VMTraps::Mask mask(VMTraps::NeedTermination, VMTraps::NeedWatchdogCheck); 1202 if (UNLIKELY(vm.needTrapHandling(mask))) { 1203 1203 vm.handleTraps(callFrame, mask); 1204 1204 RETURN_IF_EXCEPTION(throwScope, throwScope.exception()); -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r213107 r213367 1213 1213 VM& vm = exec->vm(); 1214 1214 NativeCallFrameTracer tracer(&vm, exec); 1215 ASSERT(vm.needTrapHandling()); 1215 1216 vm.handleTraps(exec); 1216 1217 return nullptr; -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r213107 r213367 1498 1498 { 1499 1499 LLINT_BEGIN_NO_SET_PC(); 1500 ASSERT(vm.needTrapHandling()); 1500 1501 vm.handleTraps(exec); 1501 1502 LLINT_RETURN_TWO(throwScope.exception(), exec);
Note:
See TracChangeset
for help on using the changeset viewer.