IonMonkey: Improve style/design of profiling

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: u443197, Assigned: u443197)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

26.85 KB, patch
dvander
: review+
Details | Diff | Splinter Review
(Assignee)

Description

5 years ago
Created attachment 654848 [details] [diff] [review]
patch
(Assignee)

Comment 1

5 years ago
Created attachment 654853 [details] [diff] [review]
patch (v2)
Attachment #654848 - Attachment is obsolete: true
Attachment #654853 - Flags: review?(dvander)
Comment on attachment 654853 [details] [diff] [review]
patch (v2)

Review of attachment 654853 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for doing this!

::: js/src/ion/IonInstrumentation.h
@@ +20,5 @@
> +
> +class IonInstrumentation : public BaseInstrumentation
> +{
> +    jsbytecode **trackedPc_;
> +  public:

nit: newline above public:

::: js/src/ion/IonMacroAssembler.h
@@ +523,5 @@
> +        return ret;
> +    }
> +
> +    // see above comment for what is returned
> +    uint32 callWithExitFrame(IonCode *target, Register dynStack) {

Yay, this seems a lot better.

@@ +535,5 @@
>    private:
> +    // These two functions are helpers used around call sites throughout the
> +    // assembler. They are called from the above call wrappers to emit the
> +    // necessary instrumentation.
> +    void leaveBeforeCall() {

These names are a little vague, it's not clear what "leave" or "call" refers to. Maybe something like  enter/ExitSpsFrame or enter/leaveProfilingFrame?

@@ +539,5 @@
> +    void leaveBeforeCall() {
> +        if (!sps_ || !sps_->enabled())
> +            return;
> +        GeneralRegisterSet regs(Registers::TempMask);
> +        Register r = regs.getAny();

I would just use ReturnReg or CallTempReg0 here, or:

Register r = GeneralRegisterSet(Registers::TempMask).getAny();

@@ +552,5 @@
> +        GeneralRegisterSet regs(Registers::TempMask & ~Registers::JSCallMask &
> +                                                      ~Registers::CallMask);
> +        if (regs.empty()) {
> +            regs = GeneralRegisterSet(Registers::TempMask);
> +            Register r = regs.getAny();

Same here.
Attachment #654853 - Flags: review?(dvander) → review+
(Assignee)

Comment 3

5 years ago
http://hg.mozilla.org/projects/ionmonkey/rev/60b7209fbe71
(Assignee)

Updated

5 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → WORKSFORME
(Assignee)

Updated

5 years ago
Resolution: WORKSFORME → FIXED
(Assignee)

Updated

5 years ago
Assignee: general → alex
You need to log in before you can comment on or make changes to this bug.