Exemple #1
0
VMEntryScope::VMEntryScope(VM& vm, JSGlobalObject* globalObject)
    : m_vm(vm)
    , m_globalObject(globalObject)
{
    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();

        if (vm.watchdog)
            vm.watchdog->enteredVM();
    }

    vm.clearLastException();
}
VMEntryScope::VMEntryScope(VM& vm, JSGlobalObject* globalObject)
    : m_vm(vm)
    , m_globalObject(globalObject)
{
    ASSERT(wtfThreadData().stack().isGrowingDownward());
    if (!vm.entryScope) {
        vm.entryScope = this;

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

        if (vm.watchdog())
            vm.watchdog()->enteredVM();

#if ENABLE(SAMPLING_PROFILER)
        if (SamplingProfiler* samplingProfiler = vm.samplingProfiler())
            samplingProfiler->noticeVMEntry();
#endif
    }

    vm.clearLastException();
}