Merge bug 466492, bug 466486, bug 463289, bug 442012, and bug 463420

This commit is contained in:
Benjamin Smedberg 2008-12-02 14:08:12 -05:00
Родитель 4bdb4d2d33 ac9c2a0930
Коммит baa60e6034
5 изменённых файлов: 92 добавлений и 43 удалений

Просмотреть файл

@ -199,15 +199,22 @@ ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
ifndef GNU_CC
#
# All C++ files share a PDB file per directory. For parallel builds, this PDB
# file is shared and locked by MSPDBSRV.EXE, starting with MSVC8 SP1. If
# you're using MSVC 7.1 or MSVC8 without SP1, don't do parallel builds.
# Unless we're building SIMPLE_PROGRAMS, all C++ files share a PDB file per
# directory. For parallel builds, this PDB file is shared and locked by
# MSPDBSRV.EXE, starting with MSVC8 SP1. If you're using MSVC 7.1 or MSVC8
# without SP1, don't do parallel builds.
#
# The final PDB for libraries and programs is created by the linker and uses
# a different name from the single PDB file created by the compiler. See
# bug 462740.
#
ifdef SIMPLE_PROGRAMS
COMPILE_PDBFILE = $(basename $(@F)).pdb
else
COMPILE_PDBFILE = generated.pdb
endif
LINK_PDBFILE = $(basename $(@F)).pdb
ifdef MOZ_DEBUG
CODFILE=$(basename $(@F)).cod
@ -360,22 +367,30 @@ UPDATE_TITLE_libs = sed -e "s!Y!libs in $(shell $(BUILD_TOOLS)/print-depth-path.
UPDATE_TITLE_tools = sed -e "s!Y!tools in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str;
endif
ifneq (,$(strip $(DIRS)))
LOOP_OVER_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
$(foreach dir,$(DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
endif
# we only use this for the makefiles target and other stuff that doesn't matter
ifneq (,$(strip $(PARALLEL_DIRS)))
LOOP_OVER_PARALLEL_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(PARALLEL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
$(foreach dir,$(PARALLEL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
endif
ifneq (,$(strip $(STATIC_DIRS)))
LOOP_OVER_STATIC_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(STATIC_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
$(foreach dir,$(STATIC_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
endif
ifneq (,$(strip $(TOOL_DIRS)))
LOOP_OVER_TOOL_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
endif
ifdef PARALLEL_DIRS
# create a bunch of fake targets for order-only processing
@ -615,8 +630,7 @@ default all alldep::
else
default all::
@$(EXIT_ON_ERROR) \
$(foreach dir,$(STATIC_DIRS),$(MAKE) -C $(dir); ) true
+$(LOOP_OVER_STATIC_DIRS)
$(MAKE) export
$(MAKE) libs
$(MAKE) tools
@ -718,10 +732,7 @@ endif
tools:: $(SUBMAKEFILES) $(MAKE_DIRS)
+$(LOOP_OVER_DIRS)
ifdef TOOL_DIRS
@$(EXIT_ON_ERROR) \
$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) libs; ) true
endif
+$(LOOP_OVER_TOOL_DIRS)
#
# Rule to create list of libraries for final link
@ -1805,15 +1816,14 @@ chrome::
$(FINAL_TARGET)/chrome:
$(NSINSTALL) -D $@
libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome
ifneq (,$(wildcard $(JAR_MANIFEST)))
ifndef NO_DIST_INSTALL
@$(EXIT_ON_ERROR) \
if test -f $(JAR_MANIFEST); then \
libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome
$(PYTHON) $(MOZILLA_DIR)/config/JarMaker.py \
$(QUIET) -j $(FINAL_TARGET)/chrome \
$(MAKE_JARS_FLAGS) $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \
$(JAR_MANIFEST); \
fi
$(JAR_MANIFEST)
endif
endif
ifneq ($(DIST_FILES),)

Просмотреть файл

@ -199,15 +199,22 @@ ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
ifndef GNU_CC
#
# All C++ files share a PDB file per directory. For parallel builds, this PDB
# file is shared and locked by MSPDBSRV.EXE, starting with MSVC8 SP1. If
# you're using MSVC 7.1 or MSVC8 without SP1, don't do parallel builds.
# Unless we're building SIMPLE_PROGRAMS, all C++ files share a PDB file per
# directory. For parallel builds, this PDB file is shared and locked by
# MSPDBSRV.EXE, starting with MSVC8 SP1. If you're using MSVC 7.1 or MSVC8
# without SP1, don't do parallel builds.
#
# The final PDB for libraries and programs is created by the linker and uses
# a different name from the single PDB file created by the compiler. See
# bug 462740.
#
ifdef SIMPLE_PROGRAMS
COMPILE_PDBFILE = $(basename $(@F)).pdb
else
COMPILE_PDBFILE = generated.pdb
endif
LINK_PDBFILE = $(basename $(@F)).pdb
ifdef MOZ_DEBUG
CODFILE=$(basename $(@F)).cod
@ -360,22 +367,30 @@ UPDATE_TITLE_libs = sed -e "s!Y!libs in $(shell $(BUILD_TOOLS)/print-depth-path.
UPDATE_TITLE_tools = sed -e "s!Y!tools in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str;
endif
ifneq (,$(strip $(DIRS)))
LOOP_OVER_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
$(foreach dir,$(DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
endif
# we only use this for the makefiles target and other stuff that doesn't matter
ifneq (,$(strip $(PARALLEL_DIRS)))
LOOP_OVER_PARALLEL_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(PARALLEL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
$(foreach dir,$(PARALLEL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
endif
ifneq (,$(strip $(STATIC_DIRS)))
LOOP_OVER_STATIC_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(STATIC_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
$(foreach dir,$(STATIC_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
endif
ifneq (,$(strip $(TOOL_DIRS)))
LOOP_OVER_TOOL_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
endif
ifdef PARALLEL_DIRS
# create a bunch of fake targets for order-only processing
@ -615,8 +630,7 @@ default all alldep::
else
default all::
@$(EXIT_ON_ERROR) \
$(foreach dir,$(STATIC_DIRS),$(MAKE) -C $(dir); ) true
+$(LOOP_OVER_STATIC_DIRS)
$(MAKE) export
$(MAKE) libs
$(MAKE) tools
@ -718,10 +732,7 @@ endif
tools:: $(SUBMAKEFILES) $(MAKE_DIRS)
+$(LOOP_OVER_DIRS)
ifdef TOOL_DIRS
@$(EXIT_ON_ERROR) \
$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) libs; ) true
endif
+$(LOOP_OVER_TOOL_DIRS)
#
# Rule to create list of libraries for final link
@ -1805,15 +1816,14 @@ chrome::
$(FINAL_TARGET)/chrome:
$(NSINSTALL) -D $@
libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome
ifneq (,$(wildcard $(JAR_MANIFEST)))
ifndef NO_DIST_INSTALL
@$(EXIT_ON_ERROR) \
if test -f $(JAR_MANIFEST); then \
libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome
$(PYTHON) $(MOZILLA_DIR)/config/JarMaker.py \
$(QUIET) -j $(FINAL_TARGET)/chrome \
$(MAKE_JARS_FLAGS) $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \
$(JAR_MANIFEST); \
fi
$(JAR_MANIFEST)
endif
endif
ifneq ($(DIST_FILES),)

Просмотреть файл

@ -184,7 +184,7 @@ function process_cp_pre_genericize(fndecl)
let r = isStack(destType);
if (r)
error("constructed object of type '%s' not on the stack: %s".format(destType.name, r), getLocation());
warning("constructed object of type '%s' not on the stack: %s".format(destType.name, r), getLocation());
}
}
}

Просмотреть файл

@ -293,6 +293,9 @@ nsMemoryImpl::sFlushEvent;
XPCOM_API(void*)
NS_Alloc(PRSize size)
{
if (size > PR_INT32_MAX)
return nsnull;
void* result = MALLOC1(size);
if (! result) {
// Request an asynchronous flush
@ -304,6 +307,9 @@ NS_Alloc(PRSize size)
XPCOM_API(void*)
NS_Realloc(void* ptr, PRSize size)
{
if (size > PR_INT32_MAX)
return nsnull;
void* result = REALLOC1(ptr, size);
if (! result && size != 0) {
// Request an asynchronous flush

Просмотреть файл

@ -60,10 +60,12 @@
#include "nsComponentManager.h"
#include "nsCRTGlue.h"
#include "nsModule.h"
#include "nsThreadUtils.h"
#include "nsTraceRefcntImpl.h"
#include "nsILocalFile.h"
#include "nsIModule.h"
#include "nsIProxyObjectManager.h"
#ifdef XP_WIN
#include <windows.h>
@ -98,6 +100,8 @@ NS_IMPL_RELEASE_USING_AGGREGATOR(nsNativeModuleLoader,
nsresult
nsNativeModuleLoader::Init()
{
NS_ASSERTION(NS_IsMainThread(), "Startup not on main thread?");
LOG(PR_LOG_DEBUG, ("nsNativeModuleLoader::Init()"));
return mLibraries.Init() ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
@ -108,6 +112,23 @@ nsNativeModuleLoader::LoadModule(nsILocalFile* aFile, nsIModule* *aResult)
{
nsresult rv;
if (!NS_IsMainThread()) {
// If this call is off the main thread, synchronously proxy it
// to the main thread.
nsCOMPtr<nsIModuleLoader> proxythis;
rv = NS_GetProxyForObject(NS_PROXY_TO_MAIN_THREAD,
NS_GET_IID(nsIModuleLoader),
this, NS_PROXY_SYNC,
getter_AddRefs(proxythis));
if (NS_FAILED(rv))
return rv;
return proxythis->LoadModule(aFile, aResult);
}
NS_ASSERTION(NS_IsMainThread(), "LoadModule should always proxy to the main thread!");
// Only load components that end in the proper dynamic library suffix
nsCAutoString filePath;
aFile->GetNativePath(filePath);
@ -255,6 +276,8 @@ nsNativeModuleLoader::UnloaderFunc(nsIHashable* aHashedFile,
void
nsNativeModuleLoader::UnloadLibraries()
{
NS_ASSERTION(NS_IsMainThread(), "Shutdown not on main thread?");
mLibraries.Enumerate(ReleaserFunc, nsnull);
mLibraries.Enumerate(UnloaderFunc, nsnull);
}