Backout 4356739a6f44 for breakage.

This commit is contained in:
Terrence Cole 2012-12-07 17:15:57 -08:00
parent 76b6d8250e
commit 30a7312ec3
5 changed files with 161 additions and 174 deletions

View File

@ -61,7 +61,7 @@ IonBuilder::abort(const char *message, ...)
va_start(ap, message);
abortFmt(message, ap);
va_end(ap);
IonSpew(IonSpew_Abort, "aborted @ %s:%d", script()->filename, PCToLineNumber(script(), pc));
IonSpew(IonSpew_Abort, "aborted @ %s:%d", script_->filename, PCToLineNumber(script_, pc));
#endif
return false;
}
@ -71,7 +71,7 @@ IonBuilder::spew(const char *message)
{
// Don't call PCToLineNumber in release builds.
#ifdef DEBUG
IonSpew(IonSpew_MIR, "%s @ %s:%d", message, script()->filename, PCToLineNumber(script(), pc));
IonSpew(IonSpew_MIR, "%s @ %s:%d", message, script_->filename, PCToLineNumber(script_, pc));
#endif
}
@ -167,7 +167,7 @@ uint32_t
IonBuilder::getPolyCallTargets(uint32_t argc, jsbytecode *pc,
AutoObjectVector &targets, uint32_t maxTargets)
{
types::TypeSet *calleeTypes = oracle->getCallTarget(script(), argc, pc);
types::TypeSet *calleeTypes = oracle->getCallTarget(script_, argc, pc);
if (!calleeTypes)
return 0;
@ -199,7 +199,7 @@ IonBuilder::canInlineTarget(JSFunction *target)
return false;
}
if (target->getParent() != &script()->global()) {
if (target->getParent() != &script_->global()) {
IonSpew(IonSpew_Inlining, "Cannot inline due to scope mismatch");
return false;
}
@ -224,7 +224,7 @@ IonBuilder::canInlineTarget(JSFunction *target)
bool canInline = oracle->canEnterInlinedFunction(target);
if (!canInline) {
IonSpew(IonSpew_Inlining, "Cannot inline due to oracle veto %d", script()->lineno);
IonSpew(IonSpew_Inlining, "Cannot inline due to oracle veto %d", script_->lineno);
return false;
}
@ -273,10 +273,10 @@ IonBuilder::build()
return false;
IonSpew(IonSpew_Scripts, "Analyzing script %s:%d (%p) (usecount=%d) (maxloopcount=%d)",
script()->filename, script()->lineno, (void *)script(), (int)script()->getUseCount(),
(int)script()->getMaxLoopCount());
script_->filename, script_->lineno, (void *)script_, (int)script_->getUseCount(),
(int)script_->getMaxLoopCount());
if (!graph().addScript(script()))
if (!graph().addScript(script_))
return false;
if (!initParameters())
@ -302,7 +302,7 @@ IonBuilder::build()
// Emit the start instruction, so we can begin real instructions.
current->makeStart(MStart::New(MStart::StartType_Default));
if (instrumentedProfiling())
current->add(MFunctionBoundary::New(script(), MFunctionBoundary::Enter));
current->add(MFunctionBoundary::New(script_, MFunctionBoundary::Enter));
// Parameters have been checked to correspond to the typeset, now we unbox
// what we can in an infallible manner.
@ -345,7 +345,7 @@ IonBuilder::build()
// Recompile to inline calls if this function is hot.
insertRecompileCheck();
if (script()->argumentsHasVarBinding()) {
if (script_->argumentsHasVarBinding()) {
lazyArguments_ = MConstant::New(MagicValue(JS_OPTIMIZED_ARGUMENTS));
current->add(lazyArguments_);
}
@ -399,9 +399,9 @@ IonBuilder::buildInline(IonBuilder *callerBuilder, MResumePoint *callerResumePoi
MDefinition *thisDefn, MDefinitionVector &argv)
{
IonSpew(IonSpew_Scripts, "Inlining script %s:%d (%p)",
script()->filename, script()->lineno, (void *)script());
script_->filename, script_->lineno, (void *)script_);
if (!graph().addScript(script()))
if (!graph().addScript(script_))
return false;
callerBuilder_ = callerBuilder;
@ -429,7 +429,7 @@ IonBuilder::buildInline(IonBuilder *callerBuilder, MResumePoint *callerResumePoi
// keep track of the inlining depth because all scripts inlined on the same
// level contiguously have only one Inline_Exit node.
if (instrumentedProfiling())
predecessor->add(MFunctionBoundary::New(script(),
predecessor->add(MFunctionBoundary::New(script_,
MFunctionBoundary::Inline_Enter,
inliningDepth));
@ -453,7 +453,7 @@ IonBuilder::buildInline(IonBuilder *callerBuilder, MResumePoint *callerResumePoi
}
// The Oracle ensures that the inlined script does not use the scope chain.
JS_ASSERT(!script()->analysis()->usesScopeChain());
JS_ASSERT(!script_->analysis()->usesScopeChain());
MInstruction *scope = MConstant::New(UndefinedValue());
current->add(scope);
current->initSlot(info().scopeChainSlot(), scope);
@ -505,9 +505,9 @@ IonBuilder::rewriteParameters()
// will be adding constraints to it.
types::StackTypeSet *types;
if (param->index() == MParameter::THIS_SLOT)
types = oracle->thisTypeSet(script());
types = oracle->thisTypeSet(script_);
else
types = oracle->parameterTypeSet(script(), param->index());
types = oracle->parameterTypeSet(script_, param->index());
if (!types)
continue;
@ -551,12 +551,12 @@ IonBuilder::initParameters()
return true;
MParameter *param = MParameter::New(MParameter::THIS_SLOT,
cloneTypeSet(oracle->thisTypeSet(script())));
cloneTypeSet(oracle->thisTypeSet(script_)));
current->add(param);
current->initSlot(info().thisSlot(), param);
for (uint32_t i = 0; i < info().nargs(); i++) {
param = MParameter::New(i, oracle->parameterTypeSet(script(), i));
param = MParameter::New(i, oracle->parameterTypeSet(script_, i));
current->add(param);
current->initSlot(info().argSlot(i), param);
}
@ -571,14 +571,14 @@ IonBuilder::initScopeChain()
// If the script doesn't use the scopechain, then it's already initialized
// from earlier.
if (!script()->analysis()->usesScopeChain())
if (!script_->analysis()->usesScopeChain())
return true;
// The scope chain is only tracked in scripts that have NAME opcodes which
// will try to access the scope. For other scripts, the scope instructions
// will be held live by resume points and code will still be generated for
// them, so just use a constant undefined value.
if (!script()->compileAndGo)
if (!script_->compileAndGo)
return abort("non-CNG global scripts are not supported");
if (JSFunction *fun = info().fun()) {
@ -598,7 +598,7 @@ IonBuilder::initScopeChain()
return false;
}
} else {
scope = MConstant::New(ObjectValue(script()->global()));
scope = MConstant::New(ObjectValue(script_->global()));
current->add(scope);
}
@ -761,7 +761,7 @@ IonBuilder::snoopControlFlow(JSOp op)
void
IonBuilder::markPhiBytecodeUses(jsbytecode *pc)
{
unsigned nuses = analyze::GetUseCount(script(), pc - script()->code);
unsigned nuses = analyze::GetUseCount(script_, pc - script_->code);
for (unsigned i = 0; i < nuses; i++) {
MDefinition *def = current->peek(-int32_t(i + 1));
if (def->isPassArg())
@ -965,7 +965,7 @@ IonBuilder::inspectOpcode(JSOp op)
}
case JSOP_BINDGNAME:
return pushConstant(ObjectValue(script()->global()));
return pushConstant(ObjectValue(script_->global()));
case JSOP_SETGNAME:
{
@ -2301,7 +2301,7 @@ IonBuilder::lookupSwitch(JSOp op, jssrcnote *sn)
bool prevShared = false;
jsbytecode *prevpc = NULL;
for (unsigned int i = 0; i < ncases; i++) {
Value rval = script()->getConst(GET_UINT32_INDEX(pc2));
Value rval = script_->getConst(GET_UINT32_INDEX(pc2));
pc2 += UINT32_INDEX_LEN;
jsbytecode *casepc = pc + GET_JUMP_OFFSET(pc2);
pc2 += JUMP_OFFSET_LEN;
@ -2867,7 +2867,7 @@ IonBuilder::processReturn(JSOp op)
}
if (instrumentedProfiling())
current->add(MFunctionBoundary::New(script(), MFunctionBoundary::Exit));
current->add(MFunctionBoundary::New(script_, MFunctionBoundary::Exit));
MReturn *ret = MReturn::New(def);
current->end(ret);
@ -2911,7 +2911,7 @@ IonBuilder::jsop_bitnot()
MBitNot *ins = MBitNot::New(input);
current->add(ins);
ins->infer(oracle->unaryTypes(script(), pc));
ins->infer(oracle->unaryTypes(script_, pc));
current->push(ins);
if (ins->isEffectful() && !resumeAfter(ins))
@ -2957,7 +2957,7 @@ IonBuilder::jsop_bitop(JSOp op)
}
current->add(ins);
ins->infer(oracle->binaryTypes(script(), pc));
ins->infer(oracle->binaryTypes(script_, pc));
current->push(ins);
if (ins->isEffectful() && !resumeAfter(ins))
@ -2969,7 +2969,7 @@ IonBuilder::jsop_bitop(JSOp op)
bool
IonBuilder::jsop_binary(JSOp op, MDefinition *left, MDefinition *right)
{
TypeOracle::Binary b = oracle->binaryOp(script(), pc);
TypeOracle::Binary b = oracle->binaryOp(script_, pc);
if (op == JSOP_ADD && b.rval == MIRType_String &&
(b.lhs == MIRType_String || b.lhs == MIRType_Int32) &&
@ -3008,7 +3008,7 @@ IonBuilder::jsop_binary(JSOp op, MDefinition *left, MDefinition *right)
return false;
}
TypeOracle::BinaryTypes types = oracle->binaryTypes(script(), pc);
TypeOracle::BinaryTypes types = oracle->binaryTypes(script_, pc);
current->add(ins);
ins->infer(cx, types);
current->push(ins);
@ -3030,7 +3030,7 @@ IonBuilder::jsop_binary(JSOp op)
bool
IonBuilder::jsop_pos()
{
TypeOracle::Unary types = oracle->unaryOp(script(), pc);
TypeOracle::Unary types = oracle->unaryOp(script_, pc);
if (IsNumberType(types.ival)) {
// Already int32 or double.
JS_ASSERT(IsNumberType(types.rval));
@ -3204,31 +3204,31 @@ IonBuilder::makeInliningDecision(AutoObjectVector &targets, uint32_t argc)
// 3. Do not inline functions which are not called as frequently as their
// callers.
uint32_t callerUses = script()->getUseCount();
uint32_t callerUses = script_->getUseCount();
uint32_t totalSize = 0;
uint32_t checkUses = js_IonOptions.usesBeforeInlining;
bool allFunctionsAreSmall = true;
RootedFunction target(cx);
RootedScript targetScript(cx);
RootedScript script(cx);
for (size_t i = 0; i < targets.length(); i++) {
target = targets[i]->toFunction();
if (!target->isInterpreted())
return false;
targetScript = target->nonLazyScript();
uint32_t calleeUses = targetScript->getUseCount();
script = target->nonLazyScript();
uint32_t calleeUses = script->getUseCount();
if (target->nargs < argc) {
IonSpew(IonSpew_Inlining, "Not inlining, overflow of arguments.");
return false;
}
totalSize += targetScript->length;
totalSize += script->length;
if (totalSize > js_IonOptions.inlineMaxTotalBytecodeLength)
return false;
if (targetScript->length > js_IonOptions.smallFunctionMaxBytecodeLength)
if (script->length > js_IonOptions.smallFunctionMaxBytecodeLength)
allFunctionsAreSmall = false;
if (calleeUses * js_IonOptions.inlineUseCountRatio < callerUses) {
@ -3239,13 +3239,12 @@ IonBuilder::makeInliningDecision(AutoObjectVector &targets, uint32_t argc)
if (allFunctionsAreSmall)
checkUses = js_IonOptions.smallFunctionUsesBeforeInlining;
if (script()->getUseCount() < checkUses) {
if (script_->getUseCount() < checkUses) {
IonSpew(IonSpew_Inlining, "Not inlining, caller is not hot");
return false;
}
RootedScript scriptRoot(cx, script());
if (!oracle->canInlineCall(scriptRoot, pc)) {
if (!oracle->canInlineCall(script_, pc)) {
IonSpew(IonSpew_Inlining, "Cannot inline due to uninlineable call site");
return false;
}
@ -3745,7 +3744,7 @@ IonBuilder::createCallObject(MDefinition *callee, MDefinition *scope)
// Create a template CallObject that we'll use to generate inline object
// creation.
RootedObject templateObj(cx, CallObject::createTemplateObject(cx, script()));
RootedObject templateObj(cx, CallObject::createTemplateObject(cx, script_));
if (!templateObj)
return NULL;
@ -3771,7 +3770,7 @@ IonBuilder::createCallObject(MDefinition *callee, MDefinition *scope)
current->add(MStoreFixedSlot::New(callObj, CallObject::enclosingScopeSlot(), scope));
// Initialize argument slots.
for (AliasedFormalIter i(script()); i; i++) {
for (AliasedFormalIter i(script_); i; i++) {
unsigned slot = i.scopeSlot();
unsigned formal = i.frameIndex();
MDefinition *param = current->getSlot(info().argSlot(formal));
@ -3909,7 +3908,7 @@ IonBuilder::jsop_funcall(uint32_t argc)
return makeCall(native, argc, false);
// Extract call target.
types::StackTypeSet *funTypes = oracle->getCallArg(script(), argc, 0, pc);
types::StackTypeSet *funTypes = oracle->getCallArg(script_, argc, 0, pc);
RootedObject funobj(cx, (funTypes) ? funTypes->getSingleton() : NULL);
RootedFunction target(cx, (funobj && funobj->isFunction()) ? funobj->toFunction() : NULL);
@ -3951,7 +3950,7 @@ IonBuilder::jsop_funapply(uint32_t argc)
// Disable compilation if the second argument to |apply| cannot be guaranteed
// to be either definitely |arguments| or definitely not |arguments|.
types::StackTypeSet *argObjTypes = oracle->getCallArg(script(), argc, 2, pc);
types::StackTypeSet *argObjTypes = oracle->getCallArg(script_, argc, 2, pc);
LazyArgumentsType isArgObj = oracle->isArgumentObject(argObjTypes);
if (isArgObj == MaybeArguments)
return abort("fun.apply with MaybeArguments");
@ -3974,7 +3973,7 @@ IonBuilder::jsop_funapply(uint32_t argc)
// argc+2: The native 'apply' function.
// Extract call target.
types::StackTypeSet *funTypes = oracle->getCallArg(script(), argc, 0, pc);
types::StackTypeSet *funTypes = oracle->getCallArg(script_, argc, 0, pc);
RootedObject funobj(cx, (funTypes) ? funTypes->getSingleton() : NULL);
RootedFunction target(cx, (funobj && funobj->isFunction()) ? funobj->toFunction() : NULL);
@ -4008,7 +4007,7 @@ IonBuilder::jsop_funapply(uint32_t argc)
return false;
types::StackTypeSet *barrier;
types::StackTypeSet *types = oracle->returnTypeSet(script(), pc, &barrier);
types::StackTypeSet *types = oracle->returnTypeSet(script_, pc, &barrier);
return pushTypeBarrier(apply, types, barrier);
}
@ -4021,7 +4020,7 @@ IonBuilder::jsop_call(uint32_t argc, bool constructing)
AutoObjectVector targets(cx);
uint32_t numTargets = getPolyCallTargets(argc, pc, targets, 4);
types::StackTypeSet *barrier;
types::StackTypeSet *types = oracle->returnTypeSet(script(), pc, &barrier);
types::StackTypeSet *types = oracle->returnTypeSet(script_, pc, &barrier);
// Attempt to inline native and scripted functions.
if (inliningEnabled()) {
@ -4140,7 +4139,7 @@ bool
IonBuilder::makeCall(HandleFunction target, uint32_t argc, bool constructing)
{
types::StackTypeSet *barrier;
types::StackTypeSet *types = oracle->returnTypeSet(script(), pc, &barrier);
types::StackTypeSet *types = oracle->returnTypeSet(script_, pc, &barrier);
return makeCallBarrier(target, argc, constructing, types, barrier);
}
@ -4154,7 +4153,7 @@ IonBuilder::jsop_compare(JSOp op)
current->add(ins);
current->push(ins);
ins->infer(cx, oracle->binaryTypes(script(), pc));
ins->infer(cx, oracle->binaryTypes(script_, pc));
if (ins->isEffectful() && !resumeAfter(ins))
return false;
@ -4168,12 +4167,12 @@ IonBuilder::getNewArrayTemplateObject(uint32_t count)
if (!templateObject)
return NULL;
RootedScript scriptRoot(cx, script());
if (types::UseNewTypeForInitializer(cx, scriptRoot, pc, JSProto_Array)) {
RootedScript script(cx, script_);
if (types::UseNewTypeForInitializer(cx, script, pc, JSProto_Array)) {
if (!JSObject::setSingletonType(cx, templateObject))
return NULL;
} else {
types::TypeObject *type = types::TypeScript::InitObject(cx, scriptRoot, pc, JSProto_Array);
types::TypeObject *type = types::TypeScript::InitObject(cx, script, pc, JSProto_Array);
if (!type)
return NULL;
templateObject->setType(type);
@ -4185,7 +4184,7 @@ IonBuilder::getNewArrayTemplateObject(uint32_t count)
bool
IonBuilder::jsop_newarray(uint32_t count)
{
JS_ASSERT(script()->compileAndGo);
JS_ASSERT(script_->compileAndGo);
JSObject *templateObject = getNewArrayTemplateObject(count);
if (!templateObject)
@ -4203,7 +4202,7 @@ bool
IonBuilder::jsop_newobject(HandleObject baseObj)
{
// Don't bake in the TypeObject for non-CNG scripts.
JS_ASSERT(script()->compileAndGo);
JS_ASSERT(script_->compileAndGo);
RootedObject templateObject(cx);
@ -4217,12 +4216,12 @@ IonBuilder::jsop_newobject(HandleObject baseObj)
if (!templateObject)
return false;
RootedScript scriptRoot(cx, script());
if (types::UseNewTypeForInitializer(cx, scriptRoot, pc, JSProto_Object)) {
RootedScript script(cx, script_);
if (types::UseNewTypeForInitializer(cx, script, pc, JSProto_Object)) {
if (!JSObject::setSingletonType(cx, templateObject))
return false;
} else {
types::TypeObject *type = types::TypeScript::InitObject(cx, scriptRoot, pc, JSProto_Object);
types::TypeObject *type = types::TypeScript::InitObject(cx, script, pc, JSProto_Object);
if (!type)
return false;
templateObject->setType(type);
@ -4239,8 +4238,8 @@ IonBuilder::jsop_newobject(HandleObject baseObj)
bool
IonBuilder::jsop_initelem()
{
if (oracle->propertyWriteCanSpecialize(script(), pc)) {
if (oracle->elementWriteIsDenseArray(script(), pc))
if (oracle->propertyWriteCanSpecialize(script_, pc)) {
if (oracle->elementWriteIsDenseArray(script_, pc))
return jsop_initelem_dense();
}
@ -4293,7 +4292,7 @@ IonBuilder::jsop_initprop(HandlePropertyName name)
RootedObject templateObject(cx, obj->toNewObject()->templateObject());
if (!oracle->propertyWriteCanSpecialize(script(), pc)) {
if (!oracle->propertyWriteCanSpecialize(script_, pc)) {
// This should only happen for a few names like __proto__.
return abort("INITPROP Monitored initprop");
}
@ -4317,7 +4316,7 @@ IonBuilder::jsop_initprop(HandlePropertyName name)
}
bool needsBarrier = true;
TypeOracle::BinaryTypes b = oracle->binaryTypes(script(), pc);
TypeOracle::BinaryTypes b = oracle->binaryTypes(script_, pc);
if (b.lhsTypes &&
((jsid)id == types::MakeTypeId(cx, id)) &&
!b.lhsTypes->propertyNeedsBarrier(cx, id))
@ -4641,7 +4640,7 @@ IonBuilder::insertRecompileCheck()
return;
// Don't recompile if we are already inlining.
if (script()->getUseCount() >= js_IonOptions.usesBeforeInlining)
if (script_->getUseCount() >= js_IonOptions.usesBeforeInlining)
return;
// Don't recompile if the oracle cannot provide inlining information
@ -4649,7 +4648,7 @@ IonBuilder::insertRecompileCheck()
if (!oracle->canInlineCalls())
return;
uint32_t minUses = UsesBeforeIonRecompile(script(), pc);
uint32_t minUses = UsesBeforeIonRecompile(script_, pc);
MRecompileCheck *check = MRecompileCheck::New(minUses);
current->add(check);
}
@ -4915,7 +4914,7 @@ IonBuilder::jsop_getgname(HandlePropertyName name)
if (name == cx->names().Infinity)
return pushConstant(cx->runtime->positiveInfinityValue);
RootedObject globalObj(cx, &script()->global());
RootedObject globalObj(cx, &script_->global());
JS_ASSERT(globalObj->isNative());
RootedId id(cx, NameToId(name));
@ -4926,7 +4925,7 @@ IonBuilder::jsop_getgname(HandlePropertyName name)
if (!shape || !shape->hasDefaultGetter() || !shape->hasSlot())
return jsop_getname(name);
types::HeapTypeSet *propertyTypes = oracle->globalPropertyTypeSet(script(), pc, id);
types::HeapTypeSet *propertyTypes = oracle->globalPropertyTypeSet(script_, pc, id);
if (propertyTypes && propertyTypes->isOwnProperty(cx, globalObj->getType(cx), true)) {
// The property has been reconfigured as non-configurable, non-enumerable
// or non-writable.
@ -4936,9 +4935,8 @@ IonBuilder::jsop_getgname(HandlePropertyName name)
// If the property is permanent, a shape guard isn't necessary.
JSValueType knownType = JSVAL_TYPE_UNKNOWN;
RootedScript scriptRoot(cx, script());
types::StackTypeSet *barrier = oracle->propertyReadBarrier(scriptRoot, pc);
types::StackTypeSet *types = oracle->propertyRead(script(), pc);
types::StackTypeSet *barrier = oracle->propertyReadBarrier(script_, pc);
types::StackTypeSet *types = oracle->propertyRead(script_, pc);
if (types) {
JSObject *singleton = types->getSingleton();
@ -4985,13 +4983,13 @@ IonBuilder::jsop_getgname(HandlePropertyName name)
bool
IonBuilder::jsop_setgname(HandlePropertyName name)
{
RootedObject globalObj(cx, &script()->global());
RootedObject globalObj(cx, &script_->global());
RootedId id(cx, NameToId(name));
JS_ASSERT(globalObj->isNative());
bool canSpecialize;
types::HeapTypeSet *propertyTypes = oracle->globalPropertyWrite(script(), pc, id, &canSpecialize);
types::HeapTypeSet *propertyTypes = oracle->globalPropertyWrite(script_, pc, id, &canSpecialize);
// This should only happen for a few names like __proto__.
if (!canSpecialize || globalObj->watched())
@ -5056,7 +5054,7 @@ IonBuilder::jsop_getname(HandlePropertyName name)
{
MDefinition *object;
if (js_CodeSpec[*pc].format & JOF_GNAME) {
MInstruction *global = MConstant::New(ObjectValue(script()->global()));
MInstruction *global = MConstant::New(ObjectValue(script_->global()));
current->add(global);
object = global;
} else {
@ -5076,9 +5074,8 @@ IonBuilder::jsop_getname(HandlePropertyName name)
if (!resumeAfter(ins))
return false;
RootedScript scriptRoot(cx, script());
types::StackTypeSet *barrier = oracle->propertyReadBarrier(scriptRoot, pc);
types::StackTypeSet *types = oracle->propertyRead(script(), pc);
types::StackTypeSet *barrier = oracle->propertyReadBarrier(script_, pc);
types::StackTypeSet *types = oracle->propertyRead(script_, pc);
monitorResult(ins, barrier, types);
return pushTypeBarrier(ins, types, barrier);
@ -5087,7 +5084,7 @@ IonBuilder::jsop_getname(HandlePropertyName name)
bool
IonBuilder::jsop_intrinsicname(HandlePropertyName name)
{
types::StackTypeSet *types = oracle->propertyRead(script(), pc);
types::StackTypeSet *types = oracle->propertyRead(script_, pc);
JSValueType type = types->getKnownTypeTag();
// If we haven't executed this opcode yet, we need to get the intrinsic
@ -5101,8 +5098,7 @@ IonBuilder::jsop_intrinsicname(HandlePropertyName name)
if (!resumeAfter(ins))
return false;
RootedScript scriptRoot(cx, script());
types::StackTypeSet *barrier = oracle->propertyReadBarrier(scriptRoot, pc);
types::StackTypeSet *barrier = oracle->propertyReadBarrier(script_, pc);
monitorResult(ins, barrier, types);
return pushTypeBarrier(ins, types, barrier);
}
@ -5124,10 +5120,10 @@ IonBuilder::jsop_intrinsicname(HandlePropertyName name)
bool
IonBuilder::jsop_bindname(PropertyName *name)
{
JS_ASSERT(script()->analysis()->usesScopeChain());
JS_ASSERT(script_->analysis()->usesScopeChain());
MDefinition *scopeChain = current->scopeChain();
MBindNameCache *ins = MBindNameCache::New(scopeChain, name, script(), pc);
MBindNameCache *ins = MBindNameCache::New(scopeChain, name, script_, pc);
current->add(ins);
current->push(ins);
@ -5138,17 +5134,17 @@ IonBuilder::jsop_bindname(PropertyName *name)
bool
IonBuilder::jsop_getelem()
{
if (oracle->elementReadIsDenseArray(script(), pc))
if (oracle->elementReadIsDenseArray(script_, pc))
return jsop_getelem_dense();
int arrayType = TypedArray::TYPE_MAX;
if (oracle->elementReadIsTypedArray(script(), pc, &arrayType))
if (oracle->elementReadIsTypedArray(script_, pc, &arrayType))
return jsop_getelem_typed(arrayType);
if (oracle->elementReadIsString(script(), pc))
if (oracle->elementReadIsString(script_, pc))
return jsop_getelem_string();
LazyArgumentsType isArguments = oracle->elementReadMagicArguments(script(), pc);
LazyArgumentsType isArguments = oracle->elementReadMagicArguments(script_, pc);
if (isArguments == MaybeArguments)
return abort("Type is not definitely lazy arguments.");
if (isArguments == DefinitelyArguments)
@ -5166,7 +5162,7 @@ IonBuilder::jsop_getelem()
bool mustMonitorResult = false;
bool cacheable = false;
oracle->elementReadGeneric(script(), pc, &cacheable, &mustMonitorResult);
oracle->elementReadGeneric(script_, pc, &cacheable, &mustMonitorResult);
if (cacheable)
ins = MGetElementCache::New(lhs, rhs, mustMonitorResult);
@ -5179,9 +5175,8 @@ IonBuilder::jsop_getelem()
if (!resumeAfter(ins))
return false;
RootedScript scriptRoot(cx, script());
types::StackTypeSet *barrier = oracle->propertyReadBarrier(scriptRoot, pc);
types::StackTypeSet *types = oracle->propertyRead(script(), pc);
types::StackTypeSet *barrier = oracle->propertyReadBarrier(script_, pc);
types::StackTypeSet *types = oracle->propertyRead(script_, pc);
if (mustMonitorResult)
monitorResult(ins, barrier, types);
@ -5194,10 +5189,9 @@ IonBuilder::jsop_getelem_dense()
if (oracle->arrayPrototypeHasIndexedProperty())
return abort("GETELEM Array proto has indexed properties");
RootedScript scriptRoot(cx, script());
types::StackTypeSet *barrier = oracle->propertyReadBarrier(scriptRoot, pc);
types::StackTypeSet *types = oracle->propertyRead(script(), pc);
bool needsHoleCheck = !oracle->elementReadIsPacked(script(), pc);
types::StackTypeSet *barrier = oracle->propertyReadBarrier(script_, pc);
types::StackTypeSet *types = oracle->propertyRead(script_, pc);
bool needsHoleCheck = !oracle->elementReadIsPacked(script_, pc);
bool maybeUndefined = types->hasType(types::Type::UndefinedType());
MDefinition *id = current->pop();
@ -5284,9 +5278,8 @@ GetTypedArrayElements(MDefinition *obj)
bool
IonBuilder::jsop_getelem_typed(int arrayType)
{
RootedScript scriptRoot(cx, script());
types::StackTypeSet *barrier = oracle->propertyReadBarrier(scriptRoot, pc);
types::StackTypeSet *types = oracle->propertyRead(script(), pc);
types::StackTypeSet *barrier = oracle->propertyReadBarrier(script_, pc);
types::StackTypeSet *types = oracle->propertyRead(script_, pc);
MDefinition *id = current->pop();
MDefinition *obj = current->pop();
@ -5383,7 +5376,7 @@ IonBuilder::jsop_getelem_string()
// This will cause an invalidation of this script once the 'undefined' type
// is monitored by the interpreter.
JS_ASSERT(oracle->propertyRead(script(), pc)->getKnownTypeTag() == JSVAL_TYPE_STRING);
JS_ASSERT(oracle->propertyRead(script_, pc)->getKnownTypeTag() == JSVAL_TYPE_STRING);
id = addBoundsCheck(id, length);
MCharCodeAt *charCode = MCharCodeAt::New(str, id);
@ -5398,16 +5391,16 @@ IonBuilder::jsop_getelem_string()
bool
IonBuilder::jsop_setelem()
{
if (oracle->propertyWriteCanSpecialize(script(), pc)) {
if (oracle->elementWriteIsDenseArray(script(), pc))
if (oracle->propertyWriteCanSpecialize(script_, pc)) {
if (oracle->elementWriteIsDenseArray(script_, pc))
return jsop_setelem_dense();
int arrayType = TypedArray::TYPE_MAX;
if (oracle->elementWriteIsTypedArray(script(), pc, &arrayType))
if (oracle->elementWriteIsTypedArray(script_, pc, &arrayType))
return jsop_setelem_typed(arrayType);
}
LazyArgumentsType isArguments = oracle->elementWriteMagicArguments(script(), pc);
LazyArgumentsType isArguments = oracle->elementWriteMagicArguments(script_, pc);
if (isArguments == MaybeArguments)
return abort("Type is not definitely lazy arguments.");
if (isArguments == DefinitelyArguments)
@ -5430,8 +5423,8 @@ IonBuilder::jsop_setelem_dense()
if (oracle->arrayPrototypeHasIndexedProperty())
return abort("SETELEM Array proto has indexed properties");
MIRType elementType = oracle->elementWrite(script(), pc);
bool packed = oracle->elementWriteIsPacked(script(), pc);
MIRType elementType = oracle->elementWrite(script_, pc);
bool packed = oracle->elementWriteIsPacked(script_, pc);
MDefinition *value = current->pop();
MDefinition *id = current->pop();
@ -5450,7 +5443,7 @@ IonBuilder::jsop_setelem_dense()
// indexes in the past. Otherwise, use MStoreElement so that we can hoist
// the initialized length and bounds check.
MStoreElementCommon *store;
if (oracle->setElementHasWrittenHoles(script(), pc)) {
if (oracle->setElementHasWrittenHoles(script_, pc)) {
MStoreElementHole *ins = MStoreElementHole::New(obj, elements, id, value);
store = ins;
@ -5476,7 +5469,7 @@ IonBuilder::jsop_setelem_dense()
}
// Determine whether a write barrier is required.
if (oracle->elementWriteNeedsBarrier(script(), pc))
if (oracle->elementWriteNeedsBarrier(script_, pc))
store->setNeedsBarrier();
if (elementType != MIRType_None && packed)
@ -5536,7 +5529,7 @@ IonBuilder::jsop_length()
bool
IonBuilder::jsop_length_fastPath()
{
TypeOracle::UnaryTypes sig = oracle->unaryTypes(script(), pc);
TypeOracle::UnaryTypes sig = oracle->unaryTypes(script_, pc);
if (!sig.inTypes || !sig.outTypes)
return false;
@ -5606,9 +5599,8 @@ IonBuilder::jsop_arguments_length()
bool
IonBuilder::jsop_arguments_getelem()
{
RootedScript scriptRoot(cx, script());
types::StackTypeSet *barrier = oracle->propertyReadBarrier(scriptRoot, pc);
types::StackTypeSet *types = oracle->propertyRead(script(), pc);
types::StackTypeSet *barrier = oracle->propertyReadBarrier(script_, pc);
types::StackTypeSet *types = oracle->propertyRead(script_, pc);
MDefinition *idx = current->pop();
@ -6092,9 +6084,8 @@ IonBuilder::loadSlot(MDefinition *obj, Shape *shape, MIRType rvalType)
JS_ASSERT(shape->hasDefaultGetter());
JS_ASSERT(shape->hasSlot());
RootedScript scriptRoot(cx, script());
types::StackTypeSet *barrier = oracle->propertyReadBarrier(scriptRoot, pc);
types::StackTypeSet *types = oracle->propertyRead(script(), pc);
types::StackTypeSet *barrier = oracle->propertyReadBarrier(script_, pc);
types::StackTypeSet *types = oracle->propertyRead(script_, pc);
if (shape->slot() < shape->numFixedSlots()) {
MLoadFixedSlot *load = MLoadFixedSlot::New(obj, shape->slot());
@ -6148,11 +6139,10 @@ IonBuilder::jsop_getprop(HandlePropertyName name)
{
RootedId id(cx, NameToId(name));
RootedScript scriptRoot(cx, script());
types::StackTypeSet *barrier = oracle->propertyReadBarrier(scriptRoot, pc);
types::StackTypeSet *types = oracle->propertyRead(script(), pc);
TypeOracle::Unary unary = oracle->unaryOp(script(), pc);
TypeOracle::UnaryTypes uTypes = oracle->unaryTypes(script(), pc);
types::StackTypeSet *barrier = oracle->propertyReadBarrier(script_, pc);
types::StackTypeSet *types = oracle->propertyRead(script_, pc);
TypeOracle::Unary unary = oracle->unaryOp(script_, pc);
TypeOracle::UnaryTypes uTypes = oracle->unaryTypes(script_, pc);
bool emitted = false;
@ -6196,7 +6186,7 @@ bool
IonBuilder::getPropTryArgumentsLength(bool *emitted)
{
JS_ASSERT(*emitted == false);
LazyArgumentsType isArguments = oracle->propertyReadMagicArguments(script(), pc);
LazyArgumentsType isArguments = oracle->propertyReadMagicArguments(script_, pc);
if (isArguments == MaybeArguments)
return abort("Type is not definitely lazy arguments.");
@ -6218,7 +6208,7 @@ IonBuilder::getPropTryConstant(bool *emitted, HandleId id, types::StackTypeSet *
if (!singleton || barrier)
return true;
RootedObject global(cx, &script()->global());
RootedObject global(cx, &script_->global());
bool isConstant, testObject, testString;
if (!TestSingletonPropertyTypes(cx, unaryTypes.inTypes, global, id,
@ -6341,12 +6331,12 @@ IonBuilder::getPropTryMonomorphic(bool *emitted, HandleId id, types::StackTypeSe
TypeOracle::Unary unary, TypeOracle::UnaryTypes unaryTypes)
{
JS_ASSERT(*emitted == false);
bool accessGetter = oracle->propertyReadAccessGetter(script(), pc);
bool accessGetter = oracle->propertyReadAccessGetter(script_, pc);
if (unary.ival != MIRType_Object)
return true;
Shape *objShape = mjit::GetPICSingleShape(cx, script(), pc, info().constructing());
Shape *objShape = mjit::GetPICSingleShape(cx, script_, pc, info().constructing());
if (!objShape || objShape->inDictionary()) {
spew("GETPROP not monomorphic");
return true;
@ -6381,7 +6371,7 @@ IonBuilder::getPropTryPolymorphic(bool *emitted, HandlePropertyName name, Handle
TypeOracle::Unary unary, TypeOracle::UnaryTypes unaryTypes)
{
JS_ASSERT(*emitted == false);
bool accessGetter = oracle->propertyReadAccessGetter(script(), pc);
bool accessGetter = oracle->propertyReadAccessGetter(script_, pc);
// The input value must either be an object, or we should have strong suspicions
// that it can be safely unboxed to an object.
@ -6403,7 +6393,7 @@ IonBuilder::getPropTryPolymorphic(bool *emitted, HandlePropertyName name, Handle
(cx->methodJitEnabled || js_IonOptions.eagerCompilation) &&
!invalidatedIdempotentCache())
{
if (oracle->propertyReadIdempotent(script(), pc, id))
if (oracle->propertyReadIdempotent(script_, pc, id))
load->setIdempotent();
}
@ -6438,9 +6428,9 @@ IonBuilder::jsop_setprop(HandlePropertyName name)
MDefinition *value = current->pop();
MDefinition *obj = current->pop();
bool monitored = !oracle->propertyWriteCanSpecialize(script(), pc);
bool monitored = !oracle->propertyWriteCanSpecialize(script_, pc);
TypeOracle::BinaryTypes binaryTypes = oracle->binaryTypes(script(), pc);
TypeOracle::BinaryTypes binaryTypes = oracle->binaryTypes(script_, pc);
if (!monitored) {
if (types::HeapTypeSet *propTypes = GetDefiniteSlot(cx, binaryTypes.lhsTypes, name)) {
@ -6494,14 +6484,14 @@ IonBuilder::jsop_setprop(HandlePropertyName name)
return resumeAfter(call);
}
oracle->binaryOp(script(), pc);
oracle->binaryOp(script_, pc);
MSetPropertyInstruction *ins;
if (monitored) {
ins = MCallSetProperty::New(obj, value, name, script()->strictModeCode);
ins = MCallSetProperty::New(obj, value, name, script_->strictModeCode);
} else {
Shape *objShape;
if ((objShape = mjit::GetPICSingleShape(cx, script(), pc, info().constructing())) &&
if ((objShape = mjit::GetPICSingleShape(cx, script_, pc, info().constructing())) &&
!objShape->inDictionary())
{
// The JM IC was monomorphic, so we inline the property access as
@ -6516,14 +6506,14 @@ IonBuilder::jsop_setprop(HandlePropertyName name)
spew("Inlining monomorphic SETPROP");
jsid typeId = types::MakeTypeId(cx, id);
bool needsBarrier = oracle->propertyWriteNeedsBarrier(script(), pc, typeId);
bool needsBarrier = oracle->propertyWriteNeedsBarrier(script_, pc, typeId);
return storeSlot(obj, shape, value, needsBarrier);
}
spew("SETPROP not monomorphic");
ins = MSetPropertyCache::New(obj, value, name, script()->strictModeCode);
ins = MSetPropertyCache::New(obj, value, name, script_->strictModeCode);
if (!binaryTypes.lhsTypes || binaryTypes.lhsTypes->propertyNeedsBarrier(cx, id))
ins->setNeedsBarrier();
@ -6551,7 +6541,7 @@ IonBuilder::jsop_delprop(HandlePropertyName name)
bool
IonBuilder::jsop_regexp(RegExpObject *reobj)
{
JSObject *prototype = script()->global().getOrCreateRegExpPrototype(cx);
JSObject *prototype = script_->global().getOrCreateRegExpPrototype(cx);
if (!prototype)
return false;
@ -6575,7 +6565,7 @@ IonBuilder::jsop_object(JSObject *obj)
bool
IonBuilder::jsop_lambda(JSFunction *fun)
{
JS_ASSERT(script()->analysis()->usesScopeChain());
JS_ASSERT(script_->analysis()->usesScopeChain());
MLambda *ins = MLambda::New(current->scopeChain(), fun);
current->add(ins);
current->push(ins);
@ -6586,7 +6576,7 @@ IonBuilder::jsop_lambda(JSFunction *fun)
bool
IonBuilder::jsop_deflocalfun(uint32_t local, JSFunction *fun)
{
JS_ASSERT(script()->analysis()->usesScopeChain());
JS_ASSERT(script_->analysis()->usesScopeChain());
MLambda *ins = MLambda::New(current->scopeChain(), fun);
current->add(ins);
@ -6603,7 +6593,7 @@ IonBuilder::jsop_defvar(uint32_t index)
{
JS_ASSERT(JSOp(*pc) == JSOP_DEFVAR || JSOp(*pc) == JSOP_DEFCONST);
PropertyName *name = script()->getName(index);
PropertyName *name = script_->getName(index);
// Bake in attrs.
unsigned attrs = JSPROP_ENUMERATE | JSPROP_PERMANENT;
@ -6611,7 +6601,7 @@ IonBuilder::jsop_defvar(uint32_t index)
attrs |= JSPROP_READONLY;
// Pass the ScopeChain.
JS_ASSERT(script()->analysis()->usesScopeChain());
JS_ASSERT(script_->analysis()->usesScopeChain());
// Bake the name pointer into the MDefVar.
MDefVar *defvar = MDefVar::New(name, attrs, current->scopeChain());
@ -6626,12 +6616,12 @@ IonBuilder::jsop_this()
if (!info().fun())
return abort("JSOP_THIS outside of a JSFunction.");
if (script()->strictModeCode) {
if (script_->strictModeCode) {
current->pushSlot(info().thisSlot());
return true;
}
types::StackTypeSet *types = oracle->thisTypeSet(script());
types::StackTypeSet *types = oracle->thisTypeSet(script_);
if (types && types->getKnownTypeTag() == JSVAL_TYPE_OBJECT) {
// This is safe, because if the entry type of |this| is an object, it
// will necessarily be an object throughout the entire function. OSR
@ -6646,7 +6636,7 @@ IonBuilder::jsop_this()
bool
IonBuilder::jsop_typeof()
{
TypeOracle::Unary unary = oracle->unaryOp(script(), pc);
TypeOracle::Unary unary = oracle->unaryOp(script_, pc);
MDefinition *input = current->pop();
MTypeOf *ins = MTypeOf::New(input, unary.ival);
@ -6663,7 +6653,7 @@ bool
IonBuilder::jsop_toid()
{
// No-op if the index is an integer.
TypeOracle::Unary unary = oracle->unaryOp(script(), pc);
TypeOracle::Unary unary = oracle->unaryOp(script_, pc);
if (unary.ival == MIRType_Int32)
return true;
@ -6744,11 +6734,11 @@ bool
IonBuilder::jsop_getaliasedvar(ScopeCoordinate sc)
{
types::StackTypeSet *barrier;
types::StackTypeSet *actual = oracle->aliasedVarBarrier(script(), pc, &barrier);
types::StackTypeSet *actual = oracle->aliasedVarBarrier(script_, pc, &barrier);
MDefinition *obj = walkScopeChain(sc.hops);
RootedShape shape(cx, ScopeCoordinateToStaticScope(script(), pc).scopeShape());
RootedShape shape(cx, ScopeCoordinateToStaticScope(script_, pc).scopeShape());
MInstruction *load;
if (shape->numFixedSlots() <= sc.slot) {
@ -6782,7 +6772,7 @@ IonBuilder::jsop_setaliasedvar(ScopeCoordinate sc)
MDefinition *rval = current->peek(-1);
MDefinition *obj = walkScopeChain(sc.hops);
RootedShape shape(cx, ScopeCoordinateToStaticScope(script(), pc).scopeShape());
RootedShape shape(cx, ScopeCoordinateToStaticScope(script_, pc).scopeShape());
MInstruction *store;
if (shape->numFixedSlots() <= sc.slot) {
@ -6801,7 +6791,7 @@ IonBuilder::jsop_setaliasedvar(ScopeCoordinate sc)
bool
IonBuilder::jsop_in()
{
if (oracle->inObjectIsDenseArray(script(), pc))
if (oracle->inObjectIsDenseArray(script_, pc))
return jsop_in_dense();
MDefinition *obj = current->pop();
@ -6820,7 +6810,7 @@ IonBuilder::jsop_in_dense()
if (oracle->arrayPrototypeHasIndexedProperty())
return abort("JSOP_IN Array proto has indexed properties");
bool needsHoleCheck = !oracle->inArrayIsPacked(script(), pc);
bool needsHoleCheck = !oracle->inArrayIsPacked(script_, pc);
MDefinition *obj = current->pop();
MDefinition *id = current->pop();
@ -6852,7 +6842,7 @@ IonBuilder::jsop_instanceof()
MDefinition *rhs = current->pop();
MDefinition *obj = current->pop();
TypeOracle::BinaryTypes types = oracle->binaryTypes(script(), pc);
TypeOracle::BinaryTypes types = oracle->binaryTypes(script_, pc);
// If this is an 'x instanceof function' operation and we can determine the
// exact function and prototype object being tested for, use a typed path.

View File

@ -113,7 +113,7 @@ types::StackTypeSet *
IonBuilder::getInlineReturnTypeSet()
{
types::StackTypeSet *barrier;
types::StackTypeSet *returnTypes = oracle->returnTypeSet(script(), pc, &barrier);
types::StackTypeSet *returnTypes = oracle->returnTypeSet(script_, pc, &barrier);
JS_ASSERT(returnTypes);
return returnTypes;
@ -129,7 +129,7 @@ IonBuilder::getInlineReturnType()
types::StackTypeSet *
IonBuilder::getInlineArgTypeSet(uint32_t argc, uint32_t arg)
{
types::StackTypeSet *argTypes = oracle->getCallArg(script(), argc, arg, pc);
types::StackTypeSet *argTypes = oracle->getCallArg(script_, argc, arg, pc);
JS_ASSERT(argTypes);
return argTypes;
}

View File

@ -66,7 +66,7 @@ TypeInferenceOracle::getMIRType(HeapTypeSet *types)
TypeOracle::UnaryTypes
TypeInferenceOracle::unaryTypes(JSScript *script, jsbytecode *pc)
{
JS_ASSERT(script == this->script());
JS_ASSERT(script == this->script_);
UnaryTypes res;
res.inTypes = script->analysis()->poppedTypes(pc, 0);
@ -77,7 +77,7 @@ TypeInferenceOracle::unaryTypes(JSScript *script, jsbytecode *pc)
TypeOracle::BinaryTypes
TypeInferenceOracle::binaryTypes(JSScript *script, jsbytecode *pc)
{
JS_ASSERT(script == this->script());
JS_ASSERT(script == this->script_);
JSOp op = (JSOp)*pc;
@ -97,7 +97,7 @@ TypeInferenceOracle::binaryTypes(JSScript *script, jsbytecode *pc)
TypeOracle::Unary
TypeInferenceOracle::unaryOp(JSScript *script, jsbytecode *pc)
{
JS_ASSERT(script == this->script());
JS_ASSERT(script == this->script_);
Unary res;
res.ival = getMIRType(script->analysis()->poppedTypes(pc, 0));
@ -108,7 +108,7 @@ TypeInferenceOracle::unaryOp(JSScript *script, jsbytecode *pc)
TypeOracle::Binary
TypeInferenceOracle::binaryOp(JSScript *script, jsbytecode *pc)
{
JS_ASSERT(script == this->script());
JS_ASSERT(script == this->script_);
JSOp op = (JSOp)*pc;
@ -128,7 +128,7 @@ TypeInferenceOracle::binaryOp(JSScript *script, jsbytecode *pc)
StackTypeSet *
TypeInferenceOracle::thisTypeSet(JSScript *script)
{
JS_ASSERT(script == this->script());
JS_ASSERT(script == this->script_);
return TypeScript::ThisTypes(script);
}
@ -136,18 +136,18 @@ bool
TypeInferenceOracle::getOsrTypes(jsbytecode *osrPc, Vector<MIRType> &slotTypes)
{
JS_ASSERT(JSOp(*osrPc) == JSOP_LOOPENTRY);
JS_ASSERT(script()->code < osrPc);
JS_ASSERT(osrPc < script()->code + script()->length);
JS_ASSERT(script_->code < osrPc);
JS_ASSERT(osrPc < script_->code + script_->length);
Vector<types::StackTypeSet *> slotTypeSets(cx);
if (!slotTypeSets.resize(TotalSlots(script())))
if (!slotTypeSets.resize(TotalSlots(script_)))
return false;
for (uint32_t slot = ThisSlot(); slot < TotalSlots(script()); slot++)
slotTypeSets[slot] = TypeScript::SlotTypes(script(), slot);
for (uint32_t slot = ThisSlot(); slot < TotalSlots(script_); slot++)
slotTypeSets[slot] = TypeScript::SlotTypes(script_, slot);
jsbytecode *pc = script()->code;
ScriptAnalysis *analysis = script()->analysis();
jsbytecode *pc = script_->code;
ScriptAnalysis *analysis = script_->analysis();
// To determine the slot types at the OSR pc, we have to do a forward walk
// over the bytecode to reconstruct the types.
@ -158,7 +158,7 @@ TypeInferenceOracle::getOsrTypes(jsbytecode *osrPc, Vector<MIRType> &slotTypes)
// Update variable types for all new values at this bytecode.
if (const SlotValue *newv = analysis->newValues(pc)) {
while (newv->slot) {
if (newv->slot < TotalSlots(script()))
if (newv->slot < TotalSlots(script_))
slotTypeSets[newv->slot] = analysis->getValueTypes(newv->value);
newv++;
}
@ -166,7 +166,7 @@ TypeInferenceOracle::getOsrTypes(jsbytecode *osrPc, Vector<MIRType> &slotTypes)
}
if (BytecodeUpdatesSlot(JSOp(*pc))) {
uint32_t slot = GetBytecodeSlot(script(), pc);
uint32_t slot = GetBytecodeSlot(script_, pc);
if (analysis->trackSlot(slot))
slotTypeSets[slot] = analysis->pushedTypes(pc, 0);
}
@ -189,15 +189,15 @@ TypeInferenceOracle::getOsrTypes(jsbytecode *osrPc, Vector<MIRType> &slotTypes)
uint32_t stackDepth = analysis->getCode(osrPc).stackDepth;
#endif
if (script()->function()) {
JS_ASSERT(slotTypes.length() == TotalSlots(script()) + stackDepth);
if (script_->function()) {
JS_ASSERT(slotTypes.length() == TotalSlots(script_) + stackDepth);
for (size_t i = ThisSlot(); i < TotalSlots(script()); i++)
for (size_t i = ThisSlot(); i < TotalSlots(script_); i++)
slotTypes[i] = getMIRType(slotTypeSets[i]);
} else {
JS_ASSERT(slotTypes.length() == TotalSlots(script()) + stackDepth - 1);
JS_ASSERT(slotTypes.length() == TotalSlots(script_) + stackDepth - 1);
for (size_t i = ArgSlot(0); i < TotalSlots(script()); i++)
for (size_t i = ArgSlot(0); i < TotalSlots(script_); i++)
slotTypes[i - 1] = getMIRType(slotTypeSets[i]);
}
@ -207,7 +207,7 @@ TypeInferenceOracle::getOsrTypes(jsbytecode *osrPc, Vector<MIRType> &slotTypes)
StackTypeSet *
TypeInferenceOracle::parameterTypeSet(JSScript *script, size_t index)
{
JS_ASSERT(script == this->script());
JS_ASSERT(script == this->script_);
return TypeScript::ArgTypes(script, index);
}
@ -484,14 +484,14 @@ TypeInferenceOracle::elementWrite(JSScript *script, jsbytecode *pc)
bool
TypeInferenceOracle::arrayPrototypeHasIndexedProperty()
{
RootedScript scriptRoot(cx, script());
return ArrayPrototypeHasIndexedProperty(cx, scriptRoot);
RootedScript script(cx, script_);
return ArrayPrototypeHasIndexedProperty(cx, script);
}
bool
TypeInferenceOracle::canInlineCalls()
{
return script()->analysis()->hasFunctionCalls();
return script_->analysis()->hasFunctionCalls();
}
bool
@ -519,10 +519,10 @@ TypeInferenceOracle::elementWriteNeedsBarrier(JSScript *script, jsbytecode *pc)
StackTypeSet *
TypeInferenceOracle::getCallTarget(JSScript *caller, uint32_t argc, jsbytecode *pc)
{
JS_ASSERT(caller == this->script());
JS_ASSERT(caller == this->script_);
JS_ASSERT(js_CodeSpec[*pc].format & JOF_INVOKE && JSOp(*pc) != JSOP_EVAL);
ScriptAnalysis *analysis = script()->analysis();
ScriptAnalysis *analysis = script_->analysis();
return analysis->poppedTypes(pc, argc + 1);
}

View File

@ -208,8 +208,6 @@ class TypeInferenceOracle : public TypeOracle
bool init(JSContext *cx, JSScript *script);
UnrootedScript script() { return script_.get(); }
UnaryTypes unaryTypes(JSScript *script, jsbytecode *pc);
BinaryTypes binaryTypes(JSScript *script, jsbytecode *pc);
Unary unaryOp(JSScript *script, jsbytecode *pc);

View File

@ -10,15 +10,14 @@
/*
* JS script descriptor.
*/
#include "jsprvtd.h"
#include "jsdbgapi.h"
#include "jsclist.h"
#include "jsinfer.h"
#include "jsopcode.h"
#include "jsscope.h"
#include "gc/Barrier.h"
#include "gc/Root.h"
ForwardDeclareJS(Script);
namespace js {