mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Merge tracemonkey to mozilla-central.
This commit is contained in:
commit
41e10487ac
@ -351,6 +351,7 @@ user_pref("layout.debug.enable_data_xbl", true);
|
||||
user_pref("browser.EULA.override", true);
|
||||
user_pref("javascript.options.tracejit.content", true);
|
||||
user_pref("javascript.options.methodjit.content", true);
|
||||
user_pref("javascript.options.jitprofiling.content", true);
|
||||
user_pref("gfx.color_management.force_srgb", true);
|
||||
user_pref("network.manage-offline-status", false);
|
||||
user_pref("test.mousescroll", true);
|
||||
|
@ -1197,6 +1197,8 @@ static const char js_tracejit_content_str[] = JS_OPTIONS_DOT_STR "tracejit.con
|
||||
static const char js_tracejit_chrome_str[] = JS_OPTIONS_DOT_STR "tracejit.chrome";
|
||||
static const char js_methodjit_content_str[] = JS_OPTIONS_DOT_STR "methodjit.content";
|
||||
static const char js_methodjit_chrome_str[] = JS_OPTIONS_DOT_STR "methodjit.chrome";
|
||||
static const char js_profiling_content_str[] = JS_OPTIONS_DOT_STR "jitprofiling.content";
|
||||
static const char js_profiling_chrome_str[] = JS_OPTIONS_DOT_STR "jitprofiling.chrome";
|
||||
|
||||
int
|
||||
nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
|
||||
@ -1222,6 +1224,9 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
|
||||
PRBool useMethodJIT = nsContentUtils::GetBoolPref(chromeWindow ?
|
||||
js_methodjit_chrome_str :
|
||||
js_methodjit_content_str);
|
||||
PRBool useProfiling = nsContentUtils::GetBoolPref(chromeWindow ?
|
||||
js_profiling_chrome_str :
|
||||
js_profiling_content_str);
|
||||
nsCOMPtr<nsIXULRuntime> xr = do_GetService(XULRUNTIME_SERVICE_CONTRACTID);
|
||||
if (xr) {
|
||||
PRBool safeMode = PR_FALSE;
|
||||
@ -1229,6 +1234,7 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
|
||||
if (safeMode) {
|
||||
useTraceJIT = PR_FALSE;
|
||||
useMethodJIT = PR_FALSE;
|
||||
useProfiling = PR_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1245,6 +1251,11 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
|
||||
else
|
||||
newDefaultJSOptions &= ~JSOPTION_METHODJIT;
|
||||
|
||||
if (useProfiling)
|
||||
newDefaultJSOptions |= JSOPTION_PROFILING;
|
||||
else
|
||||
newDefaultJSOptions &= ~JSOPTION_PROFILING;
|
||||
|
||||
#ifdef DEBUG
|
||||
// In debug builds, warnings are enabled in chrome context if javascript.options.strict.debug is true
|
||||
PRBool strictDebug = nsContentUtils::GetBoolPref(js_strict_debug_option_str);
|
||||
|
@ -126,6 +126,7 @@ DIST_INSTALL = 1
|
||||
VPATH = $(srcdir)
|
||||
|
||||
CPPSRCS = \
|
||||
jsanalyze.cpp \
|
||||
jsapi.cpp \
|
||||
jsarena.cpp \
|
||||
jsarray.cpp \
|
||||
@ -181,6 +182,7 @@ INSTALLED_HEADERS = \
|
||||
jsautocfg.h \
|
||||
$(CURDIR)/jsautokw.h \
|
||||
js.msg \
|
||||
jsanalyze.h \
|
||||
jsapi.h \
|
||||
jsarray.h \
|
||||
jsarena.h \
|
||||
@ -304,7 +306,6 @@ ifdef ENABLE_METHODJIT
|
||||
VPATH += $(srcdir)/methodjit
|
||||
|
||||
CPPSRCS += MethodJIT.cpp \
|
||||
BytecodeAnalyzer.cpp \
|
||||
StubCalls.cpp \
|
||||
Compiler.cpp \
|
||||
FrameState.cpp \
|
||||
@ -360,22 +361,6 @@ CPPSRCS += checks.cc \
|
||||
utils.cc \
|
||||
$(NONE)
|
||||
|
||||
INSTALLED_HEADERS += \
|
||||
cached-powers.h \
|
||||
checks.h \
|
||||
conversions.h \
|
||||
diy-fp.h \
|
||||
double.h \
|
||||
dtoa.h \
|
||||
fast-dtoa.h \
|
||||
globals.h \
|
||||
include-v8.h \
|
||||
platform.h \
|
||||
powers-ten.h \
|
||||
utils.h \
|
||||
v8.h \
|
||||
$(NULL)
|
||||
|
||||
#
|
||||
# END enclude sources for V8 dtoa
|
||||
#############################################
|
||||
@ -580,11 +565,11 @@ endif
|
||||
ifdef ENABLE_TRACEJIT
|
||||
ifndef WINCE
|
||||
check::
|
||||
$(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/trace-test/trace_test.py \
|
||||
$(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/jit-test/jit_test.py \
|
||||
--no-slow --no-progress --tinderbox $(DIST)/bin/js$(BIN_SUFFIX)
|
||||
|
||||
check-valgrind::
|
||||
$(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/trace-test/trace_test.py \
|
||||
$(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/jit-test/jit_test.py \
|
||||
--valgrind --no-slow --no-progress --tinderbox $(DIST)/bin/js$(BIN_SUFFIX)
|
||||
endif
|
||||
endif
|
||||
|
@ -214,7 +214,7 @@ namespace JSC {
|
||||
FMSTAT = 0x0ef1fa10
|
||||
#if WTF_ARM_ARCH_VERSION >= 5
|
||||
,CLZ = 0x016f0f10,
|
||||
BKPT = 0xe120070,
|
||||
BKPT = 0xe1200070,
|
||||
BLX = 0x012fff30
|
||||
#endif
|
||||
#if WTF_ARM_ARCH_VERSION >= 7
|
||||
@ -253,9 +253,9 @@ namespace JSC {
|
||||
};
|
||||
|
||||
enum {
|
||||
padForAlign8 = 0x00,
|
||||
padForAlign16 = 0x0000,
|
||||
padForAlign32 = 0xee120070
|
||||
padForAlign8 = (int)0x00,
|
||||
padForAlign16 = (int)0x0000,
|
||||
padForAlign32 = (int)0xe12fff7f // 'bkpt 0xffff'
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
@ -307,7 +307,7 @@ namespace JSC {
|
||||
}
|
||||
|
||||
int m_offset : 31;
|
||||
int m_used : 1;
|
||||
bool m_used : 1;
|
||||
};
|
||||
|
||||
// Instruction formating
|
||||
@ -1284,7 +1284,7 @@ namespace JSC {
|
||||
// Deal with special encodings.
|
||||
if ((type == LSL) && (imm == 0)) {
|
||||
// "LSL #0" doesn't shift at all (and is the default).
|
||||
sprintf(out, rm);
|
||||
sprintf(out, "%s", rm);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,7 @@ public:
|
||||
void flushWithoutBarrier(bool isForced = false)
|
||||
{
|
||||
// Flush if constant pool is more than 60% full to avoid overuse of this function.
|
||||
if (isForced || 5 * m_numConsts > 3 * maxPoolSize / sizeof(uint32_t))
|
||||
if (isForced || (5 * m_numConsts * sizeof(uint32_t)) > (3 * maxPoolSize))
|
||||
flushConstantPool(false);
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ Python 2.5. This is already a standard requirement for building our tree.
|
||||
|
||||
Basic usage:
|
||||
|
||||
python trace_test.py <path-to-js-shell>
|
||||
python jit_test.py <path-to-js-shell>
|
||||
|
||||
The progress bar shows [#tests passed, #tests failed, #tests run] at the left.
|
||||
If all tests pass, the output is 'PASSED ALL'. The test suite can be interrupted
|
||||
@ -21,11 +21,11 @@ at any time with Ctrl+C and partial results will be printed.
|
||||
|
||||
To run only the basic tests, not including the slow tests:
|
||||
|
||||
python trace_test.py <path-to-js-shell> basic
|
||||
python jit_test.py <path-to-js-shell> basic
|
||||
|
||||
For more options:
|
||||
|
||||
python trace_test.py -h
|
||||
python jit_test.py -h
|
||||
|
||||
* CREATING NEW TESTS
|
||||
|
||||
@ -44,12 +44,12 @@ test case:
|
||||
The first line of a test case can contain a special comment controlling how the
|
||||
test is run. For example:
|
||||
|
||||
// |trace-test| allow-oom;
|
||||
// |jit-test| allow-oom;
|
||||
|
||||
The general format in EBNF is:
|
||||
|
||||
metaline ::= cookie { item ";" }
|
||||
cookie ::= "|trace-test|"
|
||||
cookie ::= "|jit-test|"
|
||||
item ::= flag | attribute
|
||||
|
||||
flag ::= "slow" | "allow-oom"
|
@ -1,4 +1,4 @@
|
||||
# trace_test.py -- Python harness for JavaScript trace tests.
|
||||
# jit_test.py -- Python harness for JavaScript trace tests.
|
||||
|
||||
import datetime, os, re, sys, tempfile, traceback
|
||||
import subprocess
|
||||
@ -60,7 +60,7 @@ class Test:
|
||||
t.error = self.error
|
||||
return t
|
||||
|
||||
COOKIE = '|trace-test|'
|
||||
COOKIE = '|jit-test|'
|
||||
|
||||
@classmethod
|
||||
def from_file(cls, path, options):
|
||||
@ -83,7 +83,7 @@ class Test:
|
||||
elif name == 'error':
|
||||
test.error = value
|
||||
else:
|
||||
print('warning: unrecognized |trace-test| attribute %s'%part)
|
||||
print('warning: unrecognized |jit-test| attribute %s'%part)
|
||||
else:
|
||||
if name == 'slow':
|
||||
test.slow = True
|
||||
@ -92,7 +92,7 @@ class Test:
|
||||
elif name == 'valgrind':
|
||||
test.valgrind = options.valgrind
|
||||
else:
|
||||
print('warning: unrecognized |trace-test| attribute %s'%part)
|
||||
print('warning: unrecognized |jit-test| attribute %s'%part)
|
||||
|
||||
if options.valgrind_all:
|
||||
test.valgrind = True
|
||||
@ -230,7 +230,7 @@ def run_tests(tests, test_dir, lib_dir):
|
||||
|
||||
if OPTIONS.tinderbox:
|
||||
if ok:
|
||||
print('TEST-PASS | trace_test.py | %s'%test.path)
|
||||
print('TEST-PASS | jit_test.py | %s'%test.path)
|
||||
else:
|
||||
lines = [ _ for _ in out.split('\n') + err.split('\n')
|
||||
if _ != '' ]
|
||||
@ -238,7 +238,7 @@ def run_tests(tests, test_dir, lib_dir):
|
||||
msg = lines[-1]
|
||||
else:
|
||||
msg = ''
|
||||
print('TEST-UNEXPECTED-FAIL | trace_test.py | %s: %s'%
|
||||
print('TEST-UNEXPECTED-FAIL | jit_test.py | %s: %s'%
|
||||
(test.path, msg))
|
||||
|
||||
n = i + 1
|
||||
@ -247,7 +247,7 @@ def run_tests(tests, test_dir, lib_dir):
|
||||
pb.update(n)
|
||||
complete = True
|
||||
except KeyboardInterrupt:
|
||||
print('TEST-UNEXPECTED_FAIL | trace_test.py | %s'%test.path)
|
||||
print('TEST-UNEXPECTED_FAIL | jit_test.py | %s'%test.path)
|
||||
|
||||
if pb:
|
||||
pb.finish()
|
||||
@ -289,7 +289,7 @@ def parse_jitflags():
|
||||
for flags in OPTIONS.jitflags.split(',') ]
|
||||
for flags in jitflags:
|
||||
for flag in flags:
|
||||
if flag not in ('-j', '-m', '-d'):
|
||||
if flag not in ('-j', '-m', '-p', '-d'):
|
||||
print('Invalid jit flag: "%s"'%flag)
|
||||
sys.exit(1)
|
||||
return jitflags
|
||||
@ -319,7 +319,7 @@ def main(argv):
|
||||
lib_dir = os.path.join(script_dir, 'lib')
|
||||
|
||||
# The [TESTS] optional arguments are paths of test files relative
|
||||
# to the trace-test/tests directory.
|
||||
# to the jit-test/tests directory.
|
||||
|
||||
from optparse import OptionParser
|
||||
op = OptionParser(usage='%prog [options] JS_SHELL [TESTS]')
|
@ -1,4 +1,4 @@
|
||||
// |trace-test| TMFLAGS: full,fragprofile,treevis
|
||||
// |jit-test| TMFLAGS: full,fragprofile,treevis
|
||||
|
||||
function arith()
|
||||
{
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user