mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
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:
parent
a747eb3f2c
commit
d489d17c87
@ -4457,12 +4457,18 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
|||||||
self.profilerLabel(md) ]
|
self.profilerLabel(md) ]
|
||||||
+ self.transition(md, actor)
|
+ self.transition(md, actor)
|
||||||
+ [ Whitespace.NL,
|
+ [ Whitespace.NL,
|
||||||
StmtDecl(
|
StmtDecl(Decl(Type.BOOL, sendok.name)),
|
||||||
Decl(Type.BOOL, sendok.name),
|
StmtBlock([
|
||||||
init=ExprCall(ExprSelect(self.protocol.callGetChannel(actor),
|
StmtDecl(Decl(Type('GeckoProfilerTracingRAII'),
|
||||||
'->',
|
'syncIPCTracer'),
|
||||||
_sendPrefix(md.decl.type)),
|
initargs=[ ExprLiteral.String("IPC"),
|
||||||
args=[ msgexpr, ExprAddrOf(replyexpr) ]))
|
ExprLiteral.String(self.protocol.name + "::" + md.prettyMsgName()) ]),
|
||||||
|
StmtExpr(ExprAssn(sendok,
|
||||||
|
ExprCall(ExprSelect(self.protocol.callGetChannel(actor),
|
||||||
|
'->',
|
||||||
|
_sendPrefix(md.decl.type)),
|
||||||
|
args=[ msgexpr, ExprAddrOf(replyexpr) ]))),
|
||||||
|
])
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user