Ignore:
Timestamp:
Apr 18, 2013, 3:45:25 PM (12 years ago)
Author:
[email protected]
Message:

Interpreter entry points should throw the TerminatedExecutionException from the caller frame.
https://bugs.webkit.org/show_bug.cgi?id=114816.

Reviewed by Oliver Hunt.

  • interpreter/Interpreter.cpp:

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

File:
1 edited

Legend:

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

    r148696 r148709  
    10171017    ProgramCodeBlock* codeBlock = &program->generatedBytecode();
    10181018
     1019    if (UNLIKELY(vm.watchdog.didFire(callFrame)))
     1020        return throwTerminatedExecutionException(callFrame);
     1021
    10191022    // Push the call frame for this invocation:
    10201023    ASSERT(codeBlock->numParameters() == 1); // 1 parameter for 'this'.
     
    10311034    // Execute the code:
    10321035    JSValue result;
    1033     if (LIKELY(!vm.watchdog.didFire(newCallFrame))) {
     1036    {
    10341037        SamplingTool::CallRecord callRecord(m_sampler.get());
    10351038        Watchdog::Scope watchdogScope(vm.watchdog);
     
    10401043        result = program->generatedJITCode().execute(&m_stack, newCallFrame, &vm);
    10411044#endif // ENABLE(JIT)
    1042     } else
    1043         result = throwTerminatedExecutionException(newCallFrame);
     1045    }
    10441046
    10451047    if (LegacyProfiler* profiler = vm.enabledProfiler())
     
    10901092        newCodeBlock = 0;
    10911093
     1094    if (UNLIKELY(vm.watchdog.didFire(callFrame)))
     1095        return throwTerminatedExecutionException(callFrame);
     1096
    10921097    CallFrame* newCallFrame = m_stack.pushFrame(callFrame, newCodeBlock, scope, argsCount, function);
    10931098    if (UNLIKELY(!newCallFrame))
     
    11031108
    11041109    JSValue result;
    1105     if (LIKELY(!vm.watchdog.didFire(newCallFrame))) {
     1110    {
    11061111        SamplingTool::CallRecord callRecord(m_sampler.get(), !isJSCall);
    11071112        Watchdog::Scope watchdogScope(vm.watchdog);
     
    11161121        } else
    11171122            result = JSValue::decode(callData.native.function(newCallFrame));
    1118     } else
    1119         result = throwTerminatedExecutionException(newCallFrame);
     1123    }
    11201124
    11211125    if (LegacyProfiler* profiler = vm.enabledProfiler())
     
    11671171        newCodeBlock = 0;
    11681172
     1173    if (UNLIKELY(vm.watchdog.didFire(callFrame)))
     1174        return throwTerminatedExecutionException(callFrame);
     1175
    11691176    CallFrame* newCallFrame = m_stack.pushFrame(callFrame, newCodeBlock, scope, argsCount, constructor);
    11701177    if (UNLIKELY(!newCallFrame))
     
    11801187
    11811188    JSValue result;
    1182     if (LIKELY(!vm.watchdog.didFire(newCallFrame))) {
     1189    {
    11831190        SamplingTool::CallRecord callRecord(m_sampler.get(), !isJSConstruct);
    11841191        Watchdog::Scope watchdogScope(vm.watchdog);
     
    11931200        } else
    11941201            result = JSValue::decode(constructData.native.function(newCallFrame));
    1195     } else
    1196         result = throwTerminatedExecutionException(newCallFrame);
     1202    }
    11971203
    11981204    if (LegacyProfiler* profiler = vm.enabledProfiler())
     
    12651271    if (LegacyProfiler* profiler = vm.enabledProfiler())
    12661272        profiler->willExecute(closure.oldCallFrame, closure.function);
     1273
     1274    if (UNLIKELY(vm.watchdog.didFire(closure.oldCallFrame)))
     1275        return throwTerminatedExecutionException(closure.oldCallFrame);
    12671276
    12681277    // The code execution below may push more frames and point the topCallFrame
     
    12781287    // Execute the code:
    12791288    JSValue result;
    1280     if (LIKELY(!vm.watchdog.didFire(closure.newCallFrame))) {
     1289    {
    12811290        SamplingTool::CallRecord callRecord(m_sampler.get());
    12821291        Watchdog::Scope watchdogScope(vm.watchdog);
     
    12871296        result = closure.functionExecutable->generatedJITCodeForCall().execute(&m_stack, closure.newCallFrame, &vm);
    12881297#endif // ENABLE(JIT)
    1289     } else
    1290         result = throwTerminatedExecutionException(closure.newCallFrame);
     1298    }
    12911299
    12921300    if (LegacyProfiler* profiler = vm.enabledProfiler())
     
    13621370    }
    13631371
     1372    if (UNLIKELY(vm.watchdog.didFire(callFrame)))
     1373        return throwTerminatedExecutionException(callFrame);
     1374
    13641375    // Push the frame:
    13651376    ASSERT(codeBlock->numParameters() == 1); // 1 parameter for 'this'.
     
    13761387    // Execute the code:
    13771388    JSValue result;
    1378     if (LIKELY(!vm.watchdog.didFire(newCallFrame))) {
     1389    {
    13791390        SamplingTool::CallRecord callRecord(m_sampler.get());
    13801391        Watchdog::Scope watchdogScope(vm.watchdog);
     
    13851396        result = eval->generatedJITCode().execute(&m_stack, newCallFrame, &vm);
    13861397#endif // ENABLE(JIT)
    1387     } else
    1388         result = throwTerminatedExecutionException(newCallFrame);
     1398    }
    13891399
    13901400    if (LegacyProfiler* profiler = vm.enabledProfiler())
Note: See TracChangeset for help on using the changeset viewer.