diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/ftl/FTLState.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/JavaScriptCore/ftl/FTLState.cpp')
-rw-r--r-- | Source/JavaScriptCore/ftl/FTLState.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/Source/JavaScriptCore/ftl/FTLState.cpp b/Source/JavaScriptCore/ftl/FTLState.cpp index c263b264b..d62433700 100644 --- a/Source/JavaScriptCore/ftl/FTLState.cpp +++ b/Source/JavaScriptCore/ftl/FTLState.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2013, 2015-2016 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,16 +32,16 @@ #include "FTLForOSREntryJITCode.h" #include "FTLJITCode.h" #include "FTLJITFinalizer.h" +#include "FTLPatchpointExceptionHandle.h" +#include <stdio.h> namespace JSC { namespace FTL { +using namespace B3; using namespace DFG; State::State(Graph& graph) : graph(graph) - , context(llvm->ContextCreate()) - , module(0) - , function(0) , generatedFunction(0) { switch (graph.m_plan.mode) { @@ -51,7 +51,7 @@ State::State(Graph& graph) } case FTLForOSREntryMode: { RefPtr<ForOSREntryJITCode> code = adoptRef(new ForOSREntryJITCode()); - code->initializeEntryBuffer(graph.m_vm, graph.m_profiledBlock->m_numCalleeRegisters); + code->initializeEntryBuffer(graph.m_vm, graph.m_profiledBlock->m_numCalleeLocals); code->setBytecodeIndex(graph.m_plan.osrEntryBytecodeIndex); jitCode = code; break; @@ -60,20 +60,22 @@ State::State(Graph& graph) RELEASE_ASSERT_NOT_REACHED(); break; } - - finalizer = new JITFinalizer(graph.m_plan); - graph.m_plan.finalizer = adoptPtr(finalizer); -} -State::~State() -{ - llvm->ContextDispose(context); + graph.m_plan.finalizer = std::make_unique<JITFinalizer>(graph.m_plan); + finalizer = static_cast<JITFinalizer*>(graph.m_plan.finalizer.get()); + + proc = std::make_unique<Procedure>(); + + proc->setOriginPrinter( + [this] (PrintStream& out, B3::Origin origin) { + out.print("DFG:", bitwise_cast<Node*>(origin.data())); + }); + + proc->setFrontendData(&graph); } -void State::dumpState(const char* when) +State::~State() { - dataLog("LLVM IR for ", CodeBlockWithJITType(graph.m_codeBlock, FTL::JITCode::FTLJIT), " ", when, ":\n"); - dumpModule(module); } } } // namespace JSC::FTL |