mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Backed out changeset 11751c0efe27 (bug 951439) for mass bustage.
This commit is contained in:
parent
b5eeb3ac87
commit
ebcd5b6587
@ -611,8 +611,8 @@ ExecuteRegExp(JSContext *cx, CallArgs args, MatchConduit &matches)
|
|||||||
|
|
||||||
/* ES5 15.10.6.2. */
|
/* ES5 15.10.6.2. */
|
||||||
static bool
|
static bool
|
||||||
regexp_exec_impl(JSContext *cx, HandleObject regexp, HandleString string,
|
regexp_exec_impl(JSContext *cx, CallArgs args, HandleObject regexp, HandleString string,
|
||||||
RegExpStaticsUpdate staticsUpdate, MutableHandleValue rval)
|
RegExpStaticsUpdate staticsUpdate)
|
||||||
{
|
{
|
||||||
/* Execute regular expression and gather matches. */
|
/* Execute regular expression and gather matches. */
|
||||||
ScopedMatchPairs matches(&cx->tempLifoAlloc());
|
ScopedMatchPairs matches(&cx->tempLifoAlloc());
|
||||||
@ -624,11 +624,11 @@ regexp_exec_impl(JSContext *cx, HandleObject regexp, HandleString string,
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (status == RegExpRunStatus_Success_NotFound) {
|
if (status == RegExpRunStatus_Success_NotFound) {
|
||||||
rval.setNull();
|
args.rval().setNull();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CreateRegExpMatchResult(cx, string, matches, rval);
|
return CreateRegExpMatchResult(cx, string, matches, args.rval());
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
@ -639,7 +639,7 @@ regexp_exec_impl(JSContext *cx, CallArgs args)
|
|||||||
if (!string)
|
if (!string)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return regexp_exec_impl(cx, regexp, string, UpdateRegExpStatics, args.rval());
|
return regexp_exec_impl(cx, args, regexp, string, UpdateRegExpStatics);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -649,14 +649,6 @@ js::regexp_exec(JSContext *cx, unsigned argc, Value *vp)
|
|||||||
return CallNonGenericMethod(cx, IsRegExp, regexp_exec_impl, args);
|
return CallNonGenericMethod(cx, IsRegExp, regexp_exec_impl, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Separate interface for use by IonMonkey. */
|
|
||||||
bool
|
|
||||||
js::regexp_exec_raw(JSContext *cx, HandleObject regexp, HandleString input, Value *vp)
|
|
||||||
{
|
|
||||||
MutableHandleValue vpHandle = MutableHandleValue::fromMarkedLocation(vp);
|
|
||||||
return regexp_exec_impl(cx, regexp, input, UpdateRegExpStatics, vpHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
js::regexp_exec_no_statics(JSContext *cx, unsigned argc, Value *vp)
|
js::regexp_exec_no_statics(JSContext *cx, unsigned argc, Value *vp)
|
||||||
{
|
{
|
||||||
@ -668,7 +660,7 @@ js::regexp_exec_no_statics(JSContext *cx, unsigned argc, Value *vp)
|
|||||||
RootedObject regexp(cx, &args[0].toObject());
|
RootedObject regexp(cx, &args[0].toObject());
|
||||||
RootedString string(cx, args[1].toString());
|
RootedString string(cx, args[1].toString());
|
||||||
|
|
||||||
return regexp_exec_impl(cx, regexp, string, DontUpdateRegExpStatics, args.rval());
|
return regexp_exec_impl(cx, args, regexp, string, DontUpdateRegExpStatics);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ES5 15.10.6.3. */
|
/* ES5 15.10.6.3. */
|
||||||
|
@ -48,9 +48,6 @@ bool
|
|||||||
CreateRegExpMatchResult(JSContext *cx, HandleString input, const jschar *chars, size_t length,
|
CreateRegExpMatchResult(JSContext *cx, HandleString input, const jschar *chars, size_t length,
|
||||||
MatchPairs &matches, MutableHandleValue rval);
|
MatchPairs &matches, MutableHandleValue rval);
|
||||||
|
|
||||||
extern bool
|
|
||||||
regexp_exec_raw(JSContext *cx, HandleObject regexp, HandleString input, Value *vp);
|
|
||||||
|
|
||||||
extern bool
|
extern bool
|
||||||
regexp_exec(JSContext *cx, unsigned argc, Value *vp);
|
regexp_exec(JSContext *cx, unsigned argc, Value *vp);
|
||||||
|
|
||||||
|
@ -767,18 +767,6 @@ CodeGenerator::visitRegExp(LRegExp *lir)
|
|||||||
return callVM(CloneRegExpObjectInfo, lir);
|
return callVM(CloneRegExpObjectInfo, lir);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef bool (*RegExpExecRawFn)(JSContext *cx, HandleObject regexp,
|
|
||||||
HandleString input, Value *vp);
|
|
||||||
static const VMFunction RegExpExecRawInfo = FunctionInfo<RegExpExecRawFn>(regexp_exec_raw);
|
|
||||||
|
|
||||||
bool
|
|
||||||
CodeGenerator::visitRegExpExec(LRegExpExec *lir)
|
|
||||||
{
|
|
||||||
pushArg(ToRegister(lir->string()));
|
|
||||||
pushArg(ToRegister(lir->regexp()));
|
|
||||||
return callVM(RegExpExecRawInfo, lir);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef bool (*RegExpTestRawFn)(JSContext *cx, HandleObject regexp,
|
typedef bool (*RegExpTestRawFn)(JSContext *cx, HandleObject regexp,
|
||||||
HandleString input, bool *result);
|
HandleString input, bool *result);
|
||||||
static const VMFunction RegExpTestRawInfo = FunctionInfo<RegExpTestRawFn>(regexp_test_raw);
|
static const VMFunction RegExpTestRawInfo = FunctionInfo<RegExpTestRawFn>(regexp_test_raw);
|
||||||
|
@ -90,7 +90,6 @@ class CodeGenerator : public CodeGeneratorSpecific
|
|||||||
bool visitDoubleToString(LDoubleToString *lir);
|
bool visitDoubleToString(LDoubleToString *lir);
|
||||||
bool visitInteger(LInteger *lir);
|
bool visitInteger(LInteger *lir);
|
||||||
bool visitRegExp(LRegExp *lir);
|
bool visitRegExp(LRegExp *lir);
|
||||||
bool visitRegExpExec(LRegExpExec *lir);
|
|
||||||
bool visitRegExpTest(LRegExpTest *lir);
|
bool visitRegExpTest(LRegExpTest *lir);
|
||||||
bool visitLambda(LLambda *lir);
|
bool visitLambda(LLambda *lir);
|
||||||
bool visitLambdaForSingleton(LLambdaForSingleton *lir);
|
bool visitLambdaForSingleton(LLambdaForSingleton *lir);
|
||||||
|
@ -630,7 +630,6 @@ class IonBuilder : public MIRGenerator
|
|||||||
InliningStatus inlineStrCharAt(CallInfo &callInfo);
|
InliningStatus inlineStrCharAt(CallInfo &callInfo);
|
||||||
|
|
||||||
// RegExp natives.
|
// RegExp natives.
|
||||||
InliningStatus inlineRegExpExec(CallInfo &callInfo);
|
|
||||||
InliningStatus inlineRegExpTest(CallInfo &callInfo);
|
InliningStatus inlineRegExpTest(CallInfo &callInfo);
|
||||||
|
|
||||||
// Array intrinsics.
|
// Array intrinsics.
|
||||||
|
@ -3215,29 +3215,6 @@ class LRegExp : public LCallInstructionHelper<1, 0, 0>
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class LRegExpExec : public LCallInstructionHelper<1, 2, 0>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LIR_HEADER(RegExpExec)
|
|
||||||
|
|
||||||
LRegExpExec(const LAllocation ®exp, const LAllocation &string)
|
|
||||||
{
|
|
||||||
setOperand(0, regexp);
|
|
||||||
setOperand(1, string);
|
|
||||||
}
|
|
||||||
|
|
||||||
const LAllocation *regexp() {
|
|
||||||
return getOperand(0);
|
|
||||||
}
|
|
||||||
const LAllocation *string() {
|
|
||||||
return getOperand(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
const MRegExpExec *mir() const {
|
|
||||||
return mir_->toRegExpExec();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class LRegExpTest : public LCallInstructionHelper<1, 2, 0>
|
class LRegExpTest : public LCallInstructionHelper<1, 2, 0>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -149,7 +149,6 @@
|
|||||||
_(OsrReturnValue) \
|
_(OsrReturnValue) \
|
||||||
_(OsrArgumentsObject) \
|
_(OsrArgumentsObject) \
|
||||||
_(RegExp) \
|
_(RegExp) \
|
||||||
_(RegExpExec) \
|
|
||||||
_(RegExpTest) \
|
_(RegExpTest) \
|
||||||
_(Lambda) \
|
_(Lambda) \
|
||||||
_(LambdaForSingleton) \
|
_(LambdaForSingleton) \
|
||||||
|
@ -1945,17 +1945,6 @@ LIRGenerator::visitRegExp(MRegExp *ins)
|
|||||||
return defineReturn(lir, ins) && assignSafepoint(lir, ins);
|
return defineReturn(lir, ins) && assignSafepoint(lir, ins);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
LIRGenerator::visitRegExpExec(MRegExpExec *ins)
|
|
||||||
{
|
|
||||||
JS_ASSERT(ins->regexp()->type() == MIRType_Object);
|
|
||||||
JS_ASSERT(ins->string()->type() == MIRType_String);
|
|
||||||
|
|
||||||
LRegExpExec *lir = new(alloc()) LRegExpExec(useRegisterAtStart(ins->regexp()),
|
|
||||||
useRegisterAtStart(ins->string()));
|
|
||||||
return defineReturn(lir, ins) && assignSafepoint(lir, ins);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
LIRGenerator::visitRegExpTest(MRegExpTest *ins)
|
LIRGenerator::visitRegExpTest(MRegExpTest *ins)
|
||||||
{
|
{
|
||||||
|
@ -162,7 +162,6 @@ class LIRGenerator : public LIRGeneratorSpecific
|
|||||||
bool visitTruncateToInt32(MTruncateToInt32 *truncate);
|
bool visitTruncateToInt32(MTruncateToInt32 *truncate);
|
||||||
bool visitToString(MToString *convert);
|
bool visitToString(MToString *convert);
|
||||||
bool visitRegExp(MRegExp *ins);
|
bool visitRegExp(MRegExp *ins);
|
||||||
bool visitRegExpExec(MRegExpExec *ins);
|
|
||||||
bool visitRegExpTest(MRegExpTest *ins);
|
bool visitRegExpTest(MRegExpTest *ins);
|
||||||
bool visitLambda(MLambda *ins);
|
bool visitLambda(MLambda *ins);
|
||||||
bool visitLambdaPar(MLambdaPar *ins);
|
bool visitLambdaPar(MLambdaPar *ins);
|
||||||
|
@ -119,8 +119,6 @@ IonBuilder::inlineNativeCall(CallInfo &callInfo, JSNative native)
|
|||||||
return inlineStrCharAt(callInfo);
|
return inlineStrCharAt(callInfo);
|
||||||
|
|
||||||
// RegExp natives.
|
// RegExp natives.
|
||||||
if (native == regexp_exec && CallResultEscapes(pc))
|
|
||||||
return inlineRegExpExec(callInfo);
|
|
||||||
if (native == regexp_exec && !CallResultEscapes(pc))
|
if (native == regexp_exec && !CallResultEscapes(pc))
|
||||||
return inlineRegExpTest(callInfo);
|
return inlineRegExpTest(callInfo);
|
||||||
if (native == regexp_test)
|
if (native == regexp_test)
|
||||||
@ -1068,34 +1066,6 @@ IonBuilder::inlineStrCharAt(CallInfo &callInfo)
|
|||||||
return InliningStatus_Inlined;
|
return InliningStatus_Inlined;
|
||||||
}
|
}
|
||||||
|
|
||||||
IonBuilder::InliningStatus
|
|
||||||
IonBuilder::inlineRegExpExec(CallInfo &callInfo)
|
|
||||||
{
|
|
||||||
if (callInfo.argc() != 1 || callInfo.constructing())
|
|
||||||
return InliningStatus_NotInlined;
|
|
||||||
|
|
||||||
if (callInfo.thisArg()->type() != MIRType_Object)
|
|
||||||
return InliningStatus_NotInlined;
|
|
||||||
|
|
||||||
types::TemporaryTypeSet *thisTypes = callInfo.thisArg()->resultTypeSet();
|
|
||||||
const Class *clasp = thisTypes ? thisTypes->getKnownClass() : nullptr;
|
|
||||||
if (clasp != &RegExpObject::class_)
|
|
||||||
return InliningStatus_NotInlined;
|
|
||||||
|
|
||||||
if (callInfo.getArg(0)->type() != MIRType_String)
|
|
||||||
return InliningStatus_NotInlined;
|
|
||||||
|
|
||||||
callInfo.unwrapArgs();
|
|
||||||
|
|
||||||
MInstruction *exec = MRegExpExec::New(alloc(), callInfo.thisArg(), callInfo.getArg(0));
|
|
||||||
current->add(exec);
|
|
||||||
current->push(exec);
|
|
||||||
if (!resumeAfter(exec))
|
|
||||||
return InliningStatus_Error;
|
|
||||||
|
|
||||||
return InliningStatus_Inlined;
|
|
||||||
}
|
|
||||||
|
|
||||||
IonBuilder::InliningStatus
|
IonBuilder::InliningStatus
|
||||||
IonBuilder::inlineRegExpTest(CallInfo &callInfo)
|
IonBuilder::inlineRegExpTest(CallInfo &callInfo)
|
||||||
{
|
{
|
||||||
|
@ -4892,43 +4892,6 @@ class MRegExp : public MNullaryInstruction
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class MRegExpExec
|
|
||||||
: public MBinaryInstruction,
|
|
||||||
public MixPolicy<ObjectPolicy<1>, StringPolicy<0> >
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
|
|
||||||
MRegExpExec(MDefinition *regexp, MDefinition *string)
|
|
||||||
: MBinaryInstruction(string, regexp)
|
|
||||||
{
|
|
||||||
// May be object or null.
|
|
||||||
setResultType(MIRType_Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
INSTRUCTION_HEADER(RegExpExec)
|
|
||||||
|
|
||||||
static MRegExpExec *New(TempAllocator &alloc, MDefinition *regexp, MDefinition *string) {
|
|
||||||
return new(alloc) MRegExpExec(regexp, string);
|
|
||||||
}
|
|
||||||
|
|
||||||
MDefinition *string() const {
|
|
||||||
return getOperand(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
MDefinition *regexp() const {
|
|
||||||
return getOperand(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
TypePolicy *typePolicy() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool possiblyCalls() const {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class MRegExpTest
|
class MRegExpTest
|
||||||
: public MBinaryInstruction,
|
: public MBinaryInstruction,
|
||||||
public MixPolicy<ObjectPolicy<1>, StringPolicy<0> >
|
public MixPolicy<ObjectPolicy<1>, StringPolicy<0> >
|
||||||
|
@ -100,7 +100,6 @@ namespace jit {
|
|||||||
_(OsrEntry) \
|
_(OsrEntry) \
|
||||||
_(Nop) \
|
_(Nop) \
|
||||||
_(RegExp) \
|
_(RegExp) \
|
||||||
_(RegExpExec) \
|
|
||||||
_(RegExpTest) \
|
_(RegExpTest) \
|
||||||
_(Lambda) \
|
_(Lambda) \
|
||||||
_(ImplicitThis) \
|
_(ImplicitThis) \
|
||||||
|
@ -281,7 +281,6 @@ class ParallelSafetyVisitor : public MInstructionVisitor
|
|||||||
UNSAFE_OP(Pow)
|
UNSAFE_OP(Pow)
|
||||||
UNSAFE_OP(PowHalf)
|
UNSAFE_OP(PowHalf)
|
||||||
UNSAFE_OP(RegExpTest)
|
UNSAFE_OP(RegExpTest)
|
||||||
UNSAFE_OP(RegExpExec)
|
|
||||||
UNSAFE_OP(CallInstanceOf)
|
UNSAFE_OP(CallInstanceOf)
|
||||||
UNSAFE_OP(FunctionBoundary)
|
UNSAFE_OP(FunctionBoundary)
|
||||||
UNSAFE_OP(GuardString)
|
UNSAFE_OP(GuardString)
|
||||||
|
Loading…
Reference in New Issue
Block a user