Skip to content

Commit 566f698

Browse files
committed
Backed out 3 changesets (bug 1829049) for causing nightlyasrelease build bustage.
Backed out changeset 0dad03fea3eb (bug 1829049) Backed out changeset 1350772f04de (bug 1829049) Backed out changeset 2585980fa4fe (bug 1829049)
1 parent 63c7c0f commit 566f698

File tree

7 files changed

+41
-58
lines changed

7 files changed

+41
-58
lines changed

config/check_vanilla_allocations.py

Lines changed: 14 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -89,44 +89,32 @@ def main():
8989
# alloc_fns contains all the vanilla allocation/free functions that we look
9090
# for. Regexp chars are escaped appropriately.
9191

92-
operator_news = [
92+
alloc_fns = [
9393
# Matches |operator new(unsigned T)|, where |T| is |int| or |long|.
94-
r"operator new(unsigned",
94+
r"operator new\(unsigned",
9595
# Matches |operator new[](unsigned T)|, where |T| is |int| or |long|.
96-
r"operator new[](unsigned",
96+
r"operator new\[\]\(unsigned",
97+
r"memalign",
98+
# These three aren't available on all Linux configurations.
99+
# r'posix_memalign',
100+
# r'aligned_alloc',
101+
# r'valloc',
97102
]
98103

99-
# operator new may end up inlined and replaced with moz_xmalloc.
100-
inlined_operator_news = [
101-
r"moz_xmalloc",
102-
]
103-
104-
alloc_fns = (
105-
operator_news
106-
+ inlined_operator_news
107-
+ [
108-
r"memalign",
109-
# These three aren't available on all Linux configurations.
110-
# r'posix_memalign',
111-
# r'aligned_alloc',
112-
# r'valloc',
113-
]
114-
)
115-
116104
if args.aggressive:
117105
alloc_fns += [r"malloc", r"calloc", r"realloc", r"free", r"strdup"]
118106

119107
# This is like alloc_fns, but regexp chars are not escaped.
120-
alloc_fns_escaped = [re.escape(fn) for fn in alloc_fns]
108+
alloc_fns_unescaped = [fn.replace("\\", "") for fn in alloc_fns]
121109

122110
# This regexp matches the relevant lines in the output of |nm|, which look
123111
# like the following.
124112
#
125113
# js/src/libjs_static.a:Utility.o: U malloc
126114
# js/src/libjs_static.a:Utility.o: 00000000000007e0 T js::SetSourceOptions(...)
127115
#
128-
nm_line_re = re.compile(r"([^:/ ]+):\s*[0-9a-fA-F]*\s+([TUw]) (.*)")
129-
alloc_fns_re = re.compile(r"|".join(alloc_fns_escaped))
116+
nm_line_re = re.compile(r"([^:/ ]+):\s*[0-9a-fA-F]*\s+([TU]) (.*)")
117+
alloc_fns_re = re.compile(r"|".join(alloc_fns))
130118

131119
# This tracks which allocation/free functions have been seen.
132120
functions = defaultdict(set)
@@ -214,24 +202,9 @@ def main():
214202

215203
# Check that all functions we expect are used in util/Utility.cpp. (This
216204
# will fail if the function-detection code breaks at any point.)
217-
# operator new and its inlined equivalent are mutually exclusive.
218-
has_operator_news = any(fn in operator_news for fn in util_Utility_cpp)
219-
has_inlined_operator_news = any(
220-
fn in inlined_operator_news for fn in util_Utility_cpp
221-
)
222-
if has_operator_news and has_inlined_operator_news:
223-
fail(
224-
"Both operator new and moz_xmalloc aren't expected in util/Utility.cpp at the same time"
225-
)
226-
227-
for fn in alloc_fns:
205+
for fn in alloc_fns_unescaped:
228206
if fn not in util_Utility_cpp:
229-
if (
230-
(fn in operator_news and not has_inlined_operator_news)
231-
or (fn in inlined_operator_news and not has_operator_news)
232-
or (fn not in operator_news and fn not in inlined_operator_news)
233-
):
234-
fail("'" + fn + "' isn't used as expected in util/Utility.cpp")
207+
fail("'" + fn + "' isn't used as expected in util/Utility.cpp")
235208
else:
236209
util_Utility_cpp.remove(fn)
237210

@@ -267,9 +240,7 @@ def main():
267240
#
268241
# U malloc util/Utility.cpp:117
269242
#
270-
alloc_lines_re = (
271-
r"[Uw] ((" + r"|".join(alloc_fns_escaped) + r").*)\s+(\S+:\d+)$"
272-
)
243+
alloc_lines_re = r"U ((" + r"|".join(alloc_fns) + r").*)\s+(\S+:\d+)$"
273244

274245
for line in lines:
275246
m = re.search(alloc_lines_re, line)

js/src/gc/Memory.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,8 +919,7 @@ void* AllocateMappedContent(int fd, size_t offset, size_t length,
919919
HANDLE hFile = reinterpret_cast<HANDLE>(intptr_t(fd));
920920

921921
// This call will fail if the file does not exist.
922-
HANDLE hMap =
923-
CreateFileMappingW(hFile, nullptr, PAGE_READONLY, 0, 0, nullptr);
922+
HANDLE hMap = CreateFileMapping(hFile, nullptr, PAGE_READONLY, 0, 0, nullptr);
924923
if (!hMap) {
925924
return nullptr;
926925
}

js/src/jit/ProcessExecutableMemory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static bool RegisterExecutableMemory(void* p, size_t bytes, size_t pageSize) {
282282
// RtlAddGrowableFunctionTable is only available in Windows 8.1 and higher.
283283
// This can be simplified if our compile target changes.
284284
HMODULE ntdll_module =
285-
LoadLibraryExW(L"ntdll.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
285+
LoadLibraryEx("ntdll.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
286286

287287
static decltype(&::RtlAddGrowableFunctionTable) addGrowableFunctionTable =
288288
reinterpret_cast<decltype(&::RtlAddGrowableFunctionTable)>(

js/src/old-configure.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,15 @@ AC_LANG_CPLUSPLUS
543543

544544
MOZ_CXX11
545545

546+
case "${OS_TARGET}" in
547+
WINNT|Darwin|Android)
548+
;;
549+
*)
550+
STL_FLAGS="-I${DIST}/stl_wrappers"
551+
WRAP_STL_INCLUDES=1
552+
;;
553+
esac
554+
546555
dnl Checks for header files.
547556
dnl ========================================================
548557
AC_HEADER_DIRENT

js/src/shell/OSObject.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,15 +418,15 @@ static bool ListDir(JSContext* cx, unsigned argc, Value* vp,
418418
return false;
419419
}
420420

421-
WIN32_FIND_DATAA FindFileData;
422-
HANDLE hFind = FindFirstFileA(pattern.begin(), &FindFileData);
421+
WIN32_FIND_DATA FindFileData;
422+
HANDLE hFind = FindFirstFile(pattern.begin(), &FindFileData);
423423
auto close = mozilla::MakeScopeExit([&] {
424424
if (!FindClose(hFind)) {
425425
MOZ_CRASH("Could not close Find");
426426
}
427427
});
428428
for (bool found = (hFind != INVALID_HANDLE_VALUE); found;
429-
found = FindNextFileA(hFind, &FindFileData)) {
429+
found = FindNextFile(hFind, &FindFileData)) {
430430
if (!append(FindFileData.cFileName)) {
431431
return false;
432432
}

old-configure.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ case "$target" in
125125
fi
126126
WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && (pwd -W 2>/dev/null || pwd)`
127127
fi
128+
129+
WRAP_STL_INCLUDES=1
130+
STL_FLAGS="-I${DIST}/stl_wrappers"
128131
else
129132
# Check w32api version
130133
_W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
@@ -173,6 +176,9 @@ fi # COMPILE_ENVIRONMENT
173176
AC_SUBST(GNU_CC)
174177
AC_SUBST(GNU_CXX)
175178

179+
AC_SUBST_LIST(STL_FLAGS)
180+
AC_SUBST(WRAP_STL_INCLUDES)
181+
176182
dnl ========================================================
177183
dnl set the defaults first
178184
dnl ========================================================
@@ -597,6 +603,13 @@ MOZ_CXX11
597603

598604
AC_LANG_C
599605

606+
STL_FLAGS="-I${DIST}/stl_wrappers"
607+
WRAP_STL_INCLUDES=1
608+
609+
if test "$MOZ_BUILD_APP" = "tools/crashreporter/injector"; then
610+
WRAP_STL_INCLUDES=
611+
fi
612+
600613
dnl Checks for header files.
601614
dnl ========================================================
602615
AC_HEADER_DIRENT

toolkit/moz.configure

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3314,12 +3314,3 @@ option(
33143314
)
33153315

33163316
set_config("MOZ_SYSTEM_POLICIES", True, when="--enable-system-policies")
3317-
3318-
3319-
# STL wrapping
3320-
# ==============================================================
3321-
set_config("WRAP_STL_INCLUDES", True)
3322-
set_config(
3323-
"STL_FLAGS",
3324-
depends(build_environment.dist)(lambda dist: [f"-I{dist}/stl_wrappers"]),
3325-
)

0 commit comments

Comments
 (0)