Bug 1322443 - TraceLogging: Report irregexp execution in Ion, r=bbouvier
authorHannes Verschore <hv1989@gmail.com>
Thu, 08 Dec 2016 13:56:11 -1000
changeset 325460 8faf0055fb54eb3b5394b5a92e7fbc121a0897b5
parent 325459 2f96ca59484d38b4b6d2f3aca283001bc7f01029
child 325461 5cebfb1902a202b578c35d65575096348cdedf2b
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersbbouvier
bugs1322443
milestone53.0a1
Bug 1322443 - TraceLogging: Report irregexp execution in Ion, r=bbouvier
js/src/jit/CodeGenerator.cpp
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -1174,24 +1174,41 @@ PrepareAndExecuteRegExp(JSContext* cx, M
     LiveGeneralRegisterSet volatileRegs;
     if (lastIndex.volatile_())
         volatileRegs.add(lastIndex);
     if (input.volatile_())
         volatileRegs.add(input);
     if (regexp.volatile_())
         volatileRegs.add(regexp);
 
+#ifdef JS_TRACE_LOGGING
+    TraceLoggerThread* logger = TraceLoggerForMainThread(cx->runtime());
+    if (TraceLogTextIdEnabled(TraceLogger_IrregexpExecute)) {
+        masm.push(temp1);
+        masm.movePtr(ImmPtr(logger), temp1);
+        masm.tracelogStartId(temp1, TraceLogger_IrregexpExecute);
+        masm.pop(temp1);
+    }
+#endif
+
     // Execute the RegExp.
     masm.computeEffectiveAddress(Address(masm.getStackPointer(), inputOutputDataStartOffset), temp2);
     masm.PushRegsInMask(volatileRegs);
     masm.setupUnalignedABICall(temp3);
     masm.passABIArg(temp2);
     masm.callWithABI(codePointer);
     masm.PopRegsInMask(volatileRegs);
 
+#ifdef JS_TRACE_LOGGING
+    if (TraceLogTextIdEnabled(TraceLogger_IrregexpExecute)) {
+        masm.movePtr(ImmPtr(logger), temp1);
+        masm.tracelogStopId(temp1, TraceLogger_IrregexpExecute);
+    }
+#endif
+
     Label success;
     masm.branch32(Assembler::Equal, matchResultAddress,
                   Imm32(RegExpRunStatus_Success_NotFound), notFound);
     masm.branch32(Assembler::Equal, matchResultAddress,
                   Imm32(RegExpRunStatus_Error), failure);
 
     // Lazily update the RegExpStatics.
     masm.movePtr(ImmPtr(res), temp1);