Bug 1468750 - add 'trackAttached' method to 'GetIteratorIRGenerator' class. r=mgaudet
authorPetru Gurita <petru.gurita1@gmail.com>
Thu, 28 Jun 2018 23:56:17 +0300
changeset 424899 aaf899a79269
parent 424898 6e281abe4d39
child 424900 604fb83b6b61
push id34226
push userrgurzau@mozilla.com
push dateWed, 04 Jul 2018 09:57:31 +0000
treeherdermozilla-central@3d7f2fdc5bf7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmgaudet
bugs1468750
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1468750 - add 'trackAttached' method to 'GetIteratorIRGenerator' class. r=mgaudet Added method 'trackAttached' to the class 'GetIteratorIRGenerator' and implemented it accordingly. MozReview-Commit-ID: CRLXFaOfgZD
js/src/jit/CacheIR.cpp
js/src/jit/CacheIR.h
--- a/js/src/jit/CacheIR.cpp
+++ b/js/src/jit/CacheIR.cpp
@@ -4348,19 +4348,22 @@ GetIteratorIRGenerator::tryAttachStub()
 
     ValOperandId valId(writer.setInputOperandId(0));
     if (!val_.isObject())
         return false;
 
     RootedObject obj(cx_, &val_.toObject());
 
     ObjOperandId objId = writer.guardIsObject(valId);
-    if (tryAttachNativeIterator(objId, obj))
-        return true;
-
+    if (tryAttachNativeIterator(objId, obj)) {
+      trackAttached("GetIterator");
+      return true;
+    }
+
+    trackAttached(IRGenerator::NotAttached);
     return false;
 }
 
 bool
 GetIteratorIRGenerator::tryAttachNativeIterator(ObjOperandId objId, HandleObject obj)
 {
     MOZ_ASSERT(JSOp(*pc_) == JSOP_ITER);
 
@@ -4386,16 +4389,26 @@ GetIteratorIRGenerator::tryAttachNativeI
     ObjOperandId iterId =
         writer.guardAndGetIterator(objId, iterobj, &ObjectRealm::get(obj).enumerators);
     writer.loadObjectResult(iterId);
     writer.returnFromIC();
 
     return true;
 }
 
+void
+GetIteratorIRGenerator::trackAttached(const char* name)
+{
+#ifdef JS_CACHEIR_SPEW
+    if (const CacheIRSpewer::Guard& sp = CacheIRSpewer::Guard(*this, name)) {
+        sp.valueProperty("val", val_);
+    }
+#endif
+}
+
 CallIRGenerator::CallIRGenerator(JSContext* cx, HandleScript script, jsbytecode* pc, JSOp op,
                                  ICState::Mode mode, uint32_t argc,
                                  HandleValue callee, HandleValue thisval, HandleValueArray args)
   : IRGenerator(cx, script, pc, CacheKind::Call, mode),
     op_(op),
     argc_(argc),
     callee_(callee),
     thisval_(thisval),
--- a/js/src/jit/CacheIR.h
+++ b/js/src/jit/CacheIR.h
@@ -1663,16 +1663,18 @@ class MOZ_RAII GetIteratorIRGenerator : 
 
     bool tryAttachNativeIterator(ObjOperandId objId, HandleObject obj);
 
   public:
     GetIteratorIRGenerator(JSContext* cx, HandleScript, jsbytecode* pc, ICState::Mode mode,
                            HandleValue value);
 
     bool tryAttachStub();
+
+    void trackAttached(const char *name);
 };
 
 class MOZ_RAII CallIRGenerator : public IRGenerator
 {
   private:
     JSOp op_;
     uint32_t argc_;
     HandleValue callee_;