Title: [164456] trunk/Source/_javascript_Core
Revision
164456
Author
[email protected]
Date
2014-02-20 16:00:12 -0800 (Thu, 20 Feb 2014)

Log Message

FTL may not see a compact_unwind section if there weren't any stackmaps
https://bugs.webkit.org/show_bug.cgi?id=129125

Reviewed by Geoffrey Garen.
        
It's OK to not have an unwind section, so long as the function also doesn't have any
OSR exits.

* ftl/FTLCompile.cpp:
(JSC::FTL::fixFunctionBasedOnStackMaps):
(JSC::FTL::compile):
* ftl/FTLUnwindInfo.cpp:
(JSC::FTL::UnwindInfo::parse):
* ftl/FTLUnwindInfo.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (164455 => 164456)


--- trunk/Source/_javascript_Core/ChangeLog	2014-02-20 23:46:18 UTC (rev 164455)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-02-21 00:00:12 UTC (rev 164456)
@@ -1 +1,18 @@
+2014-02-20  Filip Pizlo  <[email protected]>
+
+        FTL may not see a compact_unwind section if there weren't any stackmaps
+        https://bugs.webkit.org/show_bug.cgi?id=129125
+
+        Reviewed by Geoffrey Garen.
+        
+        It's OK to not have an unwind section, so long as the function also doesn't have any
+        OSR exits.
+
+        * ftl/FTLCompile.cpp:
+        (JSC::FTL::fixFunctionBasedOnStackMaps):
+        (JSC::FTL::compile):
+        * ftl/FTLUnwindInfo.cpp:
+        (JSC::FTL::UnwindInfo::parse):
+        * ftl/FTLUnwindInfo.h:
+
 == Rolled over to ChangeLog-2014-02-20 ==

Modified: trunk/Source/_javascript_Core/ftl/FTLCompile.cpp (164455 => 164456)


--- trunk/Source/_javascript_Core/ftl/FTLCompile.cpp	2014-02-20 23:46:18 UTC (rev 164455)
+++ trunk/Source/_javascript_Core/ftl/FTLCompile.cpp	2014-02-21 00:00:12 UTC (rev 164456)
@@ -164,7 +164,7 @@
 
 static void fixFunctionBasedOnStackMaps(
     State& state, CodeBlock* codeBlock, JITCode* jitCode, GeneratedFunction generatedFunction,
-    StackMaps::RecordMap& recordMap)
+    StackMaps::RecordMap& recordMap, bool didSeeUnwindInfo)
 {
     Graph& graph = state.graph;
     VM& vm = graph.m_vm;
@@ -236,10 +236,13 @@
     ExitThunkGenerator exitThunkGenerator(state);
     exitThunkGenerator.emitThunks();
     if (exitThunkGenerator.didThings()) {
+        RELEASE_ASSERT(state.finalizer->osrExit.size());
+        RELEASE_ASSERT(didSeeUnwindInfo);
+        
         OwnPtr<LinkBuffer> linkBuffer = adoptPtr(new LinkBuffer(
             vm, &exitThunkGenerator, codeBlock, JITCompilationMustSucceed));
         
-        ASSERT(state.finalizer->osrExit.size() == state.jitCode->osrExit.size());
+        RELEASE_ASSERT(state.finalizer->osrExit.size() == state.jitCode->osrExit.size());
         
         for (unsigned i = 0; i < state.jitCode->osrExit.size(); ++i) {
             OSRExitCompilationInfo& info = state.finalizer->osrExit[i];
@@ -573,10 +576,15 @@
         }
     }
     
-    state.jitCode->unwindInfo.parse(
+    bool didSeeUnwindInfo = state.jitCode->unwindInfo.parse(
         state.compactUnwind, state.compactUnwindSize, state.generatedFunction);
-    if (shouldShowDisassembly())
-        dataLog("Unwind info for ", CodeBlockWithJITType(state.graph.m_codeBlock, JITCode::FTLJIT), ":\n    ", state.jitCode->unwindInfo, "\n");
+    if (shouldShowDisassembly()) {
+        dataLog("Unwind info for ", CodeBlockWithJITType(state.graph.m_codeBlock, JITCode::FTLJIT), ":\n");
+        if (didSeeUnwindInfo)
+            dataLog("    ", state.jitCode->unwindInfo, "\n");
+        else
+            dataLog("    <no unwind info>\n");
+    }
     
     if (state.stackmapsSection && state.stackmapsSection->size()) {
         if (shouldShowDisassembly()) {
@@ -599,7 +607,7 @@
         StackMaps::RecordMap recordMap = state.jitCode->stackmaps.computeRecordMap();
         fixFunctionBasedOnStackMaps(
             state, state.graph.m_codeBlock, state.jitCode.get(), state.generatedFunction,
-            recordMap);
+            recordMap, didSeeUnwindInfo);
         
         if (shouldShowDisassembly()) {
             for (unsigned i = 0; i < state.jitCode->handles().size(); ++i) {

Modified: trunk/Source/_javascript_Core/ftl/FTLUnwindInfo.cpp (164455 => 164456)


--- trunk/Source/_javascript_Core/ftl/FTLUnwindInfo.cpp	2014-02-20 23:46:18 UTC (rev 164455)
+++ trunk/Source/_javascript_Core/ftl/FTLUnwindInfo.cpp	2014-02-21 00:00:12 UTC (rev 164456)
@@ -48,11 +48,14 @@
 
 } // anonymous namespace
 
-void UnwindInfo::parse(void* section, size_t size, GeneratedFunction generatedFunction)
+bool UnwindInfo::parse(void* section, size_t size, GeneratedFunction generatedFunction)
 {
     m_registers.clear();
     
-    RELEASE_ASSERT(section);
+    RELEASE_ASSERT(!!section == !!size);
+    if (!section)
+        return false;
+    
     RELEASE_ASSERT(size >= sizeof(CompactUnwind));
     
     CompactUnwind* data = ""
@@ -156,6 +159,7 @@
 #endif
     
     std::sort(m_registers.begin(), m_registers.end());
+    return true;
 }
 
 void UnwindInfo::dump(PrintStream& out) const

Modified: trunk/Source/_javascript_Core/ftl/FTLUnwindInfo.h (164455 => 164456)


--- trunk/Source/_javascript_Core/ftl/FTLUnwindInfo.h	2014-02-20 23:46:18 UTC (rev 164455)
+++ trunk/Source/_javascript_Core/ftl/FTLUnwindInfo.h	2014-02-21 00:00:12 UTC (rev 164456)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -37,7 +37,7 @@
     UnwindInfo();
     ~UnwindInfo();
     
-    void parse(void*, size_t, GeneratedFunction);
+    bool parse(void*, size_t, GeneratedFunction);
     
     void dump(PrintStream&) const;
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to