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

Issue 609783002: Support static field access in analyzer2dart. (Closed)

Created:
6 years, 2 months ago by Johnni Winther
Modified:
6 years, 2 months ago
Reviewers:
Paul Berry, sigurdm
CC:
reviews_dartlang.org, Brian Wilkerson
Visibility:
Public.

Description

Support static field access in analyzer2dart. Static field declaration is not currently supported in the CPS IR. I've injected the SemanticVisitor as a common superclass of the TypeShakerVisitor and CpsGeneratingVisitor to reuse the classifyX handling. R=paulberry@google.com, sigurdm@google.com Committed: https://code.google.com/p/dart/source/detail?r=40761

Patch Set 1 #

Total comments: 4

Patch Set 2 : Updated cf. comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+606 lines, -172 lines) Patch
M pkg/analyzer2dart/lib/src/closed_world.dart View 1 chunk +8 lines, -0 lines 0 comments Download
M pkg/analyzer2dart/lib/src/converted_world.dart View 2 chunks +23 lines, -5 lines 0 comments Download
M pkg/analyzer2dart/lib/src/cps_generator.dart View 5 chunks +52 lines, -33 lines 0 comments Download
M pkg/analyzer2dart/lib/src/element_converter.dart View 1 chunk +14 lines, -0 lines 0 comments Download
M pkg/analyzer2dart/lib/src/identifier_semantics.dart View 1 chunk +31 lines, -0 lines 0 comments Download
M pkg/analyzer2dart/lib/src/modely.dart View 3 chunks +53 lines, -27 lines 0 comments Download
A pkg/analyzer2dart/lib/src/semantic_visitor.dart View 1 chunk +177 lines, -0 lines 0 comments Download
M pkg/analyzer2dart/lib/src/tree_shaker.dart View 6 chunks +86 lines, -85 lines 0 comments Download
A pkg/analyzer2dart/lib/src/util.dart View 1 chunk +35 lines, -0 lines 0 comments Download
M pkg/analyzer2dart/test/end2end_test.dart View 1 chunk +14 lines, -0 lines 0 comments Download
M pkg/analyzer2dart/test/tree_shaker_test.dart View 1 5 chunks +73 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart View 1 3 chunks +11 lines, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/source_file.dart View 7 chunks +22 lines, -12 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/source_file_provider.dart View 1 chunk +2 lines, -1 line 0 comments Download
M tests/compiler/dart2js/mock_compiler.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js/private_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js/source_mapping_test.dart View 1 chunk +1 line, -2 lines 0 comments Download
M tests/compiler/dart2js/type_checker_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js/warnings_checker.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (1 generated)
Johnni Winther
paulberry@: PTAL at the analyzer2dart implementation. sigurdm@: PTAL at the modifications to dart2js.
6 years, 2 months ago (2014-09-26 11:41:35 UTC) #2
Paul Berry
lgtm https://codereview.chromium.org/609783002/diff/1/pkg/analyzer2dart/test/tree_shaker_test.dart File pkg/analyzer2dart/test/tree_shaker_test.dart (right): https://codereview.chromium.org/609783002/diff/1/pkg/analyzer2dart/test/tree_shaker_test.dart#newcode54 pkg/analyzer2dart/test/tree_shaker_test.dart:54: }); We should probably also test that this ...
6 years, 2 months ago (2014-09-26 16:42:39 UTC) #3
sigurdm
LGTM https://codereview.chromium.org/609783002/diff/1/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart File sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart (right): https://codereview.chromium.org/609783002/diff/1/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart#newcode1473 sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart:1473: selector.kind == SelectorKind.SETTER); Not your code, but it ...
6 years, 2 months ago (2014-09-29 08:59:42 UTC) #4
Johnni Winther
Committed patchset #2 (id:20001) manually as 40761 (presubmit successful).
6 years, 2 months ago (2014-09-29 10:39:07 UTC) #5
Johnni Winther
6 years, 2 months ago (2014-09-29 13:07:25 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/609783002/diff/1/pkg/analyzer2dart/test/tree_...
File pkg/analyzer2dart/test/tree_shaker_test.dart (right):

https://codereview.chromium.org/609783002/diff/1/pkg/analyzer2dart/test/tree_...
pkg/analyzer2dart/test/tree_shaker_test.dart:54: });
On 2014/09/26 16:42:39, Paul Berry wrote:
> We should probably also test that this drags a "call" selector into the world.

> I think we could accomplish that with something like:
> 
> var helper = new TreeshakerTestHelper('''
> class A {
>   void call() {}
>   void baz() {}
> }
> main() {
>   new A();
>   return foo;
> }
> var foo;
> var bar;
> ''');
> helper.assertHasFunction('main');
> helper.assertHasVariable('foo');
> helper.assertNoVariable('bar');
> helper.assertHasInstantiatedClass('A');
> helper.assertHasMethod('A.call');
> helper.assertNoMethod('A.baz');

Added with 'foo()' instead of 'return foo'.

https://codereview.chromium.org/609783002/diff/1/sdk/lib/_internal/compiler/i...
File sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart
(right):

https://codereview.chromium.org/609783002/diff/1/sdk/lib/_internal/compiler/i...
sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart:1473:
selector.kind == SelectorKind.SETTER);
On 2014/09/29 08:59:42, sigurdm wrote:
> Not your code, but it seems we should here only check for getters.

Added a TODO.

Powered by Google App Engine
This is Rietveld 408576698