]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - ftl/FTLState.cpp
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / ftl / FTLState.cpp
index 32944d6b433fb99db203e9d5be9bc34a1faaca28..038e9b11098f6436be5d98d092b70e00078859f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 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
 #include "FTLForOSREntryJITCode.h"
 #include "FTLJITCode.h"
 #include "FTLJITFinalizer.h"
+#include <llvm/InitializeLLVM.h>
+#include <stdio.h>
+
+#if ENABLE(FTL_NATIVE_CALL_INLINING)
+#include "InlineRuntimeSymbolTable.h"
+#endif
 
 namespace JSC { namespace FTL {
 
@@ -43,9 +49,21 @@ State::State(Graph& graph)
     , module(0)
     , function(0)
     , generatedFunction(0)
-    , compactUnwind(0)
-    , compactUnwindSize(0)
+    , handleStackOverflowExceptionStackmapID(UINT_MAX)
+    , handleExceptionStackmapID(UINT_MAX)
+    , capturedStackmapID(UINT_MAX)
+    , varargsSpillSlotsStackmapID(UINT_MAX)
+    , unwindDataSection(0)
+    , unwindDataSectionSize(0)
 {
+
+#if ENABLE(FTL_NATIVE_CALL_INLINING)
+#define SYMBOL_TABLE_ADD(symbol, file) \
+    symbolTable.fastAdd(symbol, file);
+    FOR_EACH_LIBRARY_SYMBOL(SYMBOL_TABLE_ADD)
+#undef SYMBOL_TABLE_ADD
+#endif
+    
     switch (graph.m_plan.mode) {
     case FTLMode: {
         jitCode = adoptRef(new JITCode());
@@ -62,9 +80,9 @@ State::State(Graph& graph)
         RELEASE_ASSERT_NOT_REACHED();
         break;
     }
-    
-    finalizer = new JITFinalizer(graph.m_plan);
-    graph.m_plan.finalizer = adoptPtr(finalizer);
+
+    graph.m_plan.finalizer = std::make_unique<JITFinalizer>(graph.m_plan);
+    finalizer = static_cast<JITFinalizer*>(graph.m_plan.finalizer.get());
 }
 
 State::~State()
@@ -73,6 +91,11 @@ State::~State()
 }
 
 void State::dumpState(const char* when)
+{
+    dumpState(module, when);
+}
+
+void State::dumpState(LModule module, const char* when)
 {
     dataLog("LLVM IR for ", CodeBlockWithJITType(graph.m_codeBlock, FTL::JITCode::FTLJIT), " ", when, ":\n");
     dumpModule(module);