Bug 1051155 - Simplify and clean up TypeNewScript, r=jandem.

This commit is contained in:
Brian Hackett
2014-08-11 10:44:25 -08:00
parent e99655e26a
commit 1d803e743f
8 changed files with 63 additions and 178 deletions

View File

@@ -1686,7 +1686,7 @@ static inline JSObject *
CreateThisForFunctionWithType(JSContext *cx, HandleTypeObject type, JSObject *parent,
NewObjectKind newKind)
{
if (type->hasNewScript()) {
if (type->newScript()) {
/*
* Make an object with the type's associated finalize kind and shape,
* which reflects any properties that will definitely be added to the
@@ -2905,7 +2905,7 @@ JSObject::growSlots(ThreadSafeContext *cx, HandleObject obj, uint32_t oldCount,
* type to give these objects a larger number of fixed slots when future
* objects are constructed.
*/
if (!obj->hasLazyType() && !oldCount && obj->type()->hasNewScript()) {
if (!obj->hasLazyType() && !oldCount && obj->type()->newScript()) {
JSObject *oldTemplate = obj->type()->newScript()->templateObject;
gc::AllocKind kind = gc::GetGCObjectFixedSlotsKind(oldTemplate->numFixedSlots());
uint32_t newScriptSlots = gc::GetGCKindSlots(kind);