Backout a2843362ce9b (Bug 786126) - Are we fast yet regression.

This commit is contained in:
Nicolas B. Pierron 2012-09-28 22:58:53 -07:00
parent d5f869d975
commit cbec12046b
3 changed files with 14 additions and 30 deletions

View File

@ -373,16 +373,6 @@ TypeInferenceOracle::elementReadGeneric(JSScript *script, jsbytecode *pc, bool *
*cacheable = (obj == MIRType_Object &&
(id == MIRType_Value || id == MIRType_Int32 || id == MIRType_String));
// Turn off cacheing if the element is int32 and we've seen non-native objects as the target
// of this getelem.
if (*cacheable) {
if (id == MIRType_Int32) {
if (script->analysis()->getCode(pc).nonNativeGetElement)
*cacheable = false;
}
}
if (*cacheable)
*monitorResult = (id == MIRType_String || script->analysis()->getCode(pc).getStringElement);
else

View File

@ -111,11 +111,10 @@ class Bytecode
* Dynamically observed state about the execution of this opcode. These are
* hints about the script for use during compilation.
*/
bool arrayWriteHole: 1; /* SETELEM which has written to an array hole. */
bool getStringElement:1; /* GETELEM which has accessed string properties. */
bool nonNativeGetElement:1; /* GETELEM on a non-native object. */
bool accessGetter: 1; /* Property read on a shape with a getter hook. */
bool notIdempotent: 1; /* Don't use an idempotent cache for this property read. */
bool arrayWriteHole: 1; /* SETELEM which has written to an array hole. */
bool getStringElement:1; /* GETELEM which has accessed string properties. */
bool accessGetter: 1; /* Property read on a shape with a getter hook. */
bool notIdempotent: 1; /* Don't use an idempotent cache for this property read. */
/* Stack depth before this opcode. */
uint32_t stackDepth;

View File

@ -686,19 +686,6 @@ GetObjectElementOperation(JSContext *cx, JSOp op, HandleObject obj, const Value
}
#endif
bool updateAnalysis = false;
RootedScript script(cx, NULL);
jsbytecode *pc = NULL;
if (!cx->fp()->beginsIonActivation()) {
// Don't call GetPcScript from inside Ion since it's expensive.
types::TypeScript::GetPcScript(cx, &script, &pc);
if (script->hasAnalysis())
updateAnalysis = true;
}
if (updateAnalysis && !obj->isNative())
script->analysis()->getCode(pc).nonNativeGetElement = true;
uint32_t index;
if (IsDefinitelyIndex(rref, &index)) {
do {
@ -716,8 +703,16 @@ GetObjectElementOperation(JSContext *cx, JSOp op, HandleObject obj, const Value
return false;
} while(0);
} else {
if (updateAnalysis)
script->analysis()->getCode(pc).getStringElement = true;
if (!cx->fp()->beginsIonActivation()) {
// Don't update getStringElement if called from Ion code, since
// ion::GetPcScript is expensive.
RootedScript script(cx);
jsbytecode *pc;
types::TypeScript::GetPcScript(cx, &script, &pc);
if (script->hasAnalysis())
script->analysis()->getCode(pc).getStringElement = true;
}
SpecialId special;
res.set(rref);