WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
170102
Air::Liveness shouldn't need HashSets
https://bugs.webkit.org/show_bug.cgi?id=170102
Summary
Air::Liveness shouldn't need HashSets
Filip Pizlo
Reported
2017-03-25 14:40:18 PDT
Patch forthcoming.
Attachments
it begins
(21.69 KB, patch)
2017-03-25 14:46 PDT
,
Filip Pizlo
no flags
Details
Formatted Diff
Diff
the patch
(28.53 KB, patch)
2017-03-25 19:13 PDT
,
Filip Pizlo
no flags
Details
Formatted Diff
Diff
the patch
(21.00 KB, patch)
2017-03-25 19:15 PDT
,
Filip Pizlo
no flags
Details
Formatted Diff
Diff
the patch
(22.31 KB, patch)
2017-03-26 13:34 PDT
,
Filip Pizlo
ysuzuki
: review+
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Filip Pizlo
Comment 1
2017-03-25 14:46:54 PDT
Created
attachment 305400
[details]
it begins
Filip Pizlo
Comment 2
2017-03-25 15:45:21 PDT
It works, but it looks like a slow-down!
Filip Pizlo
Comment 3
2017-03-25 19:13:32 PDT
Created
attachment 305410
[details]
the patch
Build Bot
Comment 4
2017-03-25 19:14:49 PDT
Attachment 305410
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/b3/B3TimingScope.cpp:60: More than one command on the same line [whitespace/newline] [4] ERROR: Source/WTF/wtf/Vector.h:1516: More than one command on the same line [whitespace/newline] [4] Total errors found: 2 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Filip Pizlo
Comment 5
2017-03-25 19:15:40 PDT
Created
attachment 305411
[details]
the patch
Build Bot
Comment 6
2017-03-25 19:17:38 PDT
Attachment 305411
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/b3/B3TimingScope.cpp:60: More than one command on the same line [whitespace/newline] [4] ERROR: Source/WTF/wtf/Vector.h:1516: More than one command on the same line [whitespace/newline] [4] Total errors found: 2 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Filip Pizlo
Comment 7
2017-03-26 13:34:05 PDT
Created
attachment 305435
[details]
the patch
Build Bot
Comment 8
2017-03-26 13:37:24 PDT
Attachment 305435
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/b3/B3TimingScope.cpp:60: More than one command on the same line [whitespace/newline] [4] ERROR: Source/WTF/wtf/Vector.h:1516: More than one command on the same line [whitespace/newline] [4] Total errors found: 2 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Yusuke Suzuki
Comment 9
2017-03-26 15:01:47 PDT
Comment on
attachment 305435
[details]
the patch View in context:
https://bugs.webkit.org/attachment.cgi?id=305435&action=review
r=me
> Source/JavaScriptCore/ChangeLog:11 > + compile time progression on WasmBench.
Cool.
> Source/JavaScriptCore/b3/air/AirLiveness.h:133 > dirtyBlocks.set(blockIndex);
Cool.
> Source/JavaScriptCore/b3/air/AirLiveness.h:188 > + liveAtTail = m_workset.values();
OK, m_workset.values() is already sorted.
> Source/JavaScriptCore/b3/air/AirLiveness.h:202 > + mergeBuffer.resize(0); > + mergeBuffer.reserveCapacity(liveAtTail.size() + m_workset.size()); > + auto iter = mergeDeduplicatedSorted( > + liveAtTail.begin(), liveAtTail.end(), > + m_workset.begin(), m_workset.end(), > + mergeBuffer.begin()); > + mergeBuffer.resize(iter - mergeBuffer.begin()); > + > + if (mergeBuffer.size() == liveAtTail.size()) > + continue; > + > + RELEASE_ASSERT(mergeBuffer.size() > liveAtTail.size()); > + liveAtTail = mergeBuffer;
OK, merging 2 sorted sequence into one sorted mergeBuffer.
> Source/JavaScriptCore/b3/air/AirTmp.h:95 > +
Is this used?
> Source/JavaScriptCore/b3/air/AirTmp.h:149 > + }
Ditto.
Filip Pizlo
Comment 10
2017-03-26 15:06:02 PDT
(In reply to Yusuke Suzuki from
comment #9
)
> Comment on
attachment 305435
[details]
> the patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=305435&action=review
> > r=me > > > Source/JavaScriptCore/ChangeLog:11 > > + compile time progression on WasmBench. > > Cool. > > > Source/JavaScriptCore/b3/air/AirLiveness.h:133 > > dirtyBlocks.set(blockIndex); > > Cool. > > > Source/JavaScriptCore/b3/air/AirLiveness.h:188 > > + liveAtTail = m_workset.values(); > > OK, m_workset.values() is already sorted. > > > Source/JavaScriptCore/b3/air/AirLiveness.h:202 > > + mergeBuffer.resize(0); > > + mergeBuffer.reserveCapacity(liveAtTail.size() + m_workset.size()); > > + auto iter = mergeDeduplicatedSorted( > > + liveAtTail.begin(), liveAtTail.end(), > > + m_workset.begin(), m_workset.end(), > > + mergeBuffer.begin()); > > + mergeBuffer.resize(iter - mergeBuffer.begin()); > > + > > + if (mergeBuffer.size() == liveAtTail.size()) > > + continue; > > + > > + RELEASE_ASSERT(mergeBuffer.size() > liveAtTail.size()); > > + liveAtTail = mergeBuffer; > > OK, merging 2 sorted sequence into one sorted mergeBuffer. > > > Source/JavaScriptCore/b3/air/AirTmp.h:95 > > + > > Is this used?
It's meant to be a replacement for when we say Arg(tmp).bank(). I think I may have used it in an earlier version of this patch.
> > > Source/JavaScriptCore/b3/air/AirTmp.h:149 > > + } > > Ditto.
Same thing, earlier version of this patch.
Filip Pizlo
Comment 11
2017-03-26 15:11:45 PDT
Landed in
r214409
.
Yusuke Suzuki
Comment 12
2017-03-26 17:49:17 PDT
Comment on
attachment 305435
[details]
the patch View in context:
https://bugs.webkit.org/attachment.cgi?id=305435&action=review
Oops, one nit comment.
> Source/JavaScriptCore/b3/air/AirLiveness.h:191 > + mergeBuffer.reserveCapacity(liveAtTail.size() + m_workset.size());
I think this just allocates capacity(), but the size() of mergeBuffer is still zero. So, I think the following mergeDeduplicatedSorted is not safe especially in regards of ASAN. I think we need to perform `resize(liveAtTail.size() + m_workset.size()` here.
Filip Pizlo
Comment 13
2017-03-26 17:52:10 PDT
(In reply to Yusuke Suzuki from
comment #12
)
> Comment on
attachment 305435
[details]
> the patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=305435&action=review
> > Oops, one nit comment. > > > Source/JavaScriptCore/b3/air/AirLiveness.h:191 > > + mergeBuffer.reserveCapacity(liveAtTail.size() + m_workset.size()); > > I think this just allocates capacity(), but the size() of mergeBuffer is > still zero. > So, I think the following mergeDeduplicatedSorted is not safe especially in > regards of ASAN. > I think we need to perform `resize(liveAtTail.size() + m_workset.size()` > here.
You're right! Previously this was OK because I was using uncheckedAppend but then I switched to insertion iterators.
Filip Pizlo
Comment 14
2017-03-26 19:20:06 PDT
(In reply to Filip Pizlo from
comment #13
)
> (In reply to Yusuke Suzuki from
comment #12
) > > Comment on
attachment 305435
[details]
> > the patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=305435&action=review
> > > > Oops, one nit comment. > > > > > Source/JavaScriptCore/b3/air/AirLiveness.h:191 > > > + mergeBuffer.reserveCapacity(liveAtTail.size() + m_workset.size()); > > > > I think this just allocates capacity(), but the size() of mergeBuffer is > > still zero. > > So, I think the following mergeDeduplicatedSorted is not safe especially in > > regards of ASAN. > > I think we need to perform `resize(liveAtTail.size() + m_workset.size()` > > here. > > You're right! Previously this was OK because I was using uncheckedAppend > but then I switched to insertion iterators.
Fixed in
https://bugs.webkit.org/show_bug.cgi?id=170111
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug