Bug 886205 (part 8) - Break the header cycle once and for all. r=terrence.

--HG--
extra : rebase_source : 3ec3faa03c3396ec6ef679e048d5765b99816e9d
This commit is contained in:
Nicholas Nethercote 2013-06-25 21:38:35 -07:00
Родитель 924c5002e5
Коммит 94d1b1a28c
23 изменённых файлов: 87 добавлений и 41 удалений

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

@ -14,10 +14,12 @@
#include "vm/GlobalObject.h"
#include "jsobjinlines.h"
#include "jsscriptinlines.h"
#include "frontend/ParseMaps-inl.h"
#include "frontend/Parser-inl.h"
#include "frontend/SharedContext-inl.h"
#include "vm/ScopeObject-inl.h"
using namespace js;
using namespace js::frontend;

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

@ -4,20 +4,24 @@
* 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 "jscntxt.h"
#include "jscompartment.h"
#include "jsinfer.h"
#include "Bailouts.h"
#include "SnapshotReader.h"
#include "Ion.h"
#include "IonCompartment.h"
#include "IonSpewer.h"
#include "jsinfer.h"
#include "jsanalyze.h"
#include "jsinferinlines.h"
#include "vm/Interpreter.h"
#include "IonFrames-inl.h"
#include "BaselineJIT.h"
#include "jsinferinlines.h"
#include "ion/IonFrames-inl.h"
#include "vm/Stack-inl.h"
using namespace js;
using namespace js::ion;

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

@ -9,6 +9,8 @@
#ifdef JS_ION
#include "ion/BaselineFrame.h"
#include "jscntxt.h"
#include "jscompartment.h"

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

@ -5,15 +5,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "BaselineFrame.h"
#include "BaselineFrame-inl.h"
#include "BaselineIC.h"
#include "BaselineJIT.h"
#include "Ion.h"
#include "IonFrames-inl.h"
#include "vm/Debugger.h"
#include "vm/ScopeObject.h"
#include "ion/BaselineFrame-inl.h"
#include "ion/IonFrames-inl.h"
#include "vm/Stack-inl.h"
using namespace js;
using namespace js::ion;

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

@ -11,6 +11,8 @@
#include "jsanalyze.h"
#include "jsinferinlines.h"
#include "vm/Shape-inl.h"
using namespace js;
using namespace js::ion;

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

@ -10,6 +10,7 @@
#include "builtin/Eval.h"
#include "frontend/SourceNotes.h"
#include "ion/BaselineFrame.h"
#include "ion/BaselineInspector.h"
#include "ion/Ion.h"
#include "ion/IonAnalysis.h"
@ -18,12 +19,14 @@
#include "ion/Lowering.h"
#include "ion/MIRGraph.h"
#include "CompileInfo-inl.h"
#include "ExecutionModeInlines.h"
#include "jsanalyzeinlines.h"
#include "jsscriptinlines.h"
#include "jstypedarrayinlines.h"
#include "ion/CompileInfo-inl.h"
#include "ion/ExecutionModeInlines.h"
#include "vm/ScopeObject-inl.h"
#ifdef JS_THREADSAFE
# include "prthread.h"
#endif

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

@ -13,6 +13,8 @@
#include "ion/IonFrameIterator.h"
#include "ion/LIR.h"
#include "ion/IonFrameIterator-inl.h"
namespace js {
namespace ion {

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

@ -10,6 +10,7 @@
#include "ion/AsmJS.h"
#include "ion/Bailouts.h"
#include "ion/BaselineFrame.h"
#include "ion/BaselineIC.h"
#include "ion/BaselineJIT.h"
#include "ion/BaselineRegisters.h"

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

@ -13,6 +13,8 @@
#include "MIRGraph.h"
#include "IonBuilder.h"
#include "jsscriptinlines.h"
#include "vm/StringObject-inl.h"
namespace js {

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

@ -9,9 +9,11 @@
#include "CodeGenerator-x64.h"
#include "ion/MIR.h"
#include "ion/MIRGraph.h"
#include "ion/shared/CodeGenerator-shared-inl.h"
#include "vm/Shape.h"
#include "jsscriptinlines.h"
#include "ion/shared/CodeGenerator-shared-inl.h"
#include "vm/Shape-inl.h"
using namespace js;

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

@ -54,6 +54,8 @@
#include "jscntxtinlines.h"
#include "jsobjinlines.h"
#include "vm/Stack-inl.h"
using namespace js;
using namespace js::gc;

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

@ -75,6 +75,7 @@
#include "gc/FindSCCs-inl.h"
#include "vm/String-inl.h"
#include "vm/Stack-inl.h"
#ifdef XP_WIN
# include "jswin.h"

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

@ -6,6 +6,9 @@
/* Inline members for javascript type inference. */
#ifndef jsinferinlines_h
#define jsinferinlines_h
#include "mozilla/PodOperations.h"
#include "jsarray.h"
@ -26,12 +29,9 @@
#include "vm/StringObject.h"
#include "jsanalyzeinlines.h"
#include "jscntxtinlines.h"
#include "gc/Barrier-inl.h"
#include "vm/Stack-inl.h"
#ifndef jsinferinlines_h
#define jsinferinlines_h
inline bool
js::TaggedProto::isObject() const
@ -925,7 +925,7 @@ SetInitializerObjectType(JSContext *cx, HandleScript script, jsbytecode *pc, Han
types::TypeObject *type = TypeScript::InitObject(cx, script, pc, key);
if (!type)
return false;
obj->setType(type);
obj->uninlinedSetType(type);
}
return true;
@ -1497,7 +1497,7 @@ TypeSet::getTypeOrSingleObject(JSContext *cx, unsigned i) const
JSObject *singleton = getSingleObject(i);
if (!singleton)
return NULL;
type = singleton->getType(cx);
type = singleton->uninlinedGetType(cx);
if (!type)
cx->compartment()->types.setPendingNukeTypes(cx);
}

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

@ -47,6 +47,7 @@
#include "jstypedarrayinlines.h"
#include "builtin/Iterator-inl.h"
#include "vm/ArrayObject-inl.h"
#include "vm/ArgumentsObject-inl.h"
#include "vm/BooleanObject-inl.h"
#include "vm/NumberObject-inl.h"
#include "vm/RegExpStatics-inl.h"
@ -1103,6 +1104,18 @@ js_PopulateObject(JSContext *cx, HandleObject newborn, HandleObject props)
return DefineProperties(cx, newborn, props);
}
js::types::TypeObject*
JSObject::uninlinedGetType(JSContext *cx)
{
return getType(cx);
}
void
JSObject::uninlinedSetType(js::types::TypeObject *newType)
{
setType(newType);
}
/* static */ inline unsigned
JSObject::getSealedOrFrozenAttributes(unsigned attrs, ImmutabilityType it)
{
@ -5155,7 +5168,7 @@ DumpProperty(JSObject *obj, Shape &shape)
}
bool
JSObject::isProxySlow() const
JSObject::uninlinedIsProxy() const
{
return isProxy();
}

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

@ -405,7 +405,9 @@ class JSObject : public js::ObjectImpl
*/
static inline bool setSingletonType(JSContext *cx, js::HandleObject obj);
// uninlinedGetType() is the same as getType(), but not inlined.
inline js::types::TypeObject* getType(JSContext *cx);
js::types::TypeObject* uninlinedGetType(JSContext *cx);
const js::HeapPtr<js::types::TypeObject> &typeFromGC() const {
/* Direct field access for use by GC. */
@ -424,15 +426,17 @@ class JSObject : public js::ObjectImpl
* If obj is a proxy and the proto is lazy, this code may allocate or
* GC in order to compute the proto. Currently, it will not run JS code.
*/
bool isProxySlow() const;
bool uninlinedIsProxy() const;
JSObject *getProto() const {
JS_ASSERT(!isProxySlow());
JS_ASSERT(!uninlinedIsProxy());
return js::ObjectImpl::getProto();
}
static inline bool getProto(JSContext *cx, js::HandleObject obj,
js::MutableHandleObject protop);
// uninlinedSetType() is the same as setType(), but not inlined.
inline void setType(js::types::TypeObject *newType);
void uninlinedSetType(js::types::TypeObject *newType);
js::types::TypeObject *getNewType(JSContext *cx, js::Class *clasp, JSFunction *fun = NULL);
@ -555,7 +559,7 @@ class JSObject : public js::ObjectImpl
}
uint32_t getDenseCapacity() {
JS_ASSERT(isNativeSlow());
JS_ASSERT(uninlinedIsNative());
JS_ASSERT(getElementsHeader()->capacity >= getElementsHeader()->initializedLength);
return getElementsHeader()->capacity;
}
@ -578,7 +582,7 @@ class JSObject : public js::ObjectImpl
inline void moveDenseElementsUnbarriered(uint32_t dstStart, uint32_t srcStart, uint32_t count);
bool shouldConvertDoubleElements() {
JS_ASSERT(isNativeSlow());
JS_ASSERT(uninlinedIsNative());
return getElementsHeader()->shouldConvertDoubleElements();
}

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

@ -15,12 +15,15 @@
#include "vm/DateObject.h"
#include "vm/NumberObject.h"
#include "vm/Probes.h"
#include "vm/ScopeObject.h"
#include "vm/StringObject.h"
#include "jsatominlines.h"
#include "jscompartmentinlines.h"
#include "jsinferinlines.h"
#include "vm/ObjectImpl-inl.h"
#include "vm/Shape-inl.h"
/* static */ inline JSBool
JSObject::setGenericAttributes(JSContext *cx, js::HandleObject obj,

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

@ -11,6 +11,7 @@
#include "jsobj.h"
#include "jstypedarray.h"
#include "jscntxtinlines.h"
#include "jsobjinlines.h"
// Sentinel value used to initialize ArrayBufferViews' NEXT_BUFFER_SLOTs to

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

@ -12,6 +12,7 @@
#include "mozilla/MemoryReporting.h"
#include "vm/ScopeObject.h"
#include "vm/ScopeObject-inl.h"
namespace js {

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

@ -18,13 +18,13 @@
using namespace js;
bool
js::ObjectImpl::isNativeSlow() const
js::ObjectImpl::uninlinedIsNative() const
{
return isNative();
}
uint32_t
js::ObjectImpl::slotSpanSlow() const
js::ObjectImpl::uninlinedSlotSpan() const
{
return slotSpan();
}

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

@ -1247,24 +1247,24 @@ class ObjectImpl : public gc::Cell
preventExtensions(JSContext *cx, Handle<ObjectImpl*> obj);
HeapSlotArray getDenseElements() {
JS_ASSERT(isNativeSlow());
JS_ASSERT(uninlinedIsNative());
return HeapSlotArray(elements);
}
const Value &getDenseElement(uint32_t idx) {
JS_ASSERT(isNativeSlow());
JS_ASSERT(uninlinedIsNative());
MOZ_ASSERT(idx < getDenseInitializedLength());
return elements[idx];
}
bool containsDenseElement(uint32_t idx) {
JS_ASSERT(isNativeSlow());
JS_ASSERT(uninlinedIsNative());
return idx < getDenseInitializedLength() && !elements[idx].isMagic(JS_ELEMENTS_HOLE);
}
uint32_t getDenseInitializedLength() {
JS_ASSERT(isNativeSlow());
JS_ASSERT(uninlinedIsNative());
return getElementsHeader()->initializedLength;
}
uint32_t getDenseCapacity() {
JS_ASSERT(isNativeSlow());
JS_ASSERT(uninlinedIsNative());
return getElementsHeader()->capacity;
}
@ -1425,9 +1425,9 @@ class ObjectImpl : public gc::Cell
inline JSCompartment *compartment() const;
// isNativeSlow() is equivalent to isNative(), but isn't inlined.
// uninlinedIsNative() is equivalent to isNative(), but isn't inlined.
inline bool isNative() const;
bool isNativeSlow() const;
bool uninlinedIsNative() const;
types::TypeObject *type() const {
MOZ_ASSERT(!hasLazyType());
@ -1450,9 +1450,9 @@ class ObjectImpl : public gc::Cell
*/
bool hasLazyType() const { return type_->lazy(); }
// slotSpanSlow() is the same as slotSpan(), but isn't inlined.
// uninlinedSlotSpan() is the same as slotSpan(), but isn't inlined.
inline uint32_t slotSpan() const;
uint32_t slotSpanSlow() const;
uint32_t uninlinedSlotSpan() const;
/* Compute dynamicSlotsCount() for this object. */
inline uint32_t numDynamicSlots() const;
@ -1552,11 +1552,11 @@ class ObjectImpl : public gc::Cell
}
HeapSlot &nativeGetSlotRef(uint32_t slot) {
JS_ASSERT(isNativeSlow() && slot < slotSpanSlow());
JS_ASSERT(uninlinedIsNative() && slot < uninlinedSlotSpan());
return getSlotRef(slot);
}
const Value &nativeGetSlot(uint32_t slot) const {
JS_ASSERT(isNativeSlow() && slot < slotSpanSlow());
JS_ASSERT(uninlinedIsNative() && slot < uninlinedSlotSpan());
return getSlot(slot);
}

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

@ -39,13 +39,6 @@ JSObject::enclosingScope()
namespace js {
inline
ScopeCoordinate::ScopeCoordinate(jsbytecode *pc)
: hops(GET_UINT16(pc)), slot(GET_UINT16(pc + 2))
{
JS_ASSERT(JOF_OPTYPE(*pc) == JOF_SCOPECOORD);
}
inline void
ScopeObject::setEnclosingScope(HandleObject obj)
{

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

@ -19,6 +19,7 @@
#include "gc/Barrier-inl.h"
#include "vm/ScopeObject-inl.h"
#include "vm/Stack-inl.h"
using namespace js;
using namespace js::types;

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

@ -89,7 +89,12 @@ struct ScopeCoordinate
uint16_t hops;
uint16_t slot;
inline ScopeCoordinate(jsbytecode *pc);
inline ScopeCoordinate(jsbytecode *pc)
: hops(GET_UINT16(pc)), slot(GET_UINT16(pc + 2))
{
JS_ASSERT(JOF_OPTYPE(*pc) == JOF_SCOPECOORD);
}
inline ScopeCoordinate() {}
};