Bug 1093573 part 5 - Baseline-compile JSOP_GENERATOR. r=wingo

This commit is contained in:
Jan de Mooij 2014-11-11 15:12:26 +01:00
parent 41cf2228a5
commit 60aac04766
4 changed files with 30 additions and 0 deletions

View File

@ -3235,3 +3235,24 @@ BaselineCompiler::emit_JSOP_REST()
frame.push(R0);
return true;
}
typedef JSObject *(*CreateGeneratorFn)(JSContext *, BaselineFrame *);
static const VMFunction CreateGeneratorInfo = FunctionInfo<CreateGeneratorFn>(jit::CreateGenerator);
bool
BaselineCompiler::emit_JSOP_GENERATOR()
{
MOZ_ASSERT(frame.stackDepth() == 0);
masm.loadBaselineFramePtr(BaselineFrameReg, R0.scratchReg());
prepareVMCall();
pushArg(R0.scratchReg());
if (!callVM(CreateGeneratorInfo))
return false;
masm.tagValue(JSVAL_TYPE_OBJECT, ReturnReg, R0);
frame.push(R0);
return true;
}

View File

@ -173,6 +173,7 @@ namespace jit {
_(JSOP_MOREITER) \
_(JSOP_ISNOITER) \
_(JSOP_ENDITER) \
_(JSOP_GENERATOR) \
_(JSOP_CALLEE) \
_(JSOP_SETRVAL) \
_(JSOP_RETRVAL) \

View File

@ -829,6 +829,12 @@ DebugEpilogue(JSContext *cx, BaselineFrame *frame, jsbytecode *pc, bool ok)
return ok;
}
JSObject *
CreateGenerator(JSContext *cx, BaselineFrame *frame)
{
return GeneratorObject::create(cx, frame);
}
bool
StrictEvalPrologue(JSContext *cx, BaselineFrame *frame)
{

View File

@ -706,6 +706,8 @@ bool DebugPrologue(JSContext *cx, BaselineFrame *frame, jsbytecode *pc, bool *mu
bool DebugEpilogue(JSContext *cx, BaselineFrame *frame, jsbytecode *pc, bool ok);
bool DebugEpilogueOnBaselineReturn(JSContext *cx, BaselineFrame *frame, jsbytecode *pc);
JSObject *CreateGenerator(JSContext *cx, BaselineFrame *frame);
bool StrictEvalPrologue(JSContext *cx, BaselineFrame *frame);
bool HeavyweightFunPrologue(JSContext *cx, BaselineFrame *frame);