From 32761a6cee1d0dee366b885b7b9c777e67885688 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Sun, 10 Apr 2016 09:28:39 +0000 Subject: webkitgtk-2.4.11 --- Source/JavaScriptCore/ftl/FTLState.cpp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'Source/JavaScriptCore/ftl/FTLState.cpp') 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 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 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(graph.m_plan); - finalizer = static_cast(graph.m_plan.finalizer.get()); - - proc = std::make_unique(); - - proc->setOriginPrinter( - [this] (PrintStream& out, B3::Origin origin) { - out.print("DFG:", bitwise_cast(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 -- cgit v1.2.1