Bug 888083 (part 2) - Remove the final case where a vanilla .h file #includes an inline-header. r=jandem.

--HG--
extra : rebase_source : cd4497c7136e17ca25446644af25294c09108b89
This commit is contained in:
Nicholas Nethercote 2013-07-03 21:57:47 -07:00
Родитель 8243c30f2a
Коммит 17dbf3198f
15 изменённых файлов: 87 добавлений и 58 удалений

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

@ -6,6 +6,8 @@
#include "ion/BacktrackingAllocator.h"
#include "jsprf.h"
using namespace js;
using namespace js::ion;

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

@ -27,7 +27,7 @@ class CompilerRoot : public CompilerRootNode
: CompilerRootNode(NULL)
{
if (ptr) {
JS_ASSERT(!IsInsideNursery(GetIonContext()->compartment->rt, ptr));
JS_ASSERT(!UninlinedIsInsideNursery(GetIonContext()->compartment->rt, ptr));
setRoot(ptr);
}
}

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

@ -4,6 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "jsanalyze.h"
#include "ion/IonBuilder.h"
#include "ion/MIRGraph.h"
#include "ion/Ion.h"

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

@ -4,6 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "jsprf.h"
#include "ion/MIR.h"
#include "ion/MIRGraph.h"
#include "ion/LIR.h"

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

@ -16,6 +16,8 @@
#include "ion/shared/Lowering-shared-inl.h"
#include "mozilla/DebugOnly.h"
#include "jsinferinlines.h"
using namespace js;
using namespace ion;

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

@ -19,6 +19,7 @@
#include "jsstr.h"
#include "jsatominlines.h"
#include "jsinferinlines.h"
#include "vm/Shape-inl.h"

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

@ -13,7 +13,6 @@
#include "jscntxt.h"
#include "jslibmath.h"
#include "jsinfer.h"
#include "jsinferinlines.h"
#include "ion/TypePolicy.h"
#include "ion/IonAllocPolicy.h"
#include "ion/InlineList.h"
@ -26,6 +25,9 @@
#include "vm/ScopeObject.h"
namespace js {
class StringObject;
namespace ion {
class BaselineInspector;

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

@ -4,11 +4,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "jsanalyze.h"
#include "ion/Ion.h"
#include "ion/IonSpewer.h"
#include "ion/MIR.h"
#include "ion/MIRGraph.h"
#include "ion/IonBuilder.h"
#include "jsinferinlines.h"
#include "jsscriptinlines.h"
using namespace js;

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

@ -13,9 +13,10 @@
#include "ion/IonSpewer.h"
#include "ion/UnreachableCodeElimination.h"
#include "ion/IonAnalysis.h"
#include "vm/Stack.h"
#include "jsinferinlines.h"
using namespace js;
using namespace ion;

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

@ -9,6 +9,8 @@
#include <math.h>
#include <stdio.h>
#include "jsanalyze.h"
#include "vm/NumericConversions.h"
#include "ion/Ion.h"

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

@ -5055,6 +5055,12 @@ AutoSuppressGC::AutoSuppressGC(JSCompartment *comp)
suppressGC_++;
}
bool
js::UninlinedIsInsideNursery(JSRuntime *rt, const void *thing)
{
return IsInsideNursery(rt, thing);
}
#ifdef DEBUG
AutoDisableProxyCheck::AutoDisableProxyCheck(JSRuntime *rt
MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)

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

@ -1319,6 +1319,10 @@ struct AutoDisableProxyCheck
void
PurgeJITCaches(JS::Zone *zone);
// This is the same as IsInsideNursery, but not inlined.
bool
UninlinedIsInsideNursery(JSRuntime *rt, const void *thing);
} /* namespace js */
#endif /* jsgc_h */

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

@ -5615,6 +5615,60 @@ types::TypeMonitorResult(JSContext *cx, JSScript *script, jsbytecode *pc, const
types->addType(cx, type);
}
bool
types::UseNewTypeForClone(JSFunction *fun)
{
if (!fun->isInterpreted())
return false;
if (fun->hasScript() && fun->nonLazyScript()->shouldCloneAtCallsite)
return true;
if (fun->isArrow())
return false;
if (fun->hasSingletonType())
return false;
/*
* When a function is being used as a wrapper for another function, it
* improves precision greatly to distinguish between different instances of
* the wrapper; otherwise we will conflate much of the information about
* the wrapped functions.
*
* An important example is the Class.create function at the core of the
* Prototype.js library, which looks like:
*
* var Class = {
* create: function() {
* return function() {
* this.initialize.apply(this, arguments);
* }
* }
* };
*
* Each instance of the innermost function will have a different wrapped
* initialize method. We capture this, along with similar cases, by looking
* for short scripts which use both .apply and arguments. For such scripts,
* whenever creating a new instance of the function we both give that
* instance a singleton type and clone the underlying script.
*/
uint32_t begin, end;
if (fun->hasScript()) {
if (!fun->nonLazyScript()->usesArgumentsAndApply)
return false;
begin = fun->nonLazyScript()->sourceStart;
end = fun->nonLazyScript()->sourceEnd;
} else {
if (!fun->lazyScript()->usesArgumentsAndApply())
return false;
begin = fun->lazyScript()->begin();
end = fun->lazyScript()->end();
}
return end - begin <= 100;
}
/////////////////////////////////////////////////////////////////////
// TypeScript
/////////////////////////////////////////////////////////////////////

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

@ -1136,6 +1136,9 @@ typedef HashSet<ReadBarriered<TypeObject>, TypeObjectEntry, SystemAllocPolicy> T
bool
UseNewType(JSContext *cx, JSScript *script, jsbytecode *pc);
bool
UseNewTypeForClone(JSFunction *fun);
/*
* Whether Array.prototype, or an object on its proto chain, has an
* indexed property.

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

@ -690,61 +690,6 @@ extern void TypeMonitorResult(JSContext *cx, JSScript *script, jsbytecode *pc,
extern void TypeDynamicResult(JSContext *cx, JSScript *script, jsbytecode *pc,
js::types::Type type);
inline bool
UseNewTypeForClone(JSFunction *fun)
{
if (!fun->isInterpreted())
return false;
if (fun->hasScript() && fun->nonLazyScript()->shouldCloneAtCallsite)
return true;
if (fun->isArrow())
return false;
if (fun->hasSingletonType())
return false;
/*
* When a function is being used as a wrapper for another function, it
* improves precision greatly to distinguish between different instances of
* the wrapper; otherwise we will conflate much of the information about
* the wrapped functions.
*
* An important example is the Class.create function at the core of the
* Prototype.js library, which looks like:
*
* var Class = {
* create: function() {
* return function() {
* this.initialize.apply(this, arguments);
* }
* }
* };
*
* Each instance of the innermost function will have a different wrapped
* initialize method. We capture this, along with similar cases, by looking
* for short scripts which use both .apply and arguments. For such scripts,
* whenever creating a new instance of the function we both give that
* instance a singleton type and clone the underlying script.
*/
uint32_t begin, end;
if (fun->hasScript()) {
if (!fun->nonLazyScript()->usesArgumentsAndApply)
return false;
begin = fun->nonLazyScript()->sourceStart;
end = fun->nonLazyScript()->sourceEnd;
} else {
if (!fun->lazyScript()->usesArgumentsAndApply())
return false;
begin = fun->lazyScript()->begin();
end = fun->lazyScript()->end();
}
return end - begin <= 100;
}
/////////////////////////////////////////////////////////////////////
// Script interface functions
/////////////////////////////////////////////////////////////////////