зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
a747eb3f2c
Коммит
d489d17c87
|
@ -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) ]))),
|
||||
])
|
||||
])
|
||||
)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче