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

Issue 11414130: Naive handling of List#[] and List#[]= (Closed)

Created:
8 years, 1 month ago by polux
Modified:
7 years, 11 months ago
Reviewers:
karlklose
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Naive handling of List#[] and List#[]= Committed: https://code.google.com/p/dart/source/detail?r=17568

Patch Set 1 #

Patch Set 2 : handle list literals and new List(length) properly #

Patch Set 3 : sync to head #

Patch Set 4 : sync to head, fix bugs #

Total comments: 3

Patch Set 5 : Sync to head and default lists to JsArray #

Patch Set 6 : Try to fix side-by-side diff. #

Patch Set 7 : remove dead code #

Total comments: 17

Patch Set 8 : Address Karl's comments and sync to head. #

Patch Set 9 : Sync to head #

Unified diffs Side-by-side diffs Delta from patch set Stats (+212 lines, -41 lines) Patch
M sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart View 1 2 3 4 5 6 7 16 chunks +158 lines, -38 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/types/types.dart View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M tests/compiler/dart2js/cpa_inference_test.dart View 1 2 3 4 5 6 7 4 chunks +51 lines, -2 lines 0 comments Download
M tests/compiler/dart2js/mock_compiler.dart View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
polux
Don't review that CL yet, I'll update it when eveything it depends on has been ...
8 years, 1 month ago (2012-11-22 14:00:35 UTC) #1
polux
The CL is now ready for review. https://chromiumcodereview.appspot.com/11414130/diff/7001/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart File sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart (right): https://chromiumcodereview.appspot.com/11414130/diff/7001/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart#newcode909 sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart:909: listConstructor = ...
8 years ago (2012-12-13 11:42:03 UTC) #2
polux
Synced to head and defaulted Lists to JsArray. Ready to be reviewed.
7 years, 11 months ago (2013-01-17 14:51:45 UTC) #3
karlklose
LGTM. https://codereview.chromium.org/11414130/diff/7001/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart File sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart (right): https://codereview.chromium.org/11414130/diff/7001/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart#newcode372 sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart:372: * When true, the string litteral [:"__dynamic_for_test":] is ...
7 years, 11 months ago (2013-01-23 13:16:55 UTC) #4
polux
7 years, 11 months ago (2013-01-24 13:12:22 UTC) #5
https://chromiumcodereview.appspot.com/11414130/diff/7001/sdk/lib/_internal/c...
File
sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
(right):

https://chromiumcodereview.appspot.com/11414130/diff/7001/sdk/lib/_internal/c...
sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart:372:
* When true, the string litteral [:"__dynamic_for_test":] is inferred to
On 2013/01/23 13:16:55, karlklose wrote:
> 'litteral' -> 'literal'.

Done.

https://chromiumcodereview.appspot.com/11414130/diff/14003/sdk/lib/_internal/...
File
sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
(right):

https://chromiumcodereview.appspot.com/11414130/diff/14003/sdk/lib/_internal/...
sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart:285:
final ClassBaseType jsArrayBaseType;
On 2013/01/23 13:16:55, karlklose wrote:
> I would still call this listBaseType and perhaps add a comment in the function
> that looks it up, that in the JsBackend this is a special implementation
class.

Done.

https://chromiumcodereview.appspot.com/11414130/diff/14003/sdk/lib/_internal/...
sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart:290:
static _getJsArrayClass(Compiler compiler) {
On 2013/01/23 13:16:55, karlklose wrote:
> You could call it 'getNativeListClass' and then switch on the backend type.
> It could make sense to run the analysis with dart2dart as a pure analysis
tool.
> Or even have a separate backend that produces a serialization of the analysis'
> results to be used with other tools.

Done.

https://chromiumcodereview.appspot.com/11414130/diff/14003/sdk/lib/_internal/...
sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart:409:
* Constants representing builtin base types. Initialized in [initialize]
On 2013/01/23 13:16:55, karlklose wrote:
> The explanation why these are not directly initialized could be shared for the
> next four fields. 

Wasn't sure what you meant by "shared": I just erased the others. My concern was
that dartdoc doesn't preserve the declaration order but on the other hand, I'm
not sure we're ever gonna generate dartdoc for dart2js.

https://chromiumcodereview.appspot.com/11414130/diff/14003/sdk/lib/_internal/...
sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart:420:
FunctionElement jsArrayBrackets;
On 2013/01/23 13:16:55, karlklose wrote:
> How about calling this 'listIndex' ...

Done.

https://chromiumcodereview.appspot.com/11414130/diff/14003/sdk/lib/_internal/...
sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart:427:
FunctionElement jsArrayBracketsEquals;
On 2013/01/23 13:16:55, karlklose wrote:
> ... and this one 'listIndexSet'.

Done.

https://chromiumcodereview.appspot.com/11414130/diff/14003/sdk/lib/_internal/...
sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart:622:
/** Augment the inferred type of elements stored in Lists. */
On 2013/01/23 13:16:55, karlklose wrote:
> You can use /// instead of /** ... */ 

Done.

https://chromiumcodereview.appspot.com/11414130/diff/14003/sdk/lib/_internal/...
sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart:839:
/* Handles external methods that cannot be cached because they depend on some
On 2013/01/23 13:16:55, karlklose wrote:
> Make this a valid dart-doc comment.

Done.

https://chromiumcodereview.appspot.com/11414130/diff/14003/sdk/lib/_internal/...
sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart:885:
} else {  // external method
On 2013/01/23 13:16:55, karlklose wrote:
> All external functions should be patched when we arrive here.
> 
> Could these be abstract methods, factory redirections or const constructors?

As discussed, I'll handle this in an upcoming CL.

Powered by Google App Engine
This is Rietveld 408576698