WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
158032
LLInt should be able to cache prototype loads for values in GetById
https://bugs.webkit.org/show_bug.cgi?id=158032
Summary
LLInt should be able to cache prototype loads for values in GetById
Keith Miller
Reported
2016-05-24 11:36:08 PDT
LLInt should be able to cache prototype loads for values in GetById
Attachments
Patch
(38.09 KB, patch)
2016-05-24 12:31 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Patch
(38.12 KB, patch)
2016-05-24 13:15 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Patch
(38.72 KB, patch)
2016-05-24 14:13 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Patch for landing
(38.72 KB, patch)
2016-05-24 14:14 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Patch for landing
(38.71 KB, patch)
2016-05-24 14:15 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Patch for landing
(39.32 KB, patch)
2016-05-24 14:46 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Patch for landing
(39.36 KB, patch)
2016-05-24 14:48 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Patch for landing
(39.35 KB, patch)
2016-05-24 15:32 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Show Obsolete
(7)
View All
Add attachment
proposed patch, testcase, etc.
Keith Miller
Comment 1
2016-05-24 12:31:14 PDT
Created
attachment 279687
[details]
Patch
Keith Miller
Comment 2
2016-05-24 13:15:47 PDT
Created
attachment 279696
[details]
Patch
Filip Pizlo
Comment 3
2016-05-24 13:24:50 PDT
Comment on
attachment 279696
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=279696&action=review
I think that this would be even better if it integrated with GetByIdStatus. Would that be hard?
> Source/JavaScriptCore/bytecode/GetByIdStatus.cpp:81 > + if (opcode == LLInt::getOpcode(op_get_array_length) || opcode == LLInt::getOpcode(op_try_get_by_id) || opcode == LLInt::getOpcode(op_get_by_id_proto_load))
It would be better if this didn't bail on op_get_by_id_proto_load. Can you add a FIXME that links to a bug?
> Source/JavaScriptCore/bytecode/ObjectPropertyConditionSet.h:81 > + bool isValidAndWatchable() const > + { > + if (!isValid()) > + return false; > + > + for (ObjectPropertyCondition condition : m_data->vector) { > + if (!condition.isWatchable()) > + return false; > + } > + return true; > + }
You should move the body out of line. Also, I'd call this isWatchable() because if you're not valid then you're not watchable.
Geoffrey Garen
Comment 4
2016-05-24 13:26:42 PDT
Needs rebasing.
> Source/JavaScriptCore/bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h:49 > +inline void clearLLIntGetByIdCache(Instruction* instruction)
This belongs in CodeBlock.h.
> Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:618 > + // We know that this pointer will remain valid because it is the prototype of some structure, s, > + // watchpointed above. If any object with structure s were to change prototypes then the conditions > + // for this cache would fail and this value will never be used again.
It is hard to reason about having a dangling pointer and proving that you won't use it. clearLLIntGetByIdCache() should clear this pointer. Then, you can just point out that this pointer is guarded by a watchpoint, and the watchpoint will set this pointer to nullptr if necessary.
> Source/WTF/wtf/Bag.h:64 > + Bag(Bag<T>&& other) > + { > + ASSERT(!m_head); > + std::swap(m_head, other.m_head); > + } > + > + Bag& operator=(Bag<T>&& other) > + { > + std::swap(m_head, other.m_head); > + return *this; > + }
It's generally bad style to use swap in move construction or assignment. The reason is that order of destruction sometimes matters, and the swap approach produces strange destruction order. It's possible to convince yourself through analysis that your particular class does not care about order of destruction, but it's best not to have to do that kind of analysis. I would say instead: m_head = other.m_head; other.m_head = nullptr;
Keith Miller
Comment 5
2016-05-24 14:13:55 PDT
Created
attachment 279703
[details]
Patch
Keith Miller
Comment 6
2016-05-24 14:14:19 PDT
Created
attachment 279704
[details]
Patch for landing
WebKit Commit Bot
Comment 7
2016-05-24 14:15:22 PDT
Comment on
attachment 279704
[details]
Patch for landing Rejecting
attachment 279704
[details]
from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'validate-changelog', '--check-oops', '--non-interactive', 279704, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit ChangeLog entry in Source/JavaScriptCore/ChangeLog contains OOPS!. Full output:
http://webkit-queues.webkit.org/results/1376656
Keith Miller
Comment 8
2016-05-24 14:15:44 PDT
Created
attachment 279706
[details]
Patch for landing
Keith Miller
Comment 9
2016-05-24 14:46:51 PDT
Created
attachment 279708
[details]
Patch for landing
Keith Miller
Comment 10
2016-05-24 14:48:45 PDT
Created
attachment 279709
[details]
Patch for landing
WebKit Commit Bot
Comment 11
2016-05-24 14:51:34 PDT
Attachment 279709
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/CMakeLists.txt:206: Alphabetical sorting problem. "bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp" should be before "bytecode/LazyOperandValueProfile.cpp". [list/order] [5] Total errors found: 1 in 24 files If any of these errors are false positives, please file a bug against check-webkit-style.
Keith Miller
Comment 12
2016-05-24 15:32:38 PDT
Created
attachment 279712
[details]
Patch for landing
WebKit Commit Bot
Comment 13
2016-05-24 16:48:50 PDT
Comment on
attachment 279712
[details]
Patch for landing Clearing flags on attachment: 279712 Committed
r201363
: <
http://trac.webkit.org/changeset/201363
>
WebKit Commit Bot
Comment 14
2016-05-24 16:48:55 PDT
All reviewed patches have been landed. Closing bug.
WebKit Commit Bot
Comment 15
2016-05-31 15:32:13 PDT
Re-opened since this is blocked by
bug 158240
Keith Miller
Comment 16
2016-06-02 14:32:56 PDT
This was rolled back in by
http://trac.webkit.org/changeset/201617
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