diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/ftl/FTLState.cpp | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/ftl/FTLState.cpp')
-rw-r--r-- | Source/JavaScriptCore/ftl/FTLState.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/Source/JavaScriptCore/ftl/FTLState.cpp b/Source/JavaScriptCore/ftl/FTLState.cpp index d62433700..c263b264b 100644 --- a/Source/JavaScriptCore/ftl/FTLState.cpp +++ b/Source/JavaScriptCore/ftl/FTLState.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013, 2015-2016 Apple Inc. All rights reserved. + * Copyright (C) 2013 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_numCalleeLocals); + code->initializeEntryBuffer(graph.m_vm, graph.m_profiledBlock->m_numCalleeRegisters); code->setBytecodeIndex(graph.m_plan.osrEntryBytecodeIndex); jitCode = code; break; @@ -60,22 +60,20 @@ State::State(Graph& graph) RELEASE_ASSERT_NOT_REACHED(); break; } - - 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); + + finalizer = new JITFinalizer(graph.m_plan); + graph.m_plan.finalizer = adoptPtr(finalizer); } State::~State() { + llvm->ContextDispose(context); +} + +void State::dumpState(const char* when) +{ + dataLog("LLVM IR for ", CodeBlockWithJITType(graph.m_codeBlock, FTL::JITCode::FTLJIT), " ", when, ":\n"); + dumpModule(module); } } } // namespace JSC::FTL |