Bug 94199, part 5, remove line number reading and writing as it isn't necessary, dxr does that for us, r=bz
authorNeil Deakin <neil@mozilla.com>
Thu, 03 Nov 2011 16:39:08 -0400
changeset 79701 797d8083efcac52490a8182017eea6ea52e528e7
parent 79700 b46ffd95bfd836109a7d9b8b504be14b2206271f
child 79702 f73841ef020aeb6662e3d2aaf98e116c16bfb62c
push id3103
push userneil@mozilla.com
push dateThu, 03 Nov 2011 20:41:05 +0000
treeherdermozilla-inbound@797d8083efca [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs94199
milestone10.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 94199, part 5, remove line number reading and writing as it isn't necessary, dxr does that for us, r=bz
content/xbl/src/nsXBLProtoImplMethod.cpp
content/xbl/src/nsXBLProtoImplProperty.cpp
content/xbl/src/nsXBLSerialize.cpp
content/xbl/src/nsXBLSerialize.h
--- a/content/xbl/src/nsXBLProtoImplMethod.cpp
+++ b/content/xbl/src/nsXBLProtoImplMethod.cpp
@@ -268,19 +268,17 @@ nsXBLProtoImplMethod::Trace(TraceCallbac
   }
 }
 
 nsresult
 nsXBLProtoImplMethod::Read(nsIScriptContext* aContext,
                            nsIObjectInputStream* aStream)
 {
   void* methodCode;
-  PRUint32 lineNumber;
-  nsresult rv = XBL_DeserializeFunction(aContext, aStream, this,
-                                        &lineNumber, &methodCode);
+  nsresult rv = XBL_DeserializeFunction(aContext, aStream, this, &methodCode);
   mJSMethodObject = (JSObject *)methodCode;
   if (NS_FAILED(rv)) {
     SetUncompiledMethod(nsnull);
     return rv;
   }
 
 #ifdef DEBUG
   mIsCompiled = true;
@@ -294,18 +292,17 @@ nsXBLProtoImplMethod::Write(nsIScriptCon
                             nsIObjectOutputStream* aStream)
 {
   nsresult rv = aStream->Write8(XBLBinding_Serialize_Method);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = aStream->WriteWStringZ(mName);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  // XXXndeakin fix line number
-  return XBL_SerializeFunction(aContext, aStream, mJSMethodObject, 0);
+  return XBL_SerializeFunction(aContext, aStream, mJSMethodObject);
 }
 
 nsresult
 nsXBLProtoImplAnonymousMethod::Execute(nsIContent* aBoundElement)
 {
   NS_PRECONDITION(IsCompiled(), "Can't execute uncompiled method");
   
   if (!mJSMethodObject) {
@@ -389,15 +386,14 @@ nsresult
 nsXBLProtoImplAnonymousMethod::Write(nsIScriptContext* aContext,
                                      nsIObjectOutputStream* aStream,
                                      XBLBindingSerializeDetails aType)
 {
   if (mJSMethodObject) {
     nsresult rv = aStream->Write8(aType);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    // XXXndeakin write out line number
-    rv = XBL_SerializeFunction(aContext, aStream, mJSMethodObject, 0);
+    rv = XBL_SerializeFunction(aContext, aStream, mJSMethodObject);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return NS_OK;
 }
--- a/content/xbl/src/nsXBLProtoImplProperty.cpp
+++ b/content/xbl/src/nsXBLProtoImplProperty.cpp
@@ -356,31 +356,30 @@ nsXBLProtoImplProperty::Trace(TraceCallb
 }
 
 nsresult
 nsXBLProtoImplProperty::Read(nsIScriptContext* aContext,
                              nsIObjectInputStream* aStream,
                              XBLBindingSerializeDetails aType)
 {
   nsresult rv;
-  PRUint32 lineNumber;
   void* scriptObject;
 
   if (aType == XBLBinding_Serialize_GetterProperty ||
       aType == XBLBinding_Serialize_GetterSetterProperty) {
-    rv = XBL_DeserializeFunction(aContext, aStream, this, &lineNumber, &scriptObject);
+    rv = XBL_DeserializeFunction(aContext, aStream, this, &scriptObject);
     NS_ENSURE_SUCCESS(rv, rv);
 
     mJSGetterObject = (JSObject *)scriptObject;
     mJSAttributes |= JSPROP_GETTER | JSPROP_SHARED;
   }
 
   if (aType == XBLBinding_Serialize_SetterProperty ||
       aType == XBLBinding_Serialize_GetterSetterProperty) {
-    rv = XBL_DeserializeFunction(aContext, aStream, this, &lineNumber, &scriptObject);
+    rv = XBL_DeserializeFunction(aContext, aStream, this, &scriptObject);
     NS_ENSURE_SUCCESS(rv, rv);
 
     mJSSetterObject = (JSObject *)scriptObject;
     mJSAttributes |= JSPROP_SETTER | JSPROP_SHARED;
   }
 
 #ifdef DEBUG
   mIsCompiled = true;
@@ -409,21 +408,19 @@ nsXBLProtoImplProperty::Write(nsIScriptC
   }
 
   nsresult rv = aStream->Write8(type);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = aStream->WriteWStringZ(mName);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (mJSAttributes & JSPROP_GETTER) {
-    // XXXndeakin write out line number
-    rv = XBL_SerializeFunction(aContext, aStream, mJSGetterObject, 0);
+    rv = XBL_SerializeFunction(aContext, aStream, mJSGetterObject);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   if (mJSAttributes & JSPROP_SETTER) {
-    // XXXndeakin write out line number
-    rv = XBL_SerializeFunction(aContext, aStream, mJSSetterObject, 0);
+    rv = XBL_SerializeFunction(aContext, aStream, mJSSetterObject);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return NS_OK;
 }
--- a/content/xbl/src/nsXBLSerialize.cpp
+++ b/content/xbl/src/nsXBLSerialize.cpp
@@ -38,21 +38,19 @@
 #include "nsXBLSerialize.h"
 #include "nsDOMScriptObjectHolder.h"
 #include "nsContentUtils.h"
 #include "jsxdrapi.h"
 
 nsresult
 XBL_SerializeFunction(nsIScriptContext* aContext,
                       nsIObjectOutputStream* aStream,
-                      JSObject* aFunctionObject,
-                      PRUint32 aLineNumber)
+                      JSObject* aFunctionObject)
 {
-  nsresult rv = aStream->Write32(aLineNumber);
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsresult rv;
 
   JSContext* cx = (JSContext*) aContext->GetNativeContext();
   JSXDRState *xdr = ::JS_XDRNewMem(cx, JSXDR_ENCODE);
   if (!xdr)
     return NS_ERROR_OUT_OF_MEMORY;
   xdr->userdata = (void*) aStream;
 
   jsval funval = OBJECT_TO_JSVAL(aFunctionObject);
@@ -76,29 +74,24 @@ XBL_SerializeFunction(nsIScriptContext* 
   return rv;
 }
 
 // static
 nsresult
 XBL_DeserializeFunction(nsIScriptContext* aContext,
                         nsIObjectInputStream* aStream,
                         void* aHolder,
-                        PRUint32* aLineNumber,
                         void **aScriptObject)
 {
   *aScriptObject = nsnull;
 
-  nsresult rv = aStream->Read32(aLineNumber);
-  if (NS_FAILED(rv))
-    return rv;
-
   JSObject* functionObject = nsnull;
 
   PRUint32 size;
-  rv = aStream->Read32(&size);
+  nsresult rv = aStream->Read32(&size);
   if (NS_FAILED(rv))
     return rv;
 
   char* data;
   rv = aStream->ReadBytes(size, &data);
   if (NS_FAILED(rv))
     return rv;
 
--- a/content/xbl/src/nsXBLSerialize.h
+++ b/content/xbl/src/nsXBLSerialize.h
@@ -103,19 +103,17 @@ typedef PRUint8 XBLBindingSerializeDetai
 // are no more attributes.
 #define XBLBinding_Serialize_NoMoreAttributes 0xFF
 
 PR_STATIC_ASSERT(XBLBinding_Serialize_CustomNamespace >= kNameSpaceID_LastBuiltin);
 
 nsresult
 XBL_SerializeFunction(nsIScriptContext* aContext,
                       nsIObjectOutputStream* aStream,
-                      JSObject* aFunctionObject,
-                      PRUint32 aLineNumber);
+                      JSObject* aFunctionObject);
 
 nsresult
 XBL_DeserializeFunction(nsIScriptContext* aContext,
                         nsIObjectInputStream* aStream,
                         void* aHolder,
-                        PRUint32* aLineNumber,
                         void **aScriptObject);
 
 #endif // nsXBLSerialize_h__