zoukankan      html  css  js  c++  java
  • What's Dead & Exploded in Swift's exception stack?

    The Swift compiler marks function arguments for a number of reasons, mostly related to internal optimizations. For your question, we'll focus on the mangler, as that's what's contributing to your pretty stack trace, and the Node Printer. As of the time of this post, the function specialization mangler has 6 marks it can apply to an argument:

    • Dead

      The argument is unused in the function body and can be removed in a dead argument elimination pass.

    • Closure

      The argument is a closure and may require further mangling/demangling.

    • Constant

      The argument is a constant.

    • Owned to Guaranteed

      A caller-owned argument transfers ownership to the callee. The argument thus has a strong reference associated with it [the caller] and is guaranteed to live through the call, so the compiler allows the caller to elide the transfer and instead aggregate retains itself.

    • SROA

      Scalar Replacement of Aggregates pass should optimize this argument.

    • In Out To Value

      The parameter was marked inout but the callee doesn't actually mutate it.

    The AST Node Printer adds one more mark

    • Exploded

      The value comes with an explosion schema that has been realized when the call was made.

    For all intents and purposes we only care about DeadOwned to Guaranteed, and Exploded

    The only one that may still seem mystifying is Exploded. An Explosion is an optimization construct the Swift compiler uses to determine a strategy to unpack values from small structs and enums into registers. Thus, when the Node Printer says a value is Exploded, what it means it has already unpacked the value into registers before the call.

    https://stackoverflow.com/questions/30764669/whats-dead-exploded-in-swifts-exception-stack

  • 相关阅读:
    php 多进程
    关于TP的RBAC的使用
    谈谈自己对于Auth2.0的见解
    php 写队列
    关于thinkphp中Hook钩子的解析
    JS的闭包
    单链表的查找和取值-1
    shell输入输出重定向
    转-Visual Studio控制台程序输出窗口一闪而过的解决方法
    linux下如何调用不同目录下的.h 库文件
  • 原文地址:https://www.cnblogs.com/feng9exe/p/9046625.html
Copyright © 2011-2022 走看看