Skip to content

Commit

Permalink
Initial source from GECKO193a5_20100610_RELBRANCH, no analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
strattond committed Feb 5, 2025
1 parent d01e89f commit 0ab07ab
Show file tree
Hide file tree
Showing 4,830 changed files with 731,124 additions and 81,071 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
461 changes: 317 additions & 144 deletions spidermonkey/Makefile.in

Large diffs are not rendered by default.

81 changes: 52 additions & 29 deletions spidermonkey/Makefile.ref
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ ifdef NARCISSUS
DEFINES += -DNARCISSUS
endif

# Look in OBJDIR to find jsautocfg.h and jsautokw.h
# Look in OBJDIR to find jsautocfg.h, jsautokw.h, and js-config.h
INCLUDES += -I. -I$(OBJDIR)

ifdef JS_THREADSAFE
Expand All @@ -91,22 +91,29 @@ OTHER_LIBS += -L$(DIST)/lib -lnspr$(NSPR_LIBSUFFIX)
endif
endif

ifdef JS_HAS_CTYPES
DEFINES += -DJS_HAS_CTYPES
INCLUDES += -I$(DIST)/include/nspr
ifdef USE_MSVC
OTHER_LIBS += $(DIST)/lib/libnspr$(NSPR_LIBSUFFIX).lib
else
OTHER_LIBS += -L$(DIST)/lib -lnspr$(NSPR_LIBSUFFIX)
endif
endif

ifdef JS_NO_THIN_LOCKS
DEFINES += -DJS_USE_ONLY_NSPR_LOCKS
endif

ifdef JS_HAS_FILE_OBJECT
DEFINES += -DJS_HAS_FILE_OBJECT
ifdef JS_GC_ZEAL
DEFINES += -DJS_GC_ZEAL
endif


#
# XCFLAGS may be set in the environment or on the gmake command line
#
#CFLAGS += -DDEBUG -DDEBUG_brendan -DJS_ARENAMETER -DJS_HASHMETER -DJS_DUMP_PROPTREE_STATS -DJS_DUMP_SCOPE_METERS -DJS_SCOPE_DEPTH_METER -DJS_BASIC_STATS
CFLAGS += $(OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS)
INTERP_CFLAGS += $(INTERP_OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS) $(INTERP_XCFLAGS)
BUILTINS_CFLAGS += $(BUILTINS_OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS) $(BUILTINS_XCFLAGS)
CFLAGS += $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS)

LDFLAGS = $(XLDFLAGS)
LDFLAGS += $(OS_LDFLAGS)
Expand Down Expand Up @@ -222,7 +229,6 @@ JS_HFILES += \
nanojit/Native.h \
nanojit/RegAlloc.h \
nanojit/nanojit.h \
nanojit/TraceTreeDrawer.h \
$(NULL)
endif

Expand All @@ -242,7 +248,6 @@ OTHER_HFILES = \
jscompat.h \
jscpucfg.h \
jsotypes.h \
jsstddef.h \
prmjtime.h \
resource.h \
jsopcode.tbl \
Expand All @@ -252,14 +257,10 @@ OTHER_HFILES = \
jskeyword.tbl \
$(NULL)

ifdef ENABLE_JIT
OTHER_HFILES += builtins.tbl
endif

ifndef PREBUILT_CPUCFG
OTHER_HFILES += $(OBJDIR)/jsautocfg.h
endif
OTHER_HFILES += $(OBJDIR)/jsautokw.h
OTHER_HFILES += $(OBJDIR)/jsautokw.h $(OBJDIR)/js-config.h

HFILES = $(JS_HFILES) $(API_HFILES) $(OTHER_HFILES)

Expand Down Expand Up @@ -315,9 +316,6 @@ JS_CPPFILES += \
nanojit/avmplus.cpp \
$(NULL)

ifdef DEBUG
JS_CPPFILES += nanojit/TraceTreeDrawer.cpp
endif
endif

ifndef BUILD_OPT
Expand All @@ -326,15 +324,6 @@ ifndef BUILD_OPT
# $(NULL)
endif

ifdef JS_LIVECONNECT
DIRS += liveconnect
endif

ifdef JS_HAS_FILE_OBJECT
JS_CPPFILES += jsfile.cpp
JS_HFILES += jsfile.h
endif

LIB_CPPFILES = $(JS_CPPFILES)
LIB_ASFILES := $(wildcard *_$(OS_ARCH).s)
PROG_CPPFILES = js.cpp
Expand All @@ -361,7 +350,10 @@ nsinstall-target:
# Automatic header generation
#

AUTO_HEADERS = $(OBJDIR)/jsautokw.h $(OBJDIR)/jsautooplen.h
AUTO_HEADERS = \
$(OBJDIR)/jsautokw.h \
$(OBJDIR)/jsautooplen.h \
$(NULL)

$(OBJDIR)/jsautokw.h: jskeyword.tbl

Expand All @@ -376,22 +368,53 @@ GARBAGE += $(AUTO_HEADERS:$(OBJDIR)/jsauto%.h=$(OBJDIR)/js%gen.obj)

$(AUTO_HEADERS): $(OBJDIR)/jsauto%.h: js%gen.cpp
@$(MAKE_OBJDIR)
$(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $<
$(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(OPTIMIZER) $<
link.exe -out:"$(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX)" $(EXE_LINK_FLAGS) $(OBJDIR)/js$*gen.obj
$(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX) $@
else

GARBAGE += $(AUTO_HEADERS:$(OBJDIR)/jsauto%.h=$(OBJDIR)/js%gen.d)
$(AUTO_HEADERS): $(OBJDIR)/jsauto%.h: js%gen.cpp
@$(MAKE_OBJDIR)
$(CXX) -o $(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX) $(CFLAGS) $(LDFLAGS) $<
$(CXX) -o $(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX) $(CFLAGS) $(OPTIMIZER) $(LDFLAGS) $<
$(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX) $@

endif

# force creation of autoheaders before compiling any source that may use them
$(LIB_OBJS) : $(AUTO_HEADERS)

#
# An installed header file describing configuration options that affect
# the API.
#

# Avoid rebuilding unless js-config.h's contents actually change. The
# timestamp on js-config.h.stamp corresponds to the last time we
# checked that js-config.h was up to date. If the stamp changes but
# js-config.h does not, then make concludes that targets depending on
# js-config.h don't need to be rebuilt. The dummy '@true' rule here
# keeps make from concluding that js-config.h never changes.
$(OBJDIR)/js-config.h: $(OBJDIR)/js-config.h.stamp
@true

js-config-switch=$(if $(value $($1)),-e 's/\#undef $1/\#define $1/')
$(OBJDIR)/js-config.h.stamp: js-config.h.in Makefile.ref
sed < $< > $(@:.stamp=.tmp) \
$(call js-config-switch,JS_THREADSAFE) \
$(call js-config-switch,JS_HAS_CTYPES) \
$(call js-config-switch,JS_GC_ZEAL) \
-e :dummy
if ! [ -f $(@:.stamp=) ] || ! cmp $(@:.stamp=.tmp) $(@:.stamp=); then \
mv $(@:.stamp=.tmp) $(@:.stamp=); \
fi
touch $@

GARBAGE += $(OBJDIR)/js-config.h $(OBJDIR)/js-config.h.stamp

# Force creation of js-config.h before compiling any source that may use it.
$(LIB_OBJS) : $(OBJDIR)/js-config.h

#
# JS shell executable
#
Expand Down
8 changes: 0 additions & 8 deletions spidermonkey/SpiderMonkey.rsp
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
mozilla/js/src/*
mozilla/js/src/config/*
mozilla/js/src/liveconnect/*
mozilla/js/src/liveconnect/_jni/*
mozilla/js/src/liveconnect/classes/*
mozilla/js/src/liveconnect/classes/netscape/*
mozilla/js/src/liveconnect/classes/netscape/javascript/*
mozilla/js/src/liveconnect/config/*
mozilla/js/src/liveconnect/macbuild/*
mozilla/js/src/liveconnect/macbuild/JavaSession/*
mozilla/js/src/macbuild/*
13 changes: 13 additions & 0 deletions spidermonkey/aclocal.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dnl
dnl Local autoconf macros used with mozilla
dnl The contents of this file are under the Public Domain.
dnl

builtin(include, build/autoconf/pkg.m4)dnl
builtin(include, build/autoconf/nspr.m4)dnl
builtin(include, build/autoconf/altoptions.m4)dnl
builtin(include, build/autoconf/moznbytetype.m4)dnl
builtin(include, build/autoconf/mozprog.m4)dnl
builtin(include, build/autoconf/acwinpaths.m4)dnl

MOZ_PROG_CHECKMSYS()
110 changes: 110 additions & 0 deletions spidermonkey/analysis-tests/Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla 2.
#
# The Initial Developer of the Original Code is
# the Mozilla Foundation <http://www.mozilla.org>.
#
# Portions created by the Initial Developer are Copyright (C) 2008
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Benjamin Smedberg <benjamin@smedbergs.us> (Author)
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****

DEPTH = ..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

# we will do compilations that create dependency files.
NEED_MDDEPDIR = 1

include $(DEPTH)/config/autoconf.mk

REDGREEN_FAILURE_TESTCASES = \
green-callred.cpp \
green-accessred.cpp \
green-tored-badpath.cpp \
misdeclared-red-funcptr.cpp \
misdeclared-red-funcptr2.cpp \
red-togreenptr.cpp \
red-togreenptr-return.cpp \
red-togreenptr-arg.cpp \
red-togreenptr-field.cpp \
red-togreenptr-initializer.cpp \
red-togreenptr-initializer-struct.cpp \
red-togreenptr-initializer-array.cpp \
red-togreenptr-initializer-nested.cpp \
red-togreenptr-initializer-cast.cpp \
green-callredptr.cpp \
$(NULL)

REDGREEN_SUCCESS_TESTCASES = \
red-callred.cpp \
red-callgreen.cpp \
red-accessred.cpp \
green-tored.cpp \
green-toredptr.cpp \
$(NULL)

STATIC_FAILURE_TESTCASES = \
$(REDGREEN_FAILURE_TESTCASES) \
$(NULL)

STATIC_PASS_TESTCASES = \
$(REDGREEN_SUCCESS_TESTCASES) \
$(NULL)

include $(topsrcdir)/config/rules.mk

LOCAL_INCLUDES += -I$(srcdir)/.. -I..

check:: \
$(STATIC_FAILURE_TESTCASES:.cpp=.s-fail) \
$(STATIC_PASS_TESTCASES:.cpp=.s-pass) \
$(NULL)

# We want to compile each file and invert the result to ensure that
# compilation failed.
%.s-fail: %.cpp $(GLOBAL_DEPS) $(DEHYDRA_SCRIPTS)
@printf "Compiling $(<F) to check that the static-analysis script is checking properly..."
@if $(CCC) $(OUTOPTION)/dev/null -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) >$(*F).errlog 2>&1; then \
printf "fail:\nerror: compilation of $(<F) succeeded. It shouldn't have!\n"; \
exit 1; \
else \
printf "ok.\n"; \
fi

%.s-pass: %.cpp $(GLOBAL_DEPS) $(DEHYDRA_SCRIPTS)
@printf "Compiling $(<F) to check that the static-analysis script is checking properly..."
@if $(CCC) -Werror $(OUTOPTION)/dev/null -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) >$(*F).errlog 2>&1; then \
printf "ok.\n"; \
else \
printf "fail:\nerror: compilation of $(<F) failed. It shouldn't have!\n"; \
exit 1; \
fi
11 changes: 11 additions & 0 deletions spidermonkey/analysis-tests/green-accessred.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "jstypes.h"

struct Foo
{
JS_REQUIRES_STACK void *redmember;
};

void* GreenFunc(Foo *f)
{
return f->redmember;
}
12 changes: 12 additions & 0 deletions spidermonkey/analysis-tests/green-callred.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include "jstypes.h"

#ifndef NS_STATIC_CHECKING
#error Running this without NS_STATIC_CHECKING is silly
#endif

JS_REQUIRES_STACK void RedFunc();

void GreenFunc()
{
RedFunc();
}
8 changes: 8 additions & 0 deletions spidermonkey/analysis-tests/green-callredptr.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "jstypes.h"

typedef void (JS_REQUIRES_STACK *RedFuncPtr)();

void GreenFunc(RedFuncPtr f)
{
f();
}
14 changes: 14 additions & 0 deletions spidermonkey/analysis-tests/green-tored-badpath.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "jstypes.h"

JS_REQUIRES_STACK void RedFunc();

JS_FORCES_STACK void TurnRedFunc();

void GreenPartlyRedFunc(int i)
{
if (i) {
TurnRedFunc();
}

RedFunc();
}
12 changes: 12 additions & 0 deletions spidermonkey/analysis-tests/green-tored.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include "jstypes.h"

JS_REQUIRES_STACK void RedFunc();

JS_FORCES_STACK void TurnRedFunc();

void GreenToRedFunc()
{
TurnRedFunc();

RedFunc();
}
12 changes: 12 additions & 0 deletions spidermonkey/analysis-tests/green-toredptr.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include "jstypes.h"

void GreenFunc();

typedef void (JS_REQUIRES_STACK *RedFuncPtr)();

RedFuncPtr Test()
{
// assigning a green function to a red function pointer is ok
RedFuncPtr p = GreenFunc;
return p;
}
5 changes: 5 additions & 0 deletions spidermonkey/analysis-tests/misdeclared-red-funcptr.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "jstypes.h"


// JS_REQUIRES_STACK should come before the *
typedef void (* JS_REQUIRES_STACK RedFuncPtr)();
5 changes: 5 additions & 0 deletions spidermonkey/analysis-tests/misdeclared-red-funcptr2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "jstypes.h"


// JS_REQUIRES_STACK should come before the *
typedef void (* RedFuncPtr)() JS_REQUIRES_STACK;
Loading

0 comments on commit 0ab07ab

Please sign in to comment.