author | Ms2ger <ms2ger@gmail.com> |
Fri, 18 May 2012 10:29:40 +0200 | |
changeset 94327 | 01d962e8982e90fc9ca79176362e91c9df2d0e34 |
parent 94326 | bf96cfd84803d673557ef2f90f275cf685d6906c |
child 94328 | 6d219f7754f0cd4d94fe338c8f92decd5cc11830 |
push id | 22706 |
push user | Ms2ger@gmail.com |
push date | Fri, 18 May 2012 08:31:47 +0000 |
treeherder | mozilla-central@4b74c82dd5ab [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | Waldo |
bugs | 744935 |
milestone | 15.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
js/src/jscntxt.h | file | annotate | diff | comparison | revisions | |
js/src/jscntxtinlines.h | file | annotate | diff | comparison | revisions | |
js/src/jscompartment.h | file | annotate | diff | comparison | revisions | |
js/src/jsobj.cpp | file | annotate | diff | comparison | revisions | |
js/src/jsscope.cpp | file | annotate | diff | comparison | revisions |
--- a/js/src/jscntxt.h +++ b/js/src/jscntxt.h @@ -1175,16 +1175,18 @@ struct JSContext : js::ContextFriendFiel bool hasStrictOption() const { return hasRunOption(JSOPTION_STRICT); } bool hasWErrorOption() const { return hasRunOption(JSOPTION_WERROR); } bool hasAtLineOption() const { return hasRunOption(JSOPTION_ATLINE); } js::LifoAlloc &tempLifoAlloc() { return runtime->tempLifoAlloc; } inline js::LifoAlloc &typeLifoAlloc(); + inline js::PropertyTree &propertyTree(); + #ifdef JS_THREADSAFE unsigned outstandingRequests;/* number of JS_BeginRequest calls without the corresponding JS_EndRequest. */ #endif /* Stored here to avoid passing it around as a parameter. */ unsigned resolveFlags;
--- a/js/src/jscntxtinlines.h +++ b/js/src/jscntxtinlines.h @@ -609,16 +609,22 @@ inline bool JSContext::ensureParseMapPool() { if (parseMapPool_) return true; parseMapPool_ = js::OffTheBooks::new_<js::ParseMapPool>(this); return parseMapPool_; } +inline js::PropertyTree& +JSContext::propertyTree() +{ + return compartment->propertyTree; +} + /* Get the current frame, first lazily instantiating stack frames if needed. */ static inline js::StackFrame * js_GetTopStackFrame(JSContext *cx, FrameExpandKind expand) { #ifdef JS_METHODJIT if (expand) js::mjit::ExpandInlineFrames(cx->compartment); #endif
--- a/js/src/jscompartment.h +++ b/js/src/jscompartment.h @@ -403,18 +403,16 @@ class js::AutoDebugModeGC void scheduleGC(JSCompartment *compartment) { JS_ASSERT(!rt->gcRunning); PrepareCompartmentForGC(compartment); needGC = true; } }; -#define JS_PROPERTY_TREE(cx) ((cx)->compartment->propertyTree) - inline void JSContext::setCompartment(JSCompartment *compartment) { this->compartment = compartment; this->inferenceEnabled = compartment ? compartment->types.inferenceEnabled : false; } #ifdef _MSC_VER
--- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -82,16 +82,17 @@ #include "frontend/TreeContext.h" #include "gc/Marking.h" #include "js/MemoryMetrics.h" #include "vm/StringBuffer.h" #include "vm/Xdr.h" #include "jsarrayinlines.h" #include "jsatominlines.h" +#include "jscntxtinlines.h" #include "jsinterpinlines.h" #include "jsobjinlines.h" #include "jsscopeinlines.h" #include "jsscriptinlines.h" #include "vm/MethodGuard-inl.h" #include "jsautooplen.h" @@ -2551,17 +2552,17 @@ JSObject::sealOrFreeze(JSContext *cx, Im for (size_t i = 0; i < shapes.length(); i++) { StackShape child(shapes[i]); child.attrs |= getSealedOrFrozenAttributes(child.attrs, it); if (!JSID_IS_EMPTY(child.propid)) MarkTypePropertyConfigured(cx, self, child.propid); - last = JS_PROPERTY_TREE(cx).getChild(cx, last, self->numFixedSlots(), child); + last = cx->propertyTree().getChild(cx, last, self->numFixedSlots(), child); if (!last) return NULL; } JS_ASSERT(self->lastProperty()->slotSpan() == last->slotSpan()); JS_ALWAYS_TRUE(self->setLastProperty(cx, last)); } else { for (size_t i = 0; i < props.length(); i++) {
--- a/js/src/jsscope.cpp +++ b/js/src/jsscope.cpp @@ -55,16 +55,17 @@ #include "jsnum.h" #include "jsobj.h" #include "jsscope.h" #include "jsstr.h" #include "js/MemoryMetrics.h" #include "jsatominlines.h" +#include "jscntxtinlines.h" #include "jsobjinlines.h" #include "jsscopeinlines.h" using namespace js; using namespace js::gc; bool ShapeTable::init(JSRuntime *rt, Shape *lastProp) @@ -305,17 +306,17 @@ ShapeTable::grow(JSContext *cx) return true; } Shape * Shape::getChildBinding(JSContext *cx, const StackShape &child) { JS_ASSERT(!inDictionary()); - Shape *shape = JS_PROPERTY_TREE(cx).getChild(cx, this, numFixedSlots(), child); + Shape *shape = cx->propertyTree().getChild(cx, this, numFixedSlots(), child); if (shape) { //JS_ASSERT(shape->parent == this); // XXX 'this' is not rooted here /* * Update the number of fixed slots which bindings of this shape will * have. Bindings are constructed as new properties come in, so the * call object allocation class is not known ahead of time. Compute * the fixed slot count here, which will feed into call objects created @@ -358,17 +359,17 @@ Shape::replaceLastProperty(JSContext *cx UnownedBaseShape *nbase = BaseShape::getUnowned(cx, base); if (!nbase) return NULL; StackShape child(shape); child.base = nbase; - return JS_PROPERTY_TREE(cx).getChild(cx, shape->parent, shape->numFixedSlots(), child); + return cx->propertyTree().getChild(cx, shape->parent, shape->numFixedSlots(), child); } /* * Get or create a property-tree or dictionary child property of |parent|, * which must be lastProperty() if inDictionaryMode(), else parent must be * one of lastProperty() or lastProperty()->parent. */ Shape * @@ -406,17 +407,17 @@ JSObject::getChildProperty(JSContext *cx if (!shape) return NULL; if (child.hasSlot() && child.slot() >= self->lastProperty()->base()->slotSpan()) { if (!self->setSlotSpan(cx, child.slot() + 1)) return NULL; } shape->initDictionaryShape(child, self->numFixedSlots(), &self->shape_); } else { - shape = JS_PROPERTY_TREE(cx).getChild(cx, parent, self->numFixedSlots(), child); + shape = cx->propertyTree().getChild(cx, parent, self->numFixedSlots(), child); if (!shape) return NULL; //JS_ASSERT(shape->parent == parent); //JS_ASSERT_IF(parent != lastProperty(), parent == lastProperty()->parent); if (!self->setLastProperty(cx, shape)) return NULL; } @@ -1326,17 +1327,17 @@ EmptyShape::getInitialShape(JSContext *c RootedVar<UnownedBaseShape*> nbase(cx); StackBaseShape base(clasp, parent, objectFlags); nbase = BaseShape::getUnowned(cx, base); if (!nbase) return NULL; - Shape *shape = JS_PROPERTY_TREE(cx).newShape(cx); + Shape *shape = cx->propertyTree().newShape(cx); if (!shape) return NULL; new (shape) EmptyShape(nbase, nfixed); InitialShapeEntry entry; entry.shape = shape; entry.proto = lookup.proto;