Changeset 74454 in webkit for trunk/JavaScriptCore/debugger


Ignore:
Timestamp:
Dec 21, 2010, 8:18:58 PM (14 years ago)
Author:
[email protected]
Message:

Reviewed by Geoff Garen.


<rdar://problem/8765333> CRASH running out of executable memory, loading io9.com
https://bugs.webkit.org/show_bug.cgi?id=51443

The problem here is that each page uses a reasonable amount of memory, (~4Mb),
and that when miultiple pages are open we keep all JIT code for all functions
in all pages alive.

Add a check to detect high memory pressure situations in the executable allocator
(>50% of available memory allocated), and upon a top level entry into JSC (no code
running on the stack) in this situation throw away all JIT code.

(JSC::Debugger::recompileAllJSFunctions): stop passing exec to recompile.

  • jit/ExecutableAllocator.h:
  • jit/ExecutableAllocatorFixedVMPool.cpp:

(JSC::ExecutablePool::systemAlloc): Count allocations.
(JSC::ExecutablePool::systemRelease): Count deallocations.
(JSC::ExecutablePool::underMemoryPressure): Check memory pressure.

  • jit/ExecutableAllocatorPosix.cpp:

(JSC::ExecutablePool::underMemoryPressure): Stub out; only meaningful with FixedVMPool.

  • jit/ExecutableAllocatorWin.cpp:

(JSC::ExecutablePool::underMemoryPressure): Stub out; only meaningful with FixedVMPool.

  • runtime/Executable.cpp:

(JSC::FunctionExecutable::recompile): Remove ExecState argument to recompile.

  • runtime/Executable.h:
  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::recompileAllJSFunctions): throws away all JIT code.

  • runtime/JSGlobalData.h:
  • runtime/JSGlobalObject.h:

(JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): add check / call to throw away.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/debugger/Debugger.cpp

    r70703 r74454  
    8686
    8787        ExecState* exec = function->scope().globalObject()->JSGlobalObject::globalExec();
    88         executable->recompile(exec);
     88        executable->discardCode();
    8989        if (function->scope().globalObject()->debugger() == this)
    9090            sourceProviders.add(executable->source().provider(), exec);
Note: See TracChangeset for help on using the changeset viewer.