Merge last PGO-green changeset of mozilla-inbound to mozilla-central

This commit is contained in:
Ed Morley 2012-06-18 15:25:23 +01:00
commit 81c2a5bad7
12 changed files with 39 additions and 77 deletions

View File

@ -112,7 +112,7 @@ function testPI(aTarget, aData, aShouldSucceed, aReason)
testComment("Some text");
testComment("Some text with a '-' in it");
testComment("Some text with a '-' and a '-' and another '-'");
testComment("Some text -- this shouldn't create a node!");
testComment("Some text -- this should create a node!");
testComment("<!-- This is an HTML comment -->");
testCDATASection("Some text", true);

View File

@ -138,15 +138,23 @@ nsDOMDeviceStorage::SetRootFileForType(const nsAString& aType, const PRInt32 aIn
nsCOMPtr<nsIProperties> dirService = do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID);
NS_ASSERTION(dirService, "Must have directory service");
#ifdef MOZ_WIDGET_GONK
// check that /sdcard exists, if it doesn't go no further.
NS_NewLocalFile(NS_LITERAL_STRING("/sdcard"), false, getter_AddRefs(f));
bool check = false;
f->Exists(&check);
if (!check) {
mFile = nsnull;
return typeResult;
}
f = nsnull;
#endif
// Picture directory
if (aType.Equals(NS_LITERAL_STRING("pictures"))) {
#ifdef MOZ_WIDGET_GONK
if (aIndex == 0) {
NS_NewLocalFile(NS_LITERAL_STRING("/data/pictures"), false, getter_AddRefs(f));
}
else if (aIndex == 1) {
NS_NewLocalFile(NS_LITERAL_STRING("/sdcard/DCIM"), false, getter_AddRefs(f));
typeResult = DEVICE_STORAGE_TYPE_EXTERNAL;
NS_NewLocalFile(NS_LITERAL_STRING("/sdcard/Pictures"), false, getter_AddRefs(f));
}
#elif defined (MOZ_WIDGET_COCOA)
if (aIndex == 0) {
@ -163,11 +171,7 @@ nsDOMDeviceStorage::SetRootFileForType(const nsAString& aType, const PRInt32 aIn
if (aType.Equals(NS_LITERAL_STRING("videos"))) {
#ifdef MOZ_WIDGET_GONK
if (aIndex == 0) {
NS_NewLocalFile(NS_LITERAL_STRING("/data/videos"), false, getter_AddRefs(f));
}
else if (aIndex == 1) {
NS_NewLocalFile(NS_LITERAL_STRING("/sdcard/videos"), false, getter_AddRefs(f));
typeResult = DEVICE_STORAGE_TYPE_EXTERNAL;
NS_NewLocalFile(NS_LITERAL_STRING("/sdcard/Movies"), false, getter_AddRefs(f));
}
#elif defined (MOZ_WIDGET_COCOA)
if (aIndex == 0) {
@ -184,11 +188,7 @@ nsDOMDeviceStorage::SetRootFileForType(const nsAString& aType, const PRInt32 aIn
if (aType.Equals(NS_LITERAL_STRING("music"))) {
#ifdef MOZ_WIDGET_GONK
if (aIndex == 0) {
NS_NewLocalFile(NS_LITERAL_STRING("/data/music"), false, getter_AddRefs(f));
}
else if (aIndex == 1) {
NS_NewLocalFile(NS_LITERAL_STRING("/sdcard/music"), false, getter_AddRefs(f));
typeResult = DEVICE_STORAGE_TYPE_EXTERNAL;
NS_NewLocalFile(NS_LITERAL_STRING("/sdcard/Music"), false, getter_AddRefs(f));
}
#elif defined (MOZ_WIDGET_COCOA)
if (aIndex == 0) {

View File

@ -533,7 +533,7 @@ LockedFile::SetLocation(JSContext* aCx,
return NS_OK;
}
PRUint64 location;
uint64_t location;
if (!xpc::ValueToUint64(aCx, aLocation, &location)) {
return NS_ERROR_TYPE_ERR;
}

View File

@ -9,9 +9,9 @@
#include "unistd.h"
#endif // defined(XP_UNIX)
#if defined(XP_MACOSX) || defined(__FreeBSD__) || defined(__OpenBSD__)
#if defined(XP_MACOSX)
#include "copyfile.h"
#endif // defined(XP_MAC) || defined(__FreeBSD__) || defined(__OpenBSD__)
#endif // defined(XP_MACOSX)
#if defined(XP_WIN)
#include <windows.h>

View File

@ -34,13 +34,6 @@ MarkInnerAndOuterFunctions(JSContext *cx, JSScript* script_)
JSScript *outer = worklist.back();
worklist.popBack();
/*
* If outer has an extensible scope, its slots may be resized which
* will invalidate nesting->varArray/argArray.
*/
if (outer->funHasExtensibleScope)
continue;
if (outer->hasObjects()) {
ObjectArray *arr = outer->objects();

View File

@ -1,20 +0,0 @@
var g = newGlobal('new-compartment');
var dbg = new Debugger(g);
var fscript = null;
dbg.onNewScript = function(script) {
dbg.onNewScript = undefined;
fscript = script.getChildScripts()[0];
assertEq(fscript.staticLevel, 1);
}
g.eval("function f(x) { arguments[0] = 3; return x }");
assertEq(fscript !== null, true);
fscript.setBreakpoint(0, {hit:function(frame) {
assertEq(frame.eval('x').return, 1);
assertEq(frame.arguments[0], 1);
return {return:42};
}});
assertEq(g.f(1), 42);

View File

@ -5259,14 +5259,15 @@ NestingPrologue(JSContext *cx, StackFrame *fp)
/*
* Check the stack has no frames for this activation, any of its inner
* functions or any of their transitive inner functions.
*
* Also, if the script has an extensible scope, then the arg/var array
* can be moved unexpectedly, so abort the optimization.
*/
if (!ClearActiveNesting(script)) {
if (!ClearActiveNesting(script) || script->funHasExtensibleScope) {
script->reentrantOuterFunction = true;
MarkTypeObjectFlags(cx, fp->fun(), OBJECT_FLAG_REENTRANT_FUNCTION);
}
/* Extensibility guards in the frontend guarantee the slots won't move. */
JS_ASSERT(!script->funHasExtensibleScope);
nesting->activeCall = &fp->callObj();
nesting->argArray = Valueify(nesting->activeCall->argArray());
nesting->varArray = Valueify(nesting->activeCall->varArray());

View File

@ -3169,10 +3169,10 @@ DebuggerArguments_getArg(JSContext *cx, unsigned argc, Value *vp)
if (unsigned(i) < fp->numActualArgs()) {
if (unsigned(i) < fp->numFormalArgs() && fp->script()->formalLivesInCallObject(i))
arg = fp->callObj().arg(i);
else if (fp->script()->argsObjAliasesFormals() && fp->hasArgsObj())
else if (fp->script()->argsObjAliasesFormals())
arg = fp->argsObj().arg(i);
else
arg = fp->unaliasedActual(i, DONT_CHECK_ALIASING);
arg = fp->unaliasedActual(i);
} else {
arg.setUndefined();
}

View File

@ -191,10 +191,10 @@ CallObject::copyUnaliasedValues(StackFrame *fp)
/* Copy the unaliased formals. */
for (unsigned i = 0; i < script->bindings.numArgs(); ++i) {
if (!script->formalLivesInCallObject(i)) {
if (script->argsObjAliasesFormals() && fp->hasArgsObj())
if (script->argsObjAliasesFormals())
setArg(i, fp->argsObj().arg(i), DONT_CHECK_ALIASING);
else
setArg(i, fp->unaliasedFormal(i, DONT_CHECK_ALIASING), DONT_CHECK_ALIASING);
setArg(i, fp->unaliasedFormal(i), DONT_CHECK_ALIASING);
}
}
@ -1113,7 +1113,7 @@ class DebugScopeProxy : public BaseProxyHandler
* This function handles access to unaliased locals/formals. If such
* accesses were passed on directly to the DebugScopeObject::scope, they
* would not be reading/writing the canonical location for the variable,
* which is on the stack. Thus, handleUnaliasedAccess must translate
* which is on the stack. Thus, handleUn must translate would-be
* accesses to scope objects into analogous accesses of the stack frame.
*
* handleUnaliasedAccess returns 'true' if the access was unaliased and
@ -1162,16 +1162,16 @@ class DebugScopeProxy : public BaseProxyHandler
return false;
if (maybefp) {
if (script->argsObjAliasesFormals() && maybefp->hasArgsObj()) {
if (script->argsObjAliasesFormals()) {
if (action == GET)
*vp = maybefp->argsObj().arg(i);
else
maybefp->argsObj().setArg(i, *vp);
} else {
if (action == GET)
*vp = maybefp->unaliasedFormal(i, DONT_CHECK_ALIASING);
*vp = maybefp->unaliasedFormal(i);
else
maybefp->unaliasedFormal(i, DONT_CHECK_ALIASING) = *vp;
maybefp->unaliasedFormal(i) = *vp;
}
} else {
if (action == GET)

View File

@ -252,10 +252,10 @@ StackFrame::unaliasedFormal(unsigned i, MaybeCheckAliasing checkAliasing)
}
inline Value &
StackFrame::unaliasedActual(unsigned i, MaybeCheckAliasing checkAliasing)
StackFrame::unaliasedActual(unsigned i)
{
JS_ASSERT(i < numActualArgs());
JS_ASSERT_IF(checkAliasing && i < numFormalArgs(), !script()->formalIsAliased(i));
JS_ASSERT(!script()->formalIsAliased(i));
return i < numFormalArgs() ? formals()[i] : actuals()[i];
}

View File

@ -591,7 +591,7 @@ class StackFrame
bool hasArgs() const { return isNonEvalFunctionFrame(); }
inline Value &unaliasedFormal(unsigned i, MaybeCheckAliasing = CHECK_ALIASING);
inline Value &unaliasedActual(unsigned i, MaybeCheckAliasing = CHECK_ALIASING);
inline Value &unaliasedActual(unsigned i);
template <class Op> inline void forEachUnaliasedActual(Op op);
inline unsigned numFormalArgs() const;
@ -1011,24 +1011,11 @@ class StackFrame
return !!(flags_ & CONSTRUCTING);
}
/*
* These two queries should not be used in general: the presence/absence of
* the call/args object is determined by the static(ish) properties of the
* JSFunction/JSScript. These queries should only be performed when probing
* a stack frame that may be in the middle of the prologue (during which
* time the call/args object are created).
*/
bool hasCallObj() const {
JS_ASSERT(isStrictEvalFrame() || fun()->isHeavyweight());
return flags_ & HAS_CALL_OBJ;
}
bool hasArgsObj() const {
JS_ASSERT(script()->needsArgsObj());
return flags_ & HAS_ARGS_OBJ;
}
/*
* The method JIT call/apply optimization can erase Function.{call,apply}
* invocations from the stack and push the callee frame directly. The base

View File

@ -5327,6 +5327,7 @@ var Telemetry = {
prompt: function prompt() {
let serverOwner = Services.prefs.getCharPref(this._PREF_TELEMETRY_SERVER_OWNER);
let telemetryPrompted = null;
let self = this;
try {
telemetryPrompted = Services.prefs.getIntPref(this._PREF_TELEMETRY_PROMPTED);
} catch (e) { /* Optional */ }
@ -5343,15 +5344,15 @@ var Telemetry = {
{
label: Strings.browser.GetStringFromName("telemetry.optin.yes"),
callback: function () {
Services.prefs.setIntPref(this._PREF_TELEMETRY_PROMPTED, this._TELEMETRY_PROMPT_REV);
Services.prefs.setBoolPref(this._PREF_TELEMETRY_ENABLED, true);
Services.prefs.setIntPref(self._PREF_TELEMETRY_PROMPTED, self._TELEMETRY_PROMPT_REV);
Services.prefs.setBoolPref(self._PREF_TELEMETRY_ENABLED, true);
}
},
{
label: Strings.browser.GetStringFromName("telemetry.optin.no"),
callback: function () {
Services.prefs.setIntPref(this._PREF_TELEMETRY_PROMPTED, this._TELEMETRY_PROMPT_REV);
Services.prefs.setBoolPref(this._PREF_TELEMETRY_REJECTED, true);
Services.prefs.setIntPref(self._PREF_TELEMETRY_PROMPTED, self._TELEMETRY_PROMPT_REV);
Services.prefs.setBoolPref(self._PREF_TELEMETRY_REJECTED, true);
}
}
];