Bug 148337 - Add a bunch of operators
Summary: Add a bunch of operators
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Basile Clement
URL:
Keywords:
Depends on:
Blocks: 148662
  Show dependency treegraph
 
Reported: 2015-08-21 15:48 PDT by Basile Clement
Modified: 2015-09-04 10:16 PDT (History)
0 users

See Also:


Attachments
Patch (3.84 KB, patch)
2015-08-21 15:49 PDT, Basile Clement
saam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Basile Clement 2015-08-21 15:48:35 PDT
jsc-tailcall: Add a bunch of operators
Comment 1 Basile Clement 2015-08-21 15:49:02 PDT
Created attachment 259675 [details]
Patch
Comment 2 Saam Barati 2015-08-21 20:28:51 PDT
Comment on attachment 259675 [details]
Patch

r=me
Comment 3 Basile Clement 2015-08-24 11:08:14 PDT
Committed r188870 <http://trac.webkit.org/changeset/188870>.
Comment 4 Basile Clement 2015-08-31 18:17:59 PDT
(In reply to comment #3)
> Committed r188870 <http://trac.webkit.org/changeset/188870>.

This was on the jsc-tailcall branch.
Comment 5 Basile Clement 2015-09-04 09:39:37 PDT
Committed r189351: <http://trac.webkit.org/changeset/189351>
Comment 6 Darin Adler 2015-09-04 09:58:30 PDT
Comment on attachment 259675 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=259675&action=review

> Source/JavaScriptCore/jit/GPRInfo.h:71
> +    bool operator==(JSValueRegs other) { return m_gpr == other.m_gpr; }
> +    bool operator!=(JSValueRegs other) { return !(*this == other); }

Is more efficient code generated if we make the argument type be const JSValueRegs&?

> Source/JavaScriptCore/jit/GPRInfo.h:181
> +    bool operator==(JSValueRegs other) const

Same question.

> Source/JavaScriptCore/jit/GPRInfo.h:186
> +    bool operator!=(JSValueRegs other) const { return !(*this == other); }

Same question.
Comment 7 Basile Clement 2015-09-04 10:16:55 PDT
(In reply to comment #6)
> Comment on attachment 259675 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=259675&action=review
> 
> > Source/JavaScriptCore/jit/GPRInfo.h:71
> > +    bool operator==(JSValueRegs other) { return m_gpr == other.m_gpr; }
> > +    bool operator!=(JSValueRegs other) { return !(*this == other); }
> 
> Is more efficient code generated if we make the argument type be const
> JSValueRegs&?
> 
> > Source/JavaScriptCore/jit/GPRInfo.h:181
> > +    bool operator==(JSValueRegs other) const
> 
> Same question.
> 
> > Source/JavaScriptCore/jit/GPRInfo.h:186
> > +    bool operator!=(JSValueRegs other) const { return !(*this == other); }
> 
> Same question.

JSValueRegs is an integer on 64 bit platforms, and two int8_t (thus packed as a single integer) on 32 bit platforms. So, passing by value is better here.

In practice, it probably doesn't matter at all since those functions will usually be inlined.