Граф коммитов

28 Коммитов

Автор SHA1 Сообщение Дата
brendan%mozilla.org b7cdb7debb Add shared DHashTableOps for [const] char *key use-cases, clean up dhash API abusages (214839, r=dougt, sr=dbaron). 2003-08-05 20:09:21 +00:00
brendan%mozilla.org 32fe82e60e Fold premature entry decl initialized by gratuitous ?: expr into dependent if/else in nsFastLoadFileReader::ReadObject. 2003-06-04 06:08:15 +00:00
brendan%mozilla.org e81a02eeb2 Reduce seeks outside the FastLoad file's underlying stream buffer (195010,
r=ben, sr=bryner).

- Pass null scope objects into nsIScriptContext::Compile{EventHandler,Script}
when precompiling for brutal sharing.  The JS engine does not need a non-null
object parameter for static scope.  That parameter can be non-null only if it
helps the compiler "pre-bind" functions to the same scope object that they'll
be parented by when executing, but with brutal sharing, functions are
precompiled once and executed against many different scope objects.

- A problem in XUL FastLoad was that it would serialize master .xul document
out-of-line scripts (those included via script src= from non-overlay, "master"
.xul docs) far from the place in the FastLoad file where XUL prototype script
info was serialized for the <script src=> tag itself.  I fixed that so that,
unless the out-of-line script was previously serialized (by a different src=
reference from another .xul file), the OOL script data immediately follows the
proto-script info in the FastLoad file.

This required adding a SerializeOutOfLine method to nsXULPrototypeScript, which
restores symmetry by matching the existing DeserializeOutOfLine(Script) (note:
I dropped the redundant "Script" from the end of the latter method's name.  We
need SerializeOutOfLine to handle overlay OOL scripts.	They are serialized by
nsXULDocument::OnStreamComplete, because that code knows the difference between
an overlay and a master doc.  This removes all trace of FastLoad writing from
nsXULPrototypeScript::Compile -- FastLoad stuff didn't belong there, not only
because we now want to write master OOL scripts later, when walking the master
XUL prototype doc's element tree, but also for modularity reasons.  The caller
knows about FastLoad, nsXULPrototypeScript::Compile does just what its name
implies.

There are 132 seeks with the patch, only 49 of which dump the underlying file
stream's buffer, vs. 133 seeks without the patch, 87 of which dump the buffer.

- Nit-picked some comments to fit in 80 columns, and made other cosmetic fixes.

- Implicated the nsXULDocument::mIsWritingFastLoad flag from the useXULCache
"is the XUL cache enabled?" flag, so other places that test mIsWritingFastLoad
don't have to query whether the cache is enabled.

- Added METERING synchronous meter-dumping to /tmp/bufstats, only ifdef
DEBUG_brendan, in netwerk/base/src/nsBufferedStreams.cpp.

- Added the deferred seek optimization from the first patch in bug 195010 to
nsFastLoadFile.cpp.

- Fixed nsFastLoadFileReader so it overrides readSegments as well as read.
This catches up with the interface extension made to nsIInputStream to add
readSegments.  The nsFastLoadFileReader extends nsBinaryInputStream, which is
a concrete class, and overrides Read in order to snoop on *all* bytes read.
It does this in order to demultiplex documents interleaved when the FastLoad
file was written.

But since the readSegments move into nsIInputStream.idl, certain primitives
in nsBinaryStream.cpp, e.g., nsBinaryInputStream::ReadCString, have used
ReadSegments, not Read, to consume parts of the underlying stream (to read
the C string's chars, in that example), and the FastLoad file implementation
has not accounted for those bytes.

- Added a new method to nsIFastLoadFileControl and its impls: hasMuxedDocument.
 This is needed when serializing master XUL doc OOL scripts, because we must
not serialize twice, and any OOL script that other XUL docs can include via
script src= could already be in the FastLoad mux.

/be
2003-04-12 01:34:11 +00:00
alecf%netscape.com 6c75920da1 fix for bug 195298 - pldhash ops tables should be const.. r=dougt, sr=sfraser 2003-04-04 15:10:37 +00:00
brendan%mozilla.org 04624a2df0 - Turn jrgm's helpful assert/defend changes into assertions that mCIDOffset
is never 0, and make the memset-to-zero required for these assertions be
  #ifdef NS_DEBUG.
- Extend FastLoad file format to encode a singleton flag in the high bit of
  nsFastLoadSharpObjectInfo.mWeakRefCnt.  The updater code needs to test this
  bit in order to deserialize a singleton that was not read by the updater's
  reader during this FastLoad episode.  Otherwise the updater is likely to
  reserialize the singleton, leading to multiple entries in the object map
  for the same object, and UMRs when loading from the writer's object map
  enumeration (objvec) in nsFastLoadFileWriter::WriteFooter.
- Remove bogus assertion that worked only when an XPCOM data structure being
  serialized was still alive at the time the writer closed.  In general, there
  is no relationship between the strong ref-counts in a FastLoad file and the
  XPCOM refcnts in memory at close time.
- Bug 189832, r=jrgm, sr=ben, a=dbaron.
2003-02-16 17:40:16 +00:00
jrgm%netscape.com 2f7102abeb Guard against bogus entries in the object map of the fastload file, bug 189832, r=ben/jag, sr=jst, a=asa 2003-01-31 01:34:45 +00:00
brendan%mozilla.org b8d97d8b8c Defend against bad EndMuxedDocument calls, and assert in the underlying {JS,PL}_DHashTableRawRemove that entry is live (188744, r=jrgm, sr=ben). 2003-01-17 10:01:50 +00:00
alecf%netscape.com df10f648b8 take two at fixing bug 177401 - convert nsIBinaryStream over to using nsAString/nsACString for string values, to speed up fastload
sr=darin, r=dougt
(the previous checkin had a typo which disabled fastload entirely!)
2002-11-14 18:16:31 +00:00
alecf%netscape.com 0a48c10053 argh, back out my last checkin because Ts went UP not down! 2002-11-09 01:31:32 +00:00
alecf%netscape.com 4721428275 fix for bug 177401 - use nsAString& classes instead of wstring in nsIBinaryInputStream, to speed up fastload startup
sr=darin, r=dougt
2002-11-08 23:30:53 +00:00
darin%netscape.com 6fd5862e6e fixes bug 142870 "nsIFile should use UCS-2 instead of UTF-8"
r=dougt sr=alecf
2002-05-07 23:07:19 +00:00
ben%netscape.com bdd1b4d691 [Chrome FastLoad]
Patch to make FastLoad Service return the previous URI selected when selecting a new one, as well as fixing a few issues relating to dependencies on non-existent files. Patch from brendan, r=dbaron, sr=waterson
2002-05-03 02:59:42 +00:00
darin%netscape.com e554d83626 fixes bug 129279 "nsIFile unicode/utf8/ascii task"
r=dougt sr=alecf
2002-04-27 05:33:09 +00:00
timeless%mac.com 51a4520c4a Bugzilla Bug 107823 change nsIFile
to use 'Modified' instead of 'Modification'
r=akkana sr=brendan
2001-11-26 08:05:05 +00:00
brendan%mozilla.org 8948a6287c Break self-cycle to fix leak (106860, r=dbaron, sr=bienvenu). 2001-11-26 01:20:31 +00:00
pete%alphanumerica.com b52992027b b=107823, r=ccarlen, sr=brendan
--pete
2001-11-01 00:11:15 +00:00
brendan%mozilla.org 2764eab5c9 Store FastLoad dependency mtimes, and invalidate if any changes (106021, r=dveditz, sr=shaver). 2001-10-31 08:29:25 +00:00
brendan%mozilla.org eb9671e246 Add SetAlphaBounds, TABLE_SIZE, and MIN_ALPHA APIs (103990, r=dbaron, sr=waterson). 2001-10-16 05:40:27 +00:00
brendan%mozilla.org ec9fe99d2a Fix to avoid dangling PLDHashTable entry pointers that lead to humongous FastLoad files (95888, r=dbaron, sr=waterson). 2001-10-03 06:57:52 +00:00
gerv%gerv.net 4e12e44b2f Relicensing Round 1, Take 2. Most C-like NPL files -> NPL/GPL/LGPL. Bug 98089. 2001-09-28 20:14:13 +00:00
brendan%mozilla.org 6d895baf1d Bit checkin for bug 68045, r/sr=waterson&shaver, second attempt. It all works
for me on optimized and debug gcc2.96, rh7.1.

- Better failure codes from nsXULPrototypeScript::Deserialize.

- Call nsXULDocument::AbortFastLoads after nsXULPrototypeScript::Serialize
  failure, instead of just nulling the FastLoad service's output stream.

- Expose nsXULDocument::AbortFastLoads via nsIXULPrototypeCache, for use from
  nsChromeProtocolHandler.cpp.  AbortFastLoads flushes the XUL cache now, for
  good measure.

- The needless "Current" adjective in nsIFastLoadService attribute and method
  names is no more.

- Add a do_GetFastLoadService() helper, to use CID instead of contractid, and
  to let the compiler consolidate the static inline CID.

- Add "nglayout.debug.checksum_xul_fastload_file" pref so people can do without
  the checksum verification step when reading a FastLoad file.

- Verify the FastLoad file checksum, by default.  Also, cache it in the FastLoad
  service so we don't recompute it when re-opening the FastLoad file as mailnews
  and other top-levels start up.  Fill the checksum cache in EndFastLoad, when
  the last pseudo-concurrent top-level finishes loading.

  My hope to compute the checksum while writing the FastLoad file ran afoul of
  misordered writes.  The old code to checksum the in-memory nsFastLoadHeader
  also was broken on little endian platforms.  Now all checksumming is done via
  a separate read pass over the complete file, save for the header's checksum
  field, which is summed as if it contained zero.

- Track and check FastLoad file dependencies.  This required groveling with a
  bunch of Necko interfaces in nsChromeProtocolHandler::NewChannel -- read it
  and weep.  Dependency checking, as well as checksum access and computation,
  use better-factored nsIFastLoad{File,Read,Write}Control interfaces.

- nsBufferedStream::Seek wasn't flushing the buffer when seeking backward
  within the buffer, but it must, because mCursor bounds the amount to write
  if the buffer contains the end of file.

- Add an unbufferedStream readonly attribute to nsIStreamBufferAccess, so we
  don't have to screw around with the bufferying layer when checksumming. Also
  implement nsIStreamBufferAccess in nsBufferedOutputStream.

- nsISeekableOutputStream was bogus, based on a bad state I had put the
  nsBufferedOutputStream code in on its way from being completely broken when
  you seek backwards outside of the buffer.  Removing this interface required
  using nsIFastLoadFileIO in nsFastLoadFileWriter, and it also required careful
  ordering of Close calls (the Reader must close after the Writer or Updater,
  so that the Reader's underlying, unbuffered input stream can be read by
  nsFastLoadFileWriter::Close to compute the checksum.

- Miscellaneous tab/indentation, comment typo, bracing, if( => if ( style,
  nsnull vs. 0, useless variable elimination, tortured control flow,
  AutoString instead of String, and gratuitous ; after nsISupportsUtils.h
  macro call cleanups.
2001-08-21 20:51:34 +00:00
blizzard%redhat.com b0f8b91746 Back out brendan's checkin to try and get linux starting up again. 2001-08-17 19:45:11 +00:00
brendan%mozilla.org b00819c93c - Better failure codes from nsXULPrototypeScript::Deserialize.
- Call nsXULDocument::AbortFastLoads after nsXULPrototypeScript::Serialize
  failure, instead of just nulling the FastLoad service's output stream.

- Expose nsXULDocument::AbortFastLoads via nsIXULPrototypeCache, for use from
  nsChromeProtocolHandler.cpp.  AbortFastLoads flushes the XUL cache now, for
  good measure.

- The needless "Current" adjective in nsIFastLoadService attribute and method
  names is no more.

- Add a do_GetFastLoadService() helper, to use CID instead of contractid, and
  to let the compiler consolidate the static inline CID.

- Add "nglayout.debug.checksum_xul_fastload_file" pref so people can do without
  the checksum verification step when reading a FastLoad file.

- Verify the FastLoad file checksum, by default.  Also, cache it in the FastLoad
  service so we don't recompute it when re-opening the FastLoad file as mailnews
  and other top-levels start up.  Fill the checksum cache in EndFastLoad, when
  the last pseudo-concurrent top-level finishes loading.

  My hope to compute the checksum while writing the FastLoad file ran afoul of
  misordered writes.  The old code to checksum the in-memory nsFastLoadHeader
  also was broken on little endian platforms.  Now all checksumming is done via
  a separate read pass over the complete file, save for the header's checksum
  field, which is summed as if it contained zero.

- Track and check FastLoad file dependencies.  This required groveling with a
  bunch of Necko interfaces in nsChromeProtocolHandler::NewChannel -- read it
  and weep.  Dependency checking, as well as checksum access and computation,
  use better-factored nsIFastLoad{File,Read,Write}Control interfaces.

- nsBufferedStream::Seek wasn't flushing the buffer when seeking backward
  within the buffer, but it must, because mCursor bounds the amount to write
  if the buffer contains the end of file.

- Add an unbufferedStream readonly attribute to nsIStreamBufferAccess, so we
  don't have to screw around with the bufferying layer when checksumming. Also
  implement nsIStreamBufferAccess in nsBufferedOutputStream.

- nsISeekableOutputStream was bogus, based on a bad state I had put the
  nsBufferedOutputStream code in on its way from being completely broken when
  you seek backwards outside of the buffer.  Removing this interface required
  using nsIFastLoadFileIO in nsFastLoadFileWriter, and it also required careful
  ordering of Close calls (the Writer or Updater must close after the Reader,
  so that the Reader's underlying, unbuffered input stream can be read by
  nsFastLoadFileWriter::Close to compute the checksum.

- Miscellaneous tab/indentation, comment typo, bracing, if( => if ( style,
  nsnull vs. 0, useless variable elimination, tortured control flow,
  AutoString instead of String, and gratuitous ; after nsISupportsUtils.h
  macro call cleanups.
2001-08-17 09:52:55 +00:00
cls%seawood.org 80edcd8228 Use NS_PTR_TO_INT32 macros to do 64-bit safe pointer conversions.
Bug #20860 r=Roland.Mainz@informatik.med.uni-giessen.de sr=brendan@mozilla.org
2001-08-14 04:18:27 +00:00
brendan%mozilla.org 49c0102cdf Restore scriptable nsIClassInfo.classID but add fast/C++-only classIDNoAlloc; define and use nsIClassInfo::EAGER_CLASSINFO in caps (93792, sr=waterson&jst). 2001-08-07 03:59:29 +00:00
pinkerton%netscape.com 7023f82c01 Working around dynamic linker restrictions on hp/macosx. r=dbaron/sr=brendan.
bug# 93479
2001-08-03 20:54:25 +00:00
brendan%mozilla.org a80cd5bfe0 Danm's fix for Mac CodeWarrior C++ glitch, and a cosmetic sneak-fix. 2001-07-31 22:22:36 +00:00
brendan%mozilla.org dbd7fed5b1 FASTLOAD_20010703_BRANCH landing, r=dbaron, sr=shaver. 2001-07-31 19:05:34 +00:00