Bug 1322553 - part 3 - add profiler start/end markers for sync IPC; r=mstange

This is gnarly IPDL code, but the generated code is probably easier to
review.  Before when sending a sync message, we had:

    bool sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
    if ((!(sendok__))) {
        return false;
    }

Now, we have:

    bool sendok__;
    {
        GeckoProfilerTracingRAII syncIPCTracer(
                "IPC",
                "PJavaScript::Msg_PreventExtensions");
        sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
    }
    if ((!(sendok__))) {
        return false;
    }
This commit is contained in:
Nathan Froyd 2017-01-07 15:56:49 -05:00
parent a747eb3f2c
commit d489d17c87

View File

@ -4457,12 +4457,18 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
self.profilerLabel(md) ]
+ self.transition(md, actor)
+ [ Whitespace.NL,
StmtDecl(
Decl(Type.BOOL, sendok.name),
init=ExprCall(ExprSelect(self.protocol.callGetChannel(actor),
'->',
_sendPrefix(md.decl.type)),
args=[ msgexpr, ExprAddrOf(replyexpr) ]))
StmtDecl(Decl(Type.BOOL, sendok.name)),
StmtBlock([
StmtDecl(Decl(Type('GeckoProfilerTracingRAII'),
'syncIPCTracer'),
initargs=[ ExprLiteral.String("IPC"),
ExprLiteral.String(self.protocol.name + "::" + md.prettyMsgName()) ]),
StmtExpr(ExprAssn(sendok,
ExprCall(ExprSelect(self.protocol.callGetChannel(actor),
'->',
_sendPrefix(md.decl.type)),
args=[ msgexpr, ExprAddrOf(replyexpr) ]))),
])
])
)