Closed
Bug 1446467
Opened 7 years ago
Closed 7 years ago
jit: Fuse JmpSrc and JmpDst
Categories
(Core :: JavaScript Engine: JIT, enhancement, P3)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
WONTFIX
Tracking | Status | |
---|---|---|
firefox61 | --- | affected |
People
(Reporter: bbouvier, Unassigned)
Details
Attachments
(1 file)
38.90 KB,
patch
|
jandem
:
feedback+
|
Details | Diff | Splinter Review |
JmpSrc and JmpDst really are the same thing, so there's no reason to have both imo.
Attachment #8959609 -
Flags: review?(jdemooij)
Updated•7 years ago
|
Priority: -- → P3
Comment 1•7 years ago
|
||
Comment on attachment 8959609 [details] [diff] [review]
refactor-jmpsrc.patch
Review of attachment 8959609 [details] [diff] [review]:
-----------------------------------------------------------------
Makes sense, but one reason for keeping separate classes is for better type safety, although I don't have a strong opinion on this. Nicolas, WDYT?
::: js/src/jit/x86-shared/Patching-x86-shared.h
@@ +58,5 @@
> int32_t rel = GetInt32(where);
> return (char*)where + rel;
> }
>
> +class JmpOffset {
Maybe even JumpOffset?
@@ +68,3 @@
> : offset_(offset)
> {
> + MOZ_RELEASE_ASSERT(offset == size_t(offset_));
This class is used a lot so I'd prefer MOZ_ASSERT.
Attachment #8959609 -
Flags: review?(nicolas.b.pierron)
Attachment #8959609 -
Flags: review?(jdemooij)
Attachment #8959609 -
Flags: feedback+
Comment 2•7 years ago
|
||
Comment on attachment 8959609 [details] [diff] [review]
refactor-jmpsrc.patch
Review of attachment 8959609 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jit/x86-shared/Patching-x86-shared.h
@@ +65,1 @@
> : offset_(-1)
My take is that this default constructor should be removed, even if it means that nextJump should be rewritten using Result<JumpOffset, OOM>, and if the jSrc function should duplicate 4 lines of code. This also implies that we should be able to remove all the MOZ_ASSERT which are checking that the offset is not -1, such as in setNextJump and linkJump. And at the end we convert the offset to a size_t.
Then, I like type safety in general. Maybe something like:
template <int>
class CodeOffset {
public:
explicit CodeOffset(size_t o) : offset_(offset) {}
size_t offset() const { return offset_; }
private:
size_t offset_;
};
using JmpSrc = CodeOffset<0>;
using JmpDst = CodeOffset<1>;
would satisfy both the type safety and code sharing constraints (without as much rewrite).
Attachment #8959609 -
Flags: review?(nicolas.b.pierron)
Reporter | ||
Comment 3•7 years ago
|
||
Alright, considering the push back here and the amount of work needed for your suggestion, I'll just wontfix this. Feel free to re-open if you want to do it.
Assignee: bbouvier → nobody
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•