From 0ce6927f43e5891c567a5a62c47e56b8ed6b590e Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Tue, 7 Jan 2014 13:55:06 -0500 Subject: [PATCH] Bug 952777 - part 3 - use bitfields for integer fields in JSJitInfo; r=efaust,bz --- dom/bindings/Codegen.py | 8 ++++---- js/src/jsfriendapi.h | 19 ++++++++++--------- js/src/shell/js.cpp | 12 ++++++------ 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index fe163799af90..6b134662ed8e 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -6365,17 +6365,17 @@ class CGMemberJITInfo(CGThing): " %s,\n" " %s,\n" " JSJitInfo::%s,\n" + " %s, /* returnType. Not relevant for setters. */\n" " %s, /* isInfallible. False in setters. */\n" " %s, /* isMovable. Not relevant for setters. */\n" " %s, /* isInSlot. Only relevant for getters. */\n" - " %s, /* returnType. Not relevant for setters. */\n" - " JSJitInfo::%s, /* aliasSet. Not relevant for setters. */\n" " %s, /* Reserved slot index, if we're stored in a slot, else 0. */\n" + " JSJitInfo::%s, /* aliasSet. Not relevant for setters. */\n" " %s, /* argTypes. Only relevant for methods */\n" " nullptr /* parallelNative */\n" "};\n" % (argTypesDecl, infoName, opName, protoID, depth, - opType, failstr, movablestr, slotStr, returnType, - aliasSet, slotIndex, argTypes)) + opType, returnType, failstr, movablestr, slotStr, + slotIndex, aliasSet, argTypes)) def define(self): if self.member.isAttr(): diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index ba64bd3c7e88..35f755d65ee0 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -1511,13 +1511,16 @@ struct JSJitInfo { // change that, come up with a different way of implementing // isDOMJitInfo(). OpType type; - bool isInfallible; /* Is op fallible? False in setters. */ - bool isMovable; /* Is op movable? To be movable the op must not - AliasEverything, but even that might not be - enough (e.g. in cases when it can throw). */ - bool isInSlot; /* True if this is a getter that can get a member - from a slot of the "this" object directly. */ JSValueType returnType; /* The return type tag. Might be JSVAL_TYPE_UNKNOWN */ + uint16_t isInfallible : 1; /* Is op fallible? False in setters. */ + uint16_t isMovable : 1; /* Is op movable? To be movable the op must + not AliasEverything, but even that might + not be enough (e.g. in cases when it can + throw). */ + uint16_t isInSlot : 1; /* True if this is a getter that can get a member + from a slot of the "this" object directly. */ + uint16_t slotIndex : 13; /* If isInSlot is true, the index of the slot to + get the value from. Otherwise 0. */ AliasSet aliasSet; /* The alias set for this op. This is a _minimal_ alias set; in particular for a method it does not @@ -1526,8 +1529,6 @@ struct JSJitInfo { of the actual argument types being passed in. */ // XXXbz should we have a JSGetterJitInfo subclass or something? // XXXbz should we have a JSValueType for the type of the member? - uint16_t slotIndex; /* If isInSlot is true, the index of the slot to get - the value from. Otherwise 0. */ const ArgType* const argTypes; /* For a method, a list of sets of types that the function expects. This can be used, for example, to figure out when argument @@ -1551,7 +1552,7 @@ private: }; #define JS_JITINFO_NATIVE_PARALLEL(op) \ - {{nullptr},0,0,JSJitInfo::OpType_None,false,false,false,JSVAL_TYPE_MISSING,JSJitInfo::AliasEverything,0,nullptr,op} + {{nullptr},0,0,JSJitInfo::OpType_None,JSVAL_TYPE_MISSING,false,false,false,0,JSJitInfo::AliasEverything,nullptr,op} static JS_ALWAYS_INLINE const JSJitInfo * FUNCTION_VALUE_TO_JITINFO(const JS::Value& v) diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 4b2608deab7d..c267a2764c3f 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -4834,12 +4834,12 @@ static const JSJitInfo dom_x_getterinfo = { 0, /* protoID */ 0, /* depth */ JSJitInfo::Getter, + JSVAL_TYPE_UNKNOWN, /* returnType */ true, /* isInfallible. False in setters. */ true, /* isMovable */ false, /* isInSlot */ - JSVAL_TYPE_UNKNOWN, /* returnType */ - JSJitInfo::AliasNone, /* aliasSet */ 0, /* slotIndex */ + JSJitInfo::AliasNone, /* aliasSet */ nullptr, /* argTypes */ nullptr /* parallelNative */ }; @@ -4849,12 +4849,12 @@ static const JSJitInfo dom_x_setterinfo = { 0, /* protoID */ 0, /* depth */ JSJitInfo::Setter, + JSVAL_TYPE_UNKNOWN, /* returnType */ false, /* isInfallible. False in setters. */ false, /* isMovable. */ false, /* isInSlot */ - JSVAL_TYPE_UNKNOWN, /* returnType */ - JSJitInfo::AliasEverything, /* aliasSet */ 0, /* slotIndex */ + JSJitInfo::AliasEverything, /* aliasSet */ nullptr, /* argTypes */ nullptr /* parallelNative */ }; @@ -4864,12 +4864,12 @@ static const JSJitInfo doFoo_methodinfo = { 0, /* protoID */ 0, /* depth */ JSJitInfo::Method, + JSVAL_TYPE_UNKNOWN, /* returnType */ false, /* isInfallible. False in setters. */ false, /* isMovable */ false, /* isInSlot */ - JSVAL_TYPE_UNKNOWN, /* returnType */ - JSJitInfo::AliasEverything, /* aliasSet */ 0, /* slotIndex */ + JSJitInfo::AliasEverything, /* aliasSet */ nullptr, /* argTypes */ nullptr /* parallelNative */ };