Merge mozilla-central to mozilla-inbound
authorEd Morley <emorley@mozilla.com>
Fri, 28 Sep 2012 16:01:22 +0100
changeset 108599 7d4e659d6fbfb3cdfa7431377d1d710c3dcc64d9
parent 108598 afd0781795631bab4018172ff5fd405792fc4fff (current diff)
parent 108495 10279bd74ee0a5504ac2bfcd5efd97794f3bf6e4 (diff)
child 108600 e393ae7353c068fa8f0cacf7f714ae7ae7a3096a
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
milestone18.0a1
Merge mozilla-central to mozilla-inbound
--- a/build/valgrind/cross-architecture.sup
+++ b/build/valgrind/cross-architecture.sup
@@ -1,8 +1,10 @@
+# Full list is tracked through meta bug 793882
+
 ####################
 #  Intended leaks  #
 ####################
 
 {
    PR_SetEnv requires its argument to be leaked, but does not appear on stacks. (See bug 793534 and see bug 793549.)
    Memcheck:Leak
    ...
--- a/build/valgrind/i386-redhat-linux-gnu.sup
+++ b/build/valgrind/i386-redhat-linux-gnu.sup
@@ -1,25 +1,29 @@
+# Full list is tracked through meta bug 793882
+
 ####################################
 #  Leaks in third party libraries  #
 ####################################
+
 {
    Bug 793537
    Memcheck:Leak
    ...
    obj:/usr/lib/libpango-1.0.so.0.2800.1
    ...
 }
-{
-   Bug 793539 which may be fixed or change when bug 713802 is fixed
-   Memcheck:Leak
-   ...
-   obj:/usr/lib/libgnomevfs-2.so.0.2400.2
-   ...
-}
+#{
+#   Bug 713802 now seems fixed, commenting out suppression to verify that bug 793539 is also gone
+#   Bug 793539 which may be fixed or change when bug 713802 is fixed
+#   Memcheck:Leak
+#   ...
+#   obj:/usr/lib/libgnomevfs-2.so.0.2400.2
+#   ...
+#}
 {
    Bug 793598
    Memcheck:Leak
    ...
    obj:/lib/libdbus-1.so.3.4.0
    ...
 }
 {
--- a/build/valgrind/x86_64-redhat-linux-gnu.sup
+++ b/build/valgrind/x86_64-redhat-linux-gnu.sup
@@ -1,25 +1,29 @@
+# Full list is tracked through meta bug 793882
+
 ####################################
 #  Leaks in third party libraries  #
 ####################################
+
 {
    Bug 793537
    Memcheck:Leak
    ...
    obj:/usr/lib64/libpango-1.0.so.0.2800.1
    ...
 }
-{
-   Bug 793539 which may be fixed or change when bug 713802 is fixed
-   Memcheck:Leak
-   ...
-   obj:/usr/lib64/libgnomevfs-2.so.0.2400.2
-   ...
-}
+#{
+#   Bug 713802 now seems fixed, commenting out suppression to verify that bug 793539 is also gone
+#   Bug 793539 which may be fixed or change when bug 713802 is fixed
+#   Memcheck:Leak
+#   ...
+#   obj:/usr/lib64/libgnomevfs-2.so.0.2400.2
+#   ...
+#}
 {
    Bug 793598
    Memcheck:Leak
    ...
    obj:/lib64/libdbus-1.so.3.4.0
    ...
 }
 {
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -6394,17 +6394,18 @@ nsDocument::PreHandleEvent(nsEventChainP
   aVisitor.mCanHandle = true;
    // FIXME! This is a hack to make middle mouse paste working also in Editor.
    // Bug 329119
   aVisitor.mForceContentDispatch = true;
 
   // Load events must not propagate to |window| object, see bug 335251.
   if (aVisitor.mEvent->message != NS_LOAD) {
     nsGlobalWindow* window = static_cast<nsGlobalWindow*>(GetWindow());
-    aVisitor.mParentTarget = static_cast<nsIDOMEventTarget*>(window);
+    aVisitor.mParentTarget =
+      window ? window->GetTargetForEventTargetChain() : nullptr;
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocument::CreateEvent(const nsAString& aEventType, nsIDOMEvent** aReturn)
 {
   NS_ENSURE_ARG_POINTER(aReturn);
--- a/content/events/src/nsEventDispatcher.cpp
+++ b/content/events/src/nsEventDispatcher.cpp
@@ -221,19 +221,19 @@ public:
   static uint32_t                   sCurrentEtciCount;
 };
 
 uint32_t nsEventTargetChainItem::sMaxEtciCount = 0;
 uint32_t nsEventTargetChainItem::sCurrentEtciCount = 0;
 
 nsEventTargetChainItem::nsEventTargetChainItem(nsIDOMEventTarget* aTarget,
                                                nsEventTargetChainItem* aChild)
-: mChild(aChild), mParent(nullptr), mFlags(0), mItemFlags(0)
+: mTarget(aTarget), mChild(aChild), mParent(nullptr), mFlags(0), mItemFlags(0)
 {
-  mTarget = aTarget->GetTargetForEventTargetChain();
+  MOZ_ASSERT(!aTarget || mTarget == aTarget->GetTargetForEventTargetChain());
   if (mChild) {
     mChild->mParent = this;
   }
 
   if (++sCurrentEtciCount > sMaxEtciCount) {
     sMaxEtciCount = sCurrentEtciCount;
   }
 }
@@ -528,17 +528,18 @@ nsEventDispatcher::Dispatch(nsISupports*
   // If we have a PresContext, make sure it doesn't die before
   // event dispatching is finished.
   nsRefPtr<nsPresContext> kungFuDeathGrip(aPresContext);
   ChainItemPool pool;
   NS_ENSURE_TRUE(pool.GetPool(), NS_ERROR_OUT_OF_MEMORY);
 
   // Create the event target chain item for the event target.
   nsEventTargetChainItem* targetEtci =
-    nsEventTargetChainItem::Create(pool.GetPool(), target);
+    nsEventTargetChainItem::Create(pool.GetPool(),
+                                   target->GetTargetForEventTargetChain());
   NS_ENSURE_TRUE(targetEtci, NS_ERROR_OUT_OF_MEMORY);
   if (!targetEtci->IsValid()) {
     nsEventTargetChainItem::Destroy(pool.GetPool(), targetEtci);
     return NS_ERROR_FAILURE;
   }
 
   // Make sure that nsIDOMEvent::target and nsIDOMEvent::originalTarget
   // point to the last item in the chain.
--- a/js/src/ion/CodeGenerator.cpp
+++ b/js/src/ion/CodeGenerator.cpp
@@ -3949,21 +3949,24 @@ CodeGenerator::emitInstanceOf(LInstructi
     masm.mov(output, rhsTmp);
     masm.mov(Imm32(0), output);
 
     // Walk the prototype chain
     masm.bind(&loopPrototypeChain);
     masm.loadPtr(Address(lhsTmp, JSObject::offsetOfType()), lhsTmp);
     masm.loadPtr(Address(lhsTmp, offsetof(types::TypeObject, proto)), lhsTmp);
 
-    masm.test32(lhsTmp, lhsTmp);
+    // Bail out if we hit a lazy proto
+    masm.branch32(Assembler::Equal, lhsTmp, Imm32(1), call->entry());
+
+    masm.testPtr(lhsTmp, lhsTmp);
     masm.j(Assembler::Zero, &done);
 
     // Check lhs is equal to rhsShape
-    masm.cmp32(lhsTmp, rhsTmp);
+    masm.cmpPtr(lhsTmp, rhsTmp);
     masm.j(Assembler::NotEqual, &loopPrototypeChain);
 
     // return true
     masm.mov(Imm32(1), output);
 
     masm.bind(call->rejoin());
     masm.bind(&done);
     return true;
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/bug794947.js
@@ -0,0 +1,10 @@
+function f(o)
+{
+    print(o instanceof String);
+}
+
+var g = newGlobal();
+f(new Object());
+var o1 = g.eval('new Object()');
+var o2 = Object.create(o1);
+f(o2);
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -46,17 +46,16 @@ import java.util.regex.Pattern;
 
 abstract public class BrowserApp extends GeckoApp
                                  implements TabsPanel.TabsLayoutChangeListener,
                                             PropertyAnimator.PropertyAnimationListener {
     private static final String LOGTAG = "GeckoBrowserApp";
 
     public static BrowserToolbar mBrowserToolbar;
     private AboutHomeContent mAboutHomeContent;
-    private boolean mAboutHomeShowing;
 
     private static final int ADDON_MENU_OFFSET = 1000;
     private class MenuItemInfo {
         int id;
         String label;
         String icon;
 
         public MenuItemInfo(int id, String label, String icon) {
@@ -593,35 +592,27 @@ abstract public class BrowserApp extends
     /* About:home UI */
     void updateAboutHomeTopSites() {
         if (mAboutHomeContent == null)
             return;
 
         mAboutHomeContent.update(EnumSet.of(AboutHomeContent.UpdateFlags.TOP_SITES));
     }
 
-    private void showAboutHome() {
-        if (mAboutHomeShowing)
-            return;
-
-        mAboutHomeShowing = true;
+    public void showAboutHome() {
         Runnable r = new AboutHomeRunnable(true);
         mMainHandler.postAtFrontOfQueue(r);
     }
 
-    private void hideAboutHome() {
-        if (!mAboutHomeShowing)
-            return;
-
-        mAboutHomeShowing = false;
+    public void hideAboutHome() {
         Runnable r = new AboutHomeRunnable(false);
         mMainHandler.postAtFrontOfQueue(r);
     }
 
-    private class AboutHomeRunnable implements Runnable {
+    public class AboutHomeRunnable implements Runnable {
         boolean mShow;
         AboutHomeRunnable(boolean show) {
             mShow = show;
         }
 
         public void run() {
             mFormAssistPopup.hide();
             if (mShow) {