mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 993071 - Rename FunctionBoundary IR instructions to ProfilerStackOp. r=luke
This commit is contained in:
parent
ecb585d8ae
commit
85c81d99a9
@ -35,9 +35,9 @@ class ProfileEntry
|
||||
// if a sample were taken it would be examining bogus information.
|
||||
//
|
||||
// A ProfileEntry represents both a C++ profile entry and a JS one. Both use
|
||||
// the string as a description, but JS uses the sp as nullptr to indicate
|
||||
// that it is a JS entry. The script_ is then only ever examined for a JS
|
||||
// entry, and the idx is used by both, but with different meanings.
|
||||
// the string as a description, but JS uses the sp as nullptr or (void*)1 to
|
||||
// indicate that it is a JS entry. The script_ is then only ever examined for
|
||||
// a JS entry, and the idx is used by both, but with different meanings.
|
||||
//
|
||||
const char * volatile string; // Descriptive string of this entry
|
||||
void * volatile sp; // Relevant stack pointer for the entry
|
||||
|
@ -7938,15 +7938,15 @@ static const VMFunction SPSEnterInfo = FunctionInfo<SPSFn>(SPSEnter);
|
||||
static const VMFunction SPSExitInfo = FunctionInfo<SPSFn>(SPSExit);
|
||||
|
||||
bool
|
||||
CodeGenerator::visitFunctionBoundary(LFunctionBoundary *lir)
|
||||
CodeGenerator::visitProfilerStackOp(LProfilerStackOp *lir)
|
||||
{
|
||||
Register temp = ToRegister(lir->temp()->output());
|
||||
bool inlinedFunction = lir->inlineLevel() > 0;
|
||||
|
||||
switch (lir->type()) {
|
||||
case MFunctionBoundary::Inline_Enter:
|
||||
case MProfilerStackOp::InlineEnter:
|
||||
// Multiple scripts can be inlined at one depth, but there is only
|
||||
// one Inline_Exit node to signify this. To deal with this, if we
|
||||
// one InlineExit node to signify this. To deal with this, if we
|
||||
// reach the entry of another inline script on the same level, then
|
||||
// just reset the sps metadata about the frame. We must balance
|
||||
// calls to leave()/reenter(), so perform the balance without
|
||||
@ -7965,7 +7965,7 @@ CodeGenerator::visitFunctionBoundary(LFunctionBoundary *lir)
|
||||
return false;
|
||||
// fallthrough
|
||||
|
||||
case MFunctionBoundary::Enter:
|
||||
case MProfilerStackOp::Enter:
|
||||
if (gen->options.spsSlowAssertionsEnabled()) {
|
||||
if (!inlinedFunction || js_JitOptions.profileInlineFrames) {
|
||||
saveLive(lir);
|
||||
@ -7980,7 +7980,7 @@ CodeGenerator::visitFunctionBoundary(LFunctionBoundary *lir)
|
||||
|
||||
return sps_.push(lir->script(), masm, temp, /* inlinedFunction = */ inlinedFunction);
|
||||
|
||||
case MFunctionBoundary::Inline_Exit:
|
||||
case MProfilerStackOp::InlineExit:
|
||||
// all inline returns were covered with ::Exit, so we just need to
|
||||
// maintain the state of inline frames currently active and then
|
||||
// reenter the caller
|
||||
@ -7988,7 +7988,7 @@ CodeGenerator::visitFunctionBoundary(LFunctionBoundary *lir)
|
||||
sps_.reenter(masm, temp, /* inlinedFunction = */ true);
|
||||
return true;
|
||||
|
||||
case MFunctionBoundary::Exit:
|
||||
case MProfilerStackOp::Exit:
|
||||
if (gen->options.spsSlowAssertionsEnabled()) {
|
||||
if (!inlinedFunction || js_JitOptions.profileInlineFrames) {
|
||||
saveLive(lir);
|
||||
@ -8008,7 +8008,7 @@ CodeGenerator::visitFunctionBoundary(LFunctionBoundary *lir)
|
||||
return true;
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("invalid LFunctionBoundary type");
|
||||
MOZ_ASSUME_UNREACHABLE("invalid LProfilerStackOp type");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -274,7 +274,7 @@ class CodeGenerator : public CodeGeneratorSpecific
|
||||
bool visitInstanceOfO(LInstanceOfO *ins);
|
||||
bool visitInstanceOfV(LInstanceOfV *ins);
|
||||
bool visitCallInstanceOf(LCallInstanceOf *ins);
|
||||
bool visitFunctionBoundary(LFunctionBoundary *lir);
|
||||
bool visitProfilerStackOp(LProfilerStackOp *lir);
|
||||
bool visitGetDOMProperty(LGetDOMProperty *lir);
|
||||
bool visitGetDOMMember(LGetDOMMember *lir);
|
||||
bool visitSetDOMProperty(LSetDOMProperty *lir);
|
||||
|
@ -654,7 +654,7 @@ IonBuilder::build()
|
||||
// Emit the start instruction, so we can begin real instructions.
|
||||
current->makeStart(MStart::New(alloc(), MStart::StartType_Default));
|
||||
if (instrumentedProfiling())
|
||||
current->add(MFunctionBoundary::New(alloc(), script(), MFunctionBoundary::Enter));
|
||||
current->add(MProfilerStackOp::New(alloc(), script(), MProfilerStackOp::Enter));
|
||||
|
||||
// Guard against over-recursion. Do this before we start unboxing, since
|
||||
// this will create an OSI point that will read the incoming argument
|
||||
@ -791,11 +791,11 @@ IonBuilder::buildInline(IonBuilder *callerBuilder, MResumePoint *callerResumePoi
|
||||
// All further instructions generated in from this scope should be
|
||||
// considered as part of the function that we're inlining. We also need to
|
||||
// keep track of the inlining depth because all scripts inlined on the same
|
||||
// level contiguously have only one Inline_Exit node.
|
||||
// level contiguously have only one InlineExit node.
|
||||
if (instrumentedProfiling()) {
|
||||
predecessor->add(MFunctionBoundary::New(alloc(), script(),
|
||||
MFunctionBoundary::Inline_Enter,
|
||||
inliningDepth_));
|
||||
predecessor->add(MProfilerStackOp::New(alloc(), script(),
|
||||
MProfilerStackOp::InlineEnter,
|
||||
inliningDepth_));
|
||||
}
|
||||
|
||||
predecessor->end(MGoto::New(alloc(), current));
|
||||
@ -3628,8 +3628,8 @@ IonBuilder::processReturn(JSOp op)
|
||||
}
|
||||
|
||||
if (instrumentedProfiling()) {
|
||||
current->add(MFunctionBoundary::New(alloc(), script(), MFunctionBoundary::Exit,
|
||||
inliningDepth_));
|
||||
current->add(MProfilerStackOp::New(alloc(), script(), MProfilerStackOp::Exit,
|
||||
inliningDepth_));
|
||||
}
|
||||
MReturn *ret = MReturn::New(alloc(), def);
|
||||
current->end(ret);
|
||||
@ -3961,9 +3961,9 @@ IonBuilder::inlineScriptedCall(CallInfo &callInfo, JSFunction *target)
|
||||
return false;
|
||||
returnBlock->setCallerResumePoint(callerResumePoint_);
|
||||
|
||||
// When profiling add Inline_Exit instruction to indicate end of inlined function.
|
||||
// When profiling add InlineExit instruction to indicate end of inlined function.
|
||||
if (instrumentedProfiling())
|
||||
returnBlock->add(MFunctionBoundary::New(alloc(), nullptr, MFunctionBoundary::Inline_Exit));
|
||||
returnBlock->add(MProfilerStackOp::New(alloc(), nullptr, MProfilerStackOp::InlineExit));
|
||||
|
||||
// Inherit the slots from current and pop |fun|.
|
||||
returnBlock->inheritSlots(current);
|
||||
|
@ -5695,12 +5695,12 @@ class LCallInstanceOf : public LCallInstructionHelper<1, BOX_PIECES+1, 0>
|
||||
static const size_t RHS = BOX_PIECES;
|
||||
};
|
||||
|
||||
class LFunctionBoundary : public LInstructionHelper<0, 0, 1>
|
||||
class LProfilerStackOp : public LInstructionHelper<0, 0, 1>
|
||||
{
|
||||
public:
|
||||
LIR_HEADER(FunctionBoundary)
|
||||
LIR_HEADER(ProfilerStackOp)
|
||||
|
||||
LFunctionBoundary(const LDefinition &temp) {
|
||||
LProfilerStackOp(const LDefinition &temp) {
|
||||
setTemp(0, temp);
|
||||
}
|
||||
|
||||
@ -5709,15 +5709,15 @@ class LFunctionBoundary : public LInstructionHelper<0, 0, 1>
|
||||
}
|
||||
|
||||
JSScript *script() {
|
||||
return mir_->toFunctionBoundary()->script();
|
||||
return mir_->toProfilerStackOp()->script();
|
||||
}
|
||||
|
||||
MFunctionBoundary::Type type() {
|
||||
return mir_->toFunctionBoundary()->type();
|
||||
MProfilerStackOp::Type type() {
|
||||
return mir_->toProfilerStackOp()->type();
|
||||
}
|
||||
|
||||
unsigned inlineLevel() {
|
||||
return mir_->toFunctionBoundary()->inlineLevel();
|
||||
return mir_->toProfilerStackOp()->inlineLevel();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -272,7 +272,7 @@
|
||||
_(CallInstanceOf) \
|
||||
_(InterruptCheck) \
|
||||
_(InterruptCheckImplicit) \
|
||||
_(FunctionBoundary) \
|
||||
_(ProfilerStackOp) \
|
||||
_(GetDOMProperty) \
|
||||
_(GetDOMMember) \
|
||||
_(SetDOMProperty) \
|
||||
|
@ -3358,9 +3358,9 @@ LIRGenerator::visitCallInstanceOf(MCallInstanceOf *ins)
|
||||
}
|
||||
|
||||
bool
|
||||
LIRGenerator::visitFunctionBoundary(MFunctionBoundary *ins)
|
||||
LIRGenerator::visitProfilerStackOp(MProfilerStackOp *ins)
|
||||
{
|
||||
LFunctionBoundary *lir = new(alloc()) LFunctionBoundary(temp());
|
||||
LProfilerStackOp *lir = new(alloc()) LProfilerStackOp(temp());
|
||||
if (!add(lir, ins))
|
||||
return false;
|
||||
// If slow assertions are enabled, then this node will result in a callVM
|
||||
|
@ -238,7 +238,7 @@ class LIRGenerator : public LIRGeneratorSpecific
|
||||
bool visitInArray(MInArray *ins);
|
||||
bool visitInstanceOf(MInstanceOf *ins);
|
||||
bool visitCallInstanceOf(MCallInstanceOf *ins);
|
||||
bool visitFunctionBoundary(MFunctionBoundary *ins);
|
||||
bool visitProfilerStackOp(MProfilerStackOp *ins);
|
||||
bool visitIsCallable(MIsCallable *ins);
|
||||
bool visitHaveSameClass(MHaveSameClass *ins);
|
||||
bool visitHasClass(MHasClass *ins);
|
||||
|
@ -9217,15 +9217,15 @@ class MNewStringObject :
|
||||
// Node that represents that a script has begun executing. This comes at the
|
||||
// start of the function and is called once per function (including inline
|
||||
// ones)
|
||||
class MFunctionBoundary : public MNullaryInstruction
|
||||
class MProfilerStackOp : public MNullaryInstruction
|
||||
{
|
||||
public:
|
||||
enum Type {
|
||||
Enter, // a function has begun executing and it is not inline
|
||||
Exit, // any function has exited (inlined or normal)
|
||||
Inline_Enter, // an inline function has begun executing
|
||||
InlineEnter, // an inline function has begun executing
|
||||
|
||||
Inline_Exit // all instructions of an inline function are done, a
|
||||
InlineExit // all instructions of an inline function are done, a
|
||||
// return from the inline function could have occurred
|
||||
// before this boundary
|
||||
};
|
||||
@ -9235,20 +9235,20 @@ class MFunctionBoundary : public MNullaryInstruction
|
||||
Type type_;
|
||||
unsigned inlineLevel_;
|
||||
|
||||
MFunctionBoundary(JSScript *script, Type type, unsigned inlineLevel)
|
||||
MProfilerStackOp(JSScript *script, Type type, unsigned inlineLevel)
|
||||
: script_(script), type_(type), inlineLevel_(inlineLevel)
|
||||
{
|
||||
JS_ASSERT_IF(type != Inline_Exit, script != nullptr);
|
||||
JS_ASSERT_IF(type == Inline_Enter, inlineLevel != 0);
|
||||
JS_ASSERT_IF(type != InlineExit, script != nullptr);
|
||||
JS_ASSERT_IF(type == InlineEnter, inlineLevel != 0);
|
||||
setGuard();
|
||||
}
|
||||
|
||||
public:
|
||||
INSTRUCTION_HEADER(FunctionBoundary)
|
||||
INSTRUCTION_HEADER(ProfilerStackOp)
|
||||
|
||||
static MFunctionBoundary *New(TempAllocator &alloc, JSScript *script, Type type,
|
||||
static MProfilerStackOp *New(TempAllocator &alloc, JSScript *script, Type type,
|
||||
unsigned inlineLevel = 0) {
|
||||
return new(alloc) MFunctionBoundary(script, type, inlineLevel);
|
||||
return new(alloc) MProfilerStackOp(script, type, inlineLevel);
|
||||
}
|
||||
|
||||
JSScript *script() {
|
||||
|
@ -187,7 +187,7 @@ namespace jit {
|
||||
_(InstanceOf) \
|
||||
_(CallInstanceOf) \
|
||||
_(InterruptCheck) \
|
||||
_(FunctionBoundary) \
|
||||
_(ProfilerStackOp) \
|
||||
_(GetDOMProperty) \
|
||||
_(GetDOMMember) \
|
||||
_(SetDOMProperty) \
|
||||
|
@ -291,7 +291,7 @@ class ParallelSafetyVisitor : public MInstructionVisitor
|
||||
UNSAFE_OP(RegExpReplace)
|
||||
UNSAFE_OP(StringReplace)
|
||||
UNSAFE_OP(CallInstanceOf)
|
||||
UNSAFE_OP(FunctionBoundary)
|
||||
UNSAFE_OP(ProfilerStackOp)
|
||||
UNSAFE_OP(GuardString)
|
||||
UNSAFE_OP(NewDeclEnvObject)
|
||||
UNSAFE_OP(In)
|
||||
|
Loading…
Reference in New Issue
Block a user