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

Issue 9417031: Mock up all remaining core library implementation classes. (Closed)

Created:
8 years, 10 months ago by ahe
Modified:
8 years, 10 months ago
Reviewers:
floitsch, ngeoffray, kasperl
CC:
reviews_dartlang.org, karlklose, Lasse Reichstein Nielsen, floitsch
Visibility:
Public.

Description

Mock up all remaining core library implementation classes. Committed: https://code.google.com/p/dart/source/detail?r=4358

Patch Set 1 #

Total comments: 18

Patch Set 2 : Address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1224 lines, -87 lines) Patch
M dart/frog/leg/frog_leg.dart View 1 1 chunk +9 lines, -0 lines 0 comments Download
M dart/frog/leg/lib/core.dart View 1 chunk +1 line, -0 lines 0 comments Download
M dart/frog/leg/lib/coreimpl.dart View 1 chunk +0 lines, -1 line 0 comments Download
M dart/frog/leg/lib/js_helper.dart View 1 chunk +32 lines, -0 lines 0 comments Download
M dart/frog/leg/lib/mock.dart View 1 chunk +5 lines, -1 line 0 comments Download
M dart/frog/leg/lib/mockimpl.dart View 2 chunks +392 lines, -2 lines 0 comments Download
M dart/frog/leg/resolver.dart View 1 3 chunks +10 lines, -8 lines 0 comments Download
M dart/frog/leg/ssa/builder.dart View 1 1 chunk +1 line, -2 lines 0 comments Download
M dart/frog/leg/ssa/closure.dart View 2 chunks +9 lines, -1 line 0 comments Download
M dart/tests/co19/co19-leg.status View 11 chunks +763 lines, -68 lines 0 comments Download
M dart/tests/corelib/corelib-leg.status View 1 chunk +1 line, -1 line 0 comments Download
M dart/tests/language/language-leg.status View 2 chunks +1 line, -3 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
ahe
Total: 3084 tests * 258 tests will be skipped * 1 tests are expected to ...
8 years, 10 months ago (2012-02-16 23:56:09 UTC) #1
kasperl
LGTM. https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/frog_leg.dart File dart/frog/leg/frog_leg.dart (right): https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/frog_leg.dart#newcode111 dart/frog/leg/frog_leg.dart:111: if (element.position() === null) element = element.enclosingElement; Maybe ...
8 years, 10 months ago (2012-02-17 06:03:30 UTC) #2
ahe
Maybe I should add some TODOs. But I think I also need to prepare some ...
8 years, 10 months ago (2012-02-17 07:40:47 UTC) #3
ngeoffray
DBC https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/frog_leg.dart File dart/frog/leg/frog_leg.dart (right): https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/frog_leg.dart#newcode111 dart/frog/leg/frog_leg.dart:111: if (element.position() === null) element = element.enclosingElement; On ...
8 years, 10 months ago (2012-02-17 10:03:50 UTC) #4
floitsch
https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/ssa/builder.dart File dart/frog/leg/ssa/builder.dart (right): https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/ssa/builder.dart#newcode323 dart/frog/leg/ssa/builder.dart:323: "Could not find value", element: element); While you are ...
8 years, 10 months ago (2012-02-17 10:40:39 UTC) #5
floitsch
https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/ssa/builder.dart File dart/frog/leg/ssa/builder.dart (right): https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/ssa/builder.dart#newcode323 dart/frog/leg/ssa/builder.dart:323: "Could not find value", element: element); While you are ...
8 years, 10 months ago (2012-02-17 10:40:39 UTC) #6
ahe
8 years, 10 months ago (2012-02-17 16:26:45 UTC) #7
Hi Kasper, Florian, and Nicolas.

Thank you for taking a look and for all your suggestions.

Cheers,
Peter

https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/frog_leg....
File dart/frog/leg/frog_leg.dart (right):

https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/frog_leg....
dart/frog/leg/frog_leg.dart:111: if (element.position() === null) element =
element.enclosingElement;
On 2012/02/17 10:03:50, ngeoffray wrote:
> On 2012/02/17 07:40:47, ahe wrote:
> > On 2012/02/17 06:03:31, kasperl wrote:
> > > Maybe add a comment on when this happens? What kind of elements do not
have
> a
> > > position? Would it make sense to have a helper on the element that runs
out
> > > through the enclosingElement chain until it finds an element with a
> position?
> > 
> > I'm not sure this API is where I want it. For example, if we need a
synthetic
> > "this" element, it's position should probably be the span of the entire
method
> > to which it corresponds. In other words, a Node, not a Token.
> > 
> > I think something is broken in the SSA builder and closurizer. It is
creating
> > ad-hoc elements (which is really something the resolver should provide), and
> it
> > creates the wrong kind of elements using "new Element" and doesn't record
> > positions. Later it gets confused by these ad-hoc elements and tries to
report
> > an internal error.
> > 
> > I think I need to write up something about how to use elements and how to
> > maintain a sane semantic model. Right now, I can see that the SSA builder
and
> > the type checker are repeating work that earlier phases should take of.
> 
> The thing is, the backend should not cancel on elements. It does not know
> whether an element is part of the model or is a synthetized element created
just
> for its purposes. Another alternative that we talked about with Florian is to
> have an interface BackendElement that all elements created by the backend
should
> implement.
> 
> Also, only the backend and the emitter see these synthetized elements. The
> resolver and type checker never see them.

Nicolas and I went back to the drawing board, and I'll follow up on that later.

https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/lib/mocki...
File dart/frog/leg/lib/mockimpl.dart (right):

https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/lib/mocki...
dart/frog/leg/lib/mockimpl.dart:105: class TimeZoneImplementation implements
TimeZone {
On 2012/02/17 10:03:50, ngeoffray wrote:
> Why do you need to copy this over?

I need the constructors.

https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/resolver....
File dart/frog/leg/resolver.dart (right):

https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/resolver....
dart/frog/leg/resolver.dart:79: visitor.inInstanceContext = true;
On 2012/02/17 10:03:50, ngeoffray wrote:
> I don't think you need to set the flag. It's already set line 458 by checking
> isGenerativeConstructor.

Done.

https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/ssa/build...
File dart/frog/leg/ssa/builder.dart (right):

https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/ssa/build...
dart/frog/leg/ssa/builder.dart:323: "Could not find value", element: element);
On 2012/02/17 10:40:40, floitsch wrote:
> While you are it: with "Cannot find value" it fits on one line (I think).

Done.

https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/ssa/closu...
File dart/frog/leg/ssa/closure.dart (right):

https://chromiumcodereview.appspot.com/9417031/diff/1/dart/frog/leg/ssa/closu...
dart/frog/leg/ssa/closure.dart:370: // parameters, etc. Other phases should only
visit statements.
On 2012/02/17 10:03:50, ngeoffray wrote:
> Not sure I understand this comment, because the backend does not create
> parameters.

The backend should run through "element.computeParameters(compiler)" instead of
calling visitChildren that will visit the very confusing parameter list.

Powered by Google App Engine
This is Rietveld 408576698