Commit Graph

31 Commits

Author SHA1 Message Date
ahe@google.com 7b31e54ab7 Implement override checks.
First attempt committed as: https://code.google.com/p/dart/source/detail?r=9108

Review URL: https://chromiumcodereview.appspot.com//10575033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9151 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-27 09:07:36 +00:00
antonm@google.com 38bf8c295b Revert "Implement override checks."
TBR=ahe@google.com

Review URL: https://chromiumcodereview.appspot.com//10666052

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9112 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-26 14:36:00 +00:00
ahe@google.com 7f2041bf11 Implement override checks.
Review URL: https://chromiumcodereview.appspot.com//10575033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9108 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-26 12:51:55 +00:00
sgjesse@google.com 9ab265364b Improve tracking of the type of fields after object construction
Based on the guarenteed types a field is initialized to in both the
initializer lists and constructor bodies give an optimistic type for
this field. Based on all the field setters and invoked setters for
that field turn this optimistic type into either a propagated type or
a guarenteed type.

R=kasperl@google.com, floitsch@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10638013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9019 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-22 09:29:41 +00:00
floitsch@google.com 3d5769cc8b Remove static fields in the namer.
Review URL: https://chromiumcodereview.appspot.com//10574046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8965 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-21 09:35:08 +00:00
ahe@google.com 84fb6cd409 Remove string constants from Types class.
Review URL: https://chromiumcodereview.appspot.com//10533126

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8660 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-14 14:28:18 +00:00
ahe@google.com 91e2b7794c Resolution based tree-shaking.
Review URL: https://chromiumcodereview.appspot.com//10542073

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8543 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-12 12:35:34 +00:00
ngeoffray@google.com 2cb4416340 Use the typedef arity to know how to invoke a closure given by the dom.
Review URL: https://chromiumcodereview.appspot.com//10441071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8067 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-29 15:53:54 +00:00
ahe@google.com b4be047301 Add locations to diagnostics.
Review URL: https://chromiumcodereview.appspot.com//10389143

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7660 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-15 16:13:44 +00:00
lrn@google.com 8a73514c3d Add a "Label" Node around an Identifier that is being used as a label.
This is in preparation for rewriting switch to match the "new" switch grammar.
I need to make a block information structure for switch statements, and I don't
want to do that on an obsolete structure.

Review URL: https://chromiumcodereview.appspot.com//10392024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7485 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 12:23:45 +00:00
karlklose@google.com 62dd717be3 This fixes a wrong warning about void functions in which not all paths leads to return or throw statement.
TEST=added to type_checker_test
R=ngeoffray@google.com

Review URL: https://chromiumcodereview.appspot.com//10387033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7449 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-09 11:12:42 +00:00
floitsch@google.com 5780b25f60 Sort the output (for now just the classes and instance members).
Review URL: https://chromiumcodereview.appspot.com//10310040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7447 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-09 10:55:27 +00:00
floitsch@google.com 7672f5b74d Fix findMyName by comparing the kind and not the token to EOF_TOKEN.
Review URL: https://chromiumcodereview.appspot.com//10378033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7416 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-08 14:14:34 +00:00
karlklose@google.com e205b4fdb0 Compute function types together with the parameters.
This avoids resolving the types of arguments twice.

Review URL: https://chromiumcodereview.appspot.com//10363003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7374 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-07 12:33:09 +00:00
karlklose@google.com 61f38fde3b Set the right context to resolve types of fields, closures and parameters.
R=ngeoffray@google.com

Review URL: https://chromiumcodereview.appspot.com//10349008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7373 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-07 12:16:59 +00:00
karlklose@google.com 78736ddda9 Remove getType; use the resolver instead.
Review URL: https://chromiumcodereview.appspot.com//10270010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7250 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-02 18:22:32 +00:00
karlklose@google.com c5e3fc4a9f Address the remaining review comments on http://chromiumcodereview.appspot.com/9431029.
Review URL: https://chromiumcodereview.appspot.com//10115026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7216 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-02 08:27:13 +00:00
kasperl@google.com 90796f084c Move all the builtin$ interceptors to a new interceptors library and shorten the names of them.
This re-lands r7187 with a few fixes for VM tests and leg tests.

R=floitsch@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10267020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7191 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-01 15:18:39 +00:00
kasperl@google.com 29ad15f8e3 Revert "Move all the builtin$ interceptors to a new interceptors library and shorten the names of them."
This reverts r7187.

R=floitsch@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10273026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7189 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-01 14:51:21 +00:00
kasperl@google.com 8031e3043a Move all the builtin$ interceptors to a new interceptors library and shorten the names of them.
R=ngeoffray@google.com,floitsch@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10265027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7187 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-01 14:44:12 +00:00
karlklose@google.com 8fa9bf1317 Implement simple dynamic type check.
The generated code for the test is:
(before)
 $.isTrue(typeof x === 'object' && !!x.is$Hest, (void 0));
 $.isFalse(typeof x === 'object' && !!x.is$Hest, (void 0));
(with patch)
 $.setRuntimeTypeInfo(x, ({X: 'int'}));
 var t0 = $.getRuntimeTypeInfo(x);
 $.isTrue(typeof x === 'object' && !!x.is$Hest && typeof t0 === 'object' && t0.X === 'int', (void 0));
 var t1 = $.getRuntimeTypeInfo(x);
 $.isFalse(typeof x === 'object' && !!x.is$Hest && typeof t1 === 'object' && t1.X === 'String', (void 0));

Review URL: https://chromiumcodereview.appspot.com//10232011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7184 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-01 11:26:59 +00:00
ngeoffray@google.com acffc45787 Introduce typed selectors for getters and setters also for better tree shaking.
FYI: Swarm from 862465 to 848387 (14k saved).
Review URL: https://chromiumcodereview.appspot.com//10191016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6997 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-26 10:14:01 +00:00
ngeoffray@google.com 78b7ced997 Introduce typed selectors to do better tree shaking based on calls on 'this'. Getters and setters will be next.
Review URL: https://chromiumcodereview.appspot.com//10180001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6847 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-23 15:36:51 +00:00
karlklose@google.com 6faf28ac22 Use the correct current element when computing the type of function elements.
R=ahe@google.com,kasperl@google.com

Review URL: https://chromiumcodereview.appspot.com//10170025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6841 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-23 13:36:14 +00:00
ngeoffray@google.com fc16e635d6 Start propagating non-primitive types in the backend, and fold instructions that know about the type of their receiver.
Review URL: https://chromiumcodereview.appspot.com//10119010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6728 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 08:23:42 +00:00
karlklose@google.com 038964d52c Check number of type arguments.
Review URL: https://chromiumcodereview.appspot.com//10105031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6675 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-18 10:27:32 +00:00
karlklose@google.com 2cccd55714 Remove SimpleType.
Review URL: https://chromiumcodereview.appspot.com//10105027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6644 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-17 16:05:09 +00:00
floitsch@google.com 07024492b5 Many type fixes.
Review URL: https://chromiumcodereview.appspot.com//10001008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6576 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-16 13:58:20 +00:00
floitsch@google.com 645ae182e0 Look up the correct constructor for default classes.
Review URL: https://chromiumcodereview.appspot.com//9980004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6402 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 11:41:13 +00:00
floitsch@google.com c9be80704e Move member-iterating code into ClassElement.
Review URL: https://chromiumcodereview.appspot.com//9873012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6007 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-29 22:45:03 +00:00
ahe@google.com dc099c4a00 Move frog/leg to lib/compiler/implementation.
Review URL: https://chromiumcodereview.appspot.com//9873021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5926 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-28 08:54:01 +00:00