Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Issue 2590913002: Add WorkItemBuilder to abstract WorkItem creation from the enqueuers. (Closed)

Created:
4 years ago by Johnni Winther
Modified:
4 years ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add WorkItemBuilder to abstract WorkItem creation from the enqueuers. R=sigmund@google.com Committed: https://github.com/dart-lang/sdk/commit/2b3c0f18fe35aa3349c5dac3ccc8a93e3b989ff7

Patch Set 1 #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+98 lines, -52 lines) Patch
M pkg/compiler/lib/src/common/backend_api.dart View 2 chunks +9 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/compiler.dart View 1 chunk +3 lines, -0 lines 2 comments Download
M pkg/compiler/lib/src/enqueue.dart View 6 chunks +38 lines, -20 lines 2 comments Download
M pkg/compiler/lib/src/js_backend/backend.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/enqueuer.dart View 5 chunks +44 lines, -26 lines 3 comments Download
M pkg/compiler/lib/src/world.dart View 2 chunks +2 lines, -1 line 0 comments Download
M tests/compiler/dart2js/kernel/try_catch_test.dart View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 7 (2 generated)
Johnni Winther
4 years ago (2016-12-20 15:08:29 UTC) #2
Siggi Cherem (dart-lang)
lgtm if you need to get unblocked, but I'd prefer to (a) keep the type-defs ...
4 years ago (2016-12-20 21:21:47 UTC) #3
Johnni Winther
https://codereview.chromium.org/2590913002/diff/1/pkg/compiler/lib/src/compiler.dart File pkg/compiler/lib/src/compiler.dart (right): https://codereview.chromium.org/2590913002/diff/1/pkg/compiler/lib/src/compiler.dart#newcode772 pkg/compiler/lib/src/compiler.dart:772: } else if (element.isTypedef) { On 2016/12/20 21:21:47, Siggi ...
4 years ago (2016-12-21 10:19:37 UTC) #4
Johnni Winther
Committed patchset #1 (id:1) manually as 2b3c0f18fe35aa3349c5dac3ccc8a93e3b989ff7 (presubmit successful).
4 years ago (2016-12-21 10:37:44 UTC) #6
Siggi Cherem (dart-lang)
4 years ago (2016-12-21 15:08:53 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/2590913002/diff/1/pkg/compiler/lib/src/js_bac...
File pkg/compiler/lib/src/js_backend/enqueuer.dart (right):

https://codereview.chromium.org/2590913002/diff/1/pkg/compiler/lib/src/js_bac...
pkg/compiler/lib/src/js_backend/enqueuer.dart:64: _workItemBuilder = new
CodegenWorkItemBuilder(backend, options),
On 2016/12/21 10:19:37, Johnni Winther wrote:
> On 2016/12/20 21:21:47, Siggi Cherem (dart-lang) wrote:
> > You might be thinking of this already, but can we take this a step further
and
> > get rid of WorkItem altogether?
> > 
> > It seems to me that:
> >  - WorkItem.run() is not called anywhere (except in unittests with useMock,
> > which we can address in a special way anyways). 
> >  - WorkItems are just a wrapper on an entity
> > 
> > So, we could make the queue directly hold entities instead.
> > 
> > You still need something to decide whether to add an entity to the queue, so
> the
> > logic here would become an entity filter, rather than a workitem builder.
> > 
> > Thoughts?
> > 
> > If you like this idea, but removing workItem is a lot of extra work for this
> CL,
> > how about we use the idea of filters but continue using WorkItem a while
> longer?
> > That would make _addToWorkList more like:
> > 
> >   if (_processedEntities.contains(entity)) return;
> >   if (_skipEntity(entity)) return;
> >   ...
> >   _queue.add(new CodegenWorkItem(_backend, entity));
> 
> This move is needed to, eventually, create kernel based resolution work-items
> and kernel-to-ssa based codegen work item. The enqueuer shouldn't case what
> constitutes a work-item.
> 
> Also the createWorkItem signature might in time be changed to
> 
>   Iterable<WorkItem> createWorkItem(MemberEntity entity, EnumSet<MemberUse>
> useSet);
> 
> making the filtering stand less out.

I'm not sure I fully understand, we can chat more on our sync up, but I was
thinking we'd enqueue a MemberEntity and nothing else => the kernel based work
items would be just kernel nodes like procedures?

If the enqueuer doesn't care about what's in it, maybe we should make it generic
and store directly what we need on each case? Basically, I'm not convinced we
need the extra WorkItem wrapper class in the end.

Powered by Google App Engine
This is Rietveld 408576698