Esempio n. 1
0
DynamicGlobalObjectScope::DynamicGlobalObjectScope(VM& vm, JSGlobalObject* dynamicGlobalObject)
    : m_dynamicGlobalObjectSlot(vm.dynamicGlobalObject)
    , m_savedDynamicGlobalObject(m_dynamicGlobalObjectSlot)
{
    if (!m_dynamicGlobalObjectSlot) {
#if ENABLE(ASSEMBLER)
        if (ExecutableAllocator::underMemoryPressure())
            vm.heap.deleteAllCompiledCode();
#endif

        m_dynamicGlobalObjectSlot = dynamicGlobalObject;

        // Reset the date cache between JS invocations to force the VM
        // to observe time zone changes.
        vm.resetDateCache();
    }
    // Clear the exception stack between entries
    vm.clearExceptionStack();
}
Esempio n. 2
0
VMEntryScope::VMEntryScope(VM& vm, JSGlobalObject* globalObject)
    : m_vm(vm)
    , m_globalObject(globalObject)
    , m_recompilationNeeded(false)
{
    ASSERT(wtfThreadData().stack().isGrowingDownward());
    if (!vm.entryScope) {
#if ENABLE(ASSEMBLER)
        if (ExecutableAllocator::underMemoryPressure())
            vm.heap.deleteAllCompiledCode();
#endif
        vm.entryScope = this;

        // Reset the date cache between JS invocations to force the VM to
        // observe time xone changes.
        vm.resetDateCache();
    }

    // Clear the captured exception stack between entries
    vm.clearExceptionStack();
}
VMEntryScope::VMEntryScope(VM& vm, JSGlobalObject* globalObject)
    : m_vm(vm)
    , m_stack(wtfThreadData().stack())
    , m_globalObject(globalObject)
    , m_prev(vm.entryScope)
    , m_prevStackLimit(vm.stackLimit())
{
    if (!vm.entryScope) {
#if ENABLE(ASSEMBLER)
        if (ExecutableAllocator::underMemoryPressure())
            vm.heap.deleteAllCompiledCode();
#endif
        vm.entryScope = this;

        // Reset the date cache between JS invocations to force the VM to
        // observe time xone changes.
        vm.resetDateCache();
    }
    // Clear the exception stack between entries
    vm.clearExceptionStack();

    void* limit = m_stack.recursionLimit(requiredCapacity());
    vm.setStackLimit(limit);
}