From 6882a04fb36642862b11efe514251d32070c3d65 Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Thu, 25 Aug 2016 19:20:41 +0300 Subject: Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443) Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev --- Source/JavaScriptCore/dfg/DFGJITCompiler.cpp | 615 +++++++++++++++++++-------- 1 file changed, 436 insertions(+), 179 deletions(-) (limited to 'Source/JavaScriptCore/dfg/DFGJITCompiler.cpp') diff --git a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp b/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp index 2ba9ea709..758f5cdd4 100644 --- a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp +++ b/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011, 2013 Apple Inc. All rights reserved. + * Copyright (C) 2011, 2013-2015 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,6 +29,10 @@ #if ENABLE(DFG_JIT) #include "CodeBlock.h" +#include "DFGFailedFinalizer.h" +#include "DFGInlineCacheWrapperInlines.h" +#include "DFGJITCode.h" +#include "DFGJITFinalizer.h" #include "DFGOSRExitCompiler.h" #include "DFGOperations.h" #include "DFGRegisterBank.h" @@ -36,45 +40,53 @@ #include "DFGSpeculativeJIT.h" #include "DFGThunks.h" #include "JSCJSValueInlines.h" -#include "VM.h" #include "LinkBuffer.h" +#include "MaxFrameExtentForSlowPathCall.h" +#include "JSCInlines.h" +#include "VM.h" namespace JSC { namespace DFG { JITCompiler::JITCompiler(Graph& dfg) : CCallHelpers(&dfg.m_vm, dfg.m_codeBlock) , m_graph(dfg) - , m_currentCodeOriginIndex(0) + , m_jitCode(adoptRef(new JITCode())) + , m_blockHeads(dfg.numBlocks()) + , m_pcToCodeOriginMapBuilder(dfg.m_vm) +{ + if (shouldDumpDisassembly() || m_graph.m_vm.m_perBytecodeProfiler) + m_disassembler = std::make_unique(dfg); +} + +JITCompiler::~JITCompiler() { - if (shouldShowDisassembly() || m_graph.m_vm.m_perBytecodeProfiler) - m_disassembler = adoptPtr(new Disassembler(dfg)); } void JITCompiler::linkOSRExits() { - ASSERT(codeBlock()->numberOfOSRExits() == m_exitCompilationInfo.size()); - if (m_graph.m_compilation) { - for (unsigned i = 0; i < codeBlock()->numberOfOSRExits(); ++i) { - OSRExit& exit = codeBlock()->osrExit(i); + ASSERT(m_jitCode->osrExit.size() == m_exitCompilationInfo.size()); + if (m_graph.compilation()) { + for (unsigned i = 0; i < m_jitCode->osrExit.size(); ++i) { + OSRExitCompilationInfo& info = m_exitCompilationInfo[i]; Vector