Commit Graph

564 Commits

Author SHA1 Message Date
johnniwinther@google.com 1274e083f5 Error produced for missing var, final, const or type on field declarations.
BUG=2997
TEST=tests/language/field_decl_missing_var_type_test

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9585 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 09:22:53 +00:00
johnniwinther@google.com fdbabb995e Dartdoc and Apidoc updated to use dart2js through the mirror system.
BUG=3414

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9584 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 08:52:19 +00:00
smok@google.com b79fd16adb dart2dart introduce "emitter" that that generates source code.
Review URL: https://chromiumcodereview.appspot.com//10694151

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9581 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 07:46:26 +00:00
smok@google.com 8b8c0d1b5b Fix getters/setters unparsing, they appeared as ordinary methods without get/set keywords.
Review URL: https://chromiumcodereview.appspot.com//10698154

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9551 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 16:10:28 +00:00
smok@google.com 3fa18d1a27 Fix unparsing of variable definitions.
Example affecting method with method args:
foo(f(arg)){}

would unparse to:
foo(var f(arg)){}

Also correctly unparse variable definition modifiers.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9550 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 14:00:34 +00:00
floitsch@google.com 14b781bcd1 Refactor SsaBranchBuilder.
Review URL: https://chromiumcodereview.appspot.com//10693143

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9549 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 12:34:53 +00:00
ager@google.com 0ef33295a7 Bring back most of the performance lost when fixing union on types.
We lost the basic propagation of known field types from constructors.

R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9548 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 12:32:57 +00:00
floitsch@google.com c8cd641308 Fix usage of UNKNOWN/CONFLICTING types for union.
Fixes issue 4033.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9547 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 10:34:58 +00:00
lrn@google.com 42f353fad1 Patch methods in classes.
Add math library in corelib/unified. Location subject to change.
Made _Random's implementation external and patched it to use JS random.
Made "external" marking acually work.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9544 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 08:47:24 +00:00
smok@google.com b929ce15cc dart2dart fix synthesized constructor appearing in unparser. Don't output it.
For example, if we have:
class A {
}
main() {
  new A();
}

that would result in:
class A{class}...

that "class" is the unparse result of synthesized constructor.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9541 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 04:31:36 +00:00
smok@google.com a7bc3e38de Fix broken unparser test in checked mode.
Review URL: https://chromiumcodereview.appspot.com//10701117

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9509 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 13:56:33 +00:00
ager@google.com ef3aeff677 Make sure to use the type-restricted selector when registering
what can be called in loops.

I don't expect a big impact, but it could reduce code size by
avoiding type-guard insertions for methods that cannot be hit
by a given call.

R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9507 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 13:28:08 +00:00
smok@google.com 0842017adc dart2dart support for instantiatin simple top-level class:
class A {
}

main() {
  new A();
}

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9506 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 12:41:29 +00:00
smok@google.com ae080111b6 support unparsing of "new Object()":
main() {
  new Object();
}

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9496 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 03:13:34 +00:00
sra@google.com d3a67e8016 Revert "Revert "Allow === and == to generate inputs at the use site when compiling to a single comparison.""
Fixed bug where subexpressions were visited twice.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9492 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 23:51:26 +00:00
sra@google.com 0777cd8cb7 Revert "Allow === and == to generate inputs at the use site when compiling to a single comparison."
Review URL: https://chromiumcodereview.appspot.com//10757009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9486 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 21:19:01 +00:00
sra@google.com 30b48d9fac Allow === and == to generate inputs at the use site when compiling to a single comparison.
We only need temps in the general case
x === y -->  (x == null ? y == null : x === y)

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9481 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 20:18:02 +00:00
vsm@google.com 49c78a2d9c Revert "Make sure we do not try to run main() before the document has been fully loaded."
This reverts commit r9434.

It appears the r9434 is breaking samples in the editor: https://groups.google.com/a/dartlang.org/forum/?fromgroups#!topic/misc/Fvr73o2E_5o

Devon has verified that undoing this fixes the problem.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9474 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 18:13:25 +00:00
floitsch@google.com 596f69cae0 Use better names for closures and static variables.
This increases the code size, but goes away with a minifier.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9468 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 14:40:13 +00:00
ager@google.com 1aae5dca28 Insert type guards for loads from arrays in nested loops.
To limit code size implications, only do it in methods that already
have type guards.

R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9466 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 12:49:10 +00:00
smok@google.com 2f89b3723f dart2dart: fix top level field declarations.
Unparse:
final String x = "asd";
main() {
  x;
}

used to unparse to:
x="asd"main(){x;}

Now:
final String x="asd";main(){x;}

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9465 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 12:36:52 +00:00
floitsch@google.com 84fcfdce84 Don't box variables for closures that are assigned only once.
Fixes issue 4001.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9461 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 09:10:16 +00:00
lrn@google.com 87bce39efe Fix type errors.
Will now run my tests with --host-checked too.

TBR=floitsch

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9458 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 06:59:53 +00:00
lrn@google.com aa8f2cf676 Recognize "patch" identifier in .dartp files.
Added more infrastructure to detect errors in the patch.
Still no ability to add an element from the patch to the original library.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9457 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 06:39:57 +00:00
lrn@google.com 9010ea745c Add "external" prefix to methods and constructors.
This is expected to be added to the language specification, for allowing the specification of methods with externally bound implementations.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9456 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 06:37:51 +00:00
floitsch@google.com d356ee6c96 Fix very subtle bug in HNode.changeUse.
Review URL: https://chromiumcodereview.appspot.com//10696120

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9441 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 15:22:00 +00:00
smok@google.com 7b3401dd48 Fix const unparse. Example:
foo([var a = const[]]) {}
used to unparse to:
foo([var a = []]) {}

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9439 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 12:57:27 +00:00
smok@google.com 4c9d8416cf Some enhancements of PrettyPrinter for NodeList, LiteralList.
Review URL: https://chromiumcodereview.appspot.com//10701090

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9437 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 11:51:44 +00:00
kasperl@google.com f0d2788ce3 Make sure we do not try to run main() before the document has been fully loaded.
The problem was that document.readyState is either loading, interactive,
or complete, so before this change we would sometimes run main() when the
document has been parsed but not fully loaded.

R=efortuna@google.com,vsm@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9434 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 10:51:38 +00:00
sgjesse@google.com c89a6deab4 Fix spelling mistake
TBR=floitsch@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9433 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 10:20:42 +00:00
ager@google.com 3e239fb5c2 Use computed field types to recompile methods containing binary
arithmetic on contants and (suspected) number fields.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9429 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 08:50:36 +00:00
sgjesse@google.com cd961fe372 Generalize the use of type information for setters and initializers
Instead of checking explicitly for integers just union the types
involved. This also led to some refactoring getting rid of an almost
duplicate method.

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

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9426 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 07:50:24 +00:00
sgjesse@google.com 2384d9a9a1 Fix checked mode errors
TBR=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9423 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 04:37:40 +00:00
sgjesse@google.com ffe443811f Collect the actual types for all field setters.
Before only boolean indicating whether the type was HType.INTEGER or
not was collected. Now collect the union of all types seen for setters
for each field.

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

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9422 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 04:10:17 +00:00
kasperl@google.com 231805855e Guard the use of write in the implementation of print.
R=efortuna@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9417 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-05 11:49:19 +00:00
ager@google.com 654dd80103 Track users through phi nodes to eliminate '>>> 0' for more bitops
whose results are only used in other bitops.

R=kasperl@google.com,sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9413 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-05 08:43:07 +00:00
kasperl@google.com e00edf0a6d Add the JS helper function to all libraries where we allow the native syntax.
Try to use the JS helper from somewhere in the HTML library.

R=vsm@google.com
BUG=http://dartbug.com/3842
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9409 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 14:08:30 +00:00
johnniwinther@google.com 45d8cdb032 Mirrors prototype added to dartdoc.
The mirrors system is local to dartdoc and will merged with the VM version at a later point.

TEST=compiler/dart2js/mirrors_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9406 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 13:23:28 +00:00
ager@google.com f29bd5d854 Fix more type intersection stuff.
R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9403 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 12:20:59 +00:00
lrn@google.com d1da93a393 Reapply "Make patch file import declarations apply to the patched library too."
This reapplies r9346 with the following fix:
Adds #library tag to tests containing #import.
The test web-driver tries to source the file if it doesn't contain
a #library declaration, which isn't valid if it contains #import.

R=floitsch

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9401 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 12:02:28 +00:00
podivilov@google.com 4fbf112cc9 Associate partial source map with each code block in Universe.generatedCode.
That way we can create partial source maps for individual functions in codegen,
and join them into a single map at the end.

Currently partial source maps contain only begin and end positions of all functions.

R=ahe@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9400 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 11:53:25 +00:00
ager@google.com 72b997b522 Reapply change to update dart2js operator equals semantics to follow the latest spec.
Changes since the version that was reverted are in patch set 2:

1. Fix one remaining dart2js test that relied on the old operator== behavior.

2. Fix type intersection operation to actually take null into account. Because of bounded types they should always use canBeNull.

R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9396 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 11:29:47 +00:00
podivilov@google.com 43f93e9a6a Revert "Associate partial source map with each code block in Universe.generatedCode."
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9394 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 10:47:02 +00:00
smok@google.com 90424cecb1 Fix unparsing of prefix increments.
http://code.google.com/p/dart/issues/detail?id=3909

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9393 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 10:31:33 +00:00
podivilov@google.com 569dc5bff7 Associate partial source map with each code block in Universe.generatedCode.
That way we can create partial source maps for individual functions in codegen,
and join them into a single map at the end.

Currently partial source maps contain only begin and end positions of all functions.

R=ahe@google.com

Committed: https://code.google.com/p/dart/source/detail?r=9347

Committed: https://code.google.com/p/dart/source/detail?r=9351

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9390 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 10:12:50 +00:00
sgjesse@google.com 27e588647d Ignore setters in constructors when evaluating determining firect field access
Setters in constructors cannot mutate an object after construction.

Doesen't do much for preformance but simplifies some of the generated
code and shakes out a few getters.

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

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9386 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 08:07:34 +00:00
antonm@google.com feea13eceb Start emitting top-level functions.
R=smok@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9359 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 16:21:54 +00:00
ager@google.com 8bca3e8dcb Revert all the changes to equals operator. Causing buildbot trouble.
R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9357 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 15:39:14 +00:00
lrn@google.com b5ce02776b Revert "Make patch file import declarations apply to the patched library too."
This reverts commit r9346.

TBR=floitsch

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9354 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 14:25:50 +00:00
podivilov@google.com f14b21a4a3 Revert "Associate partial source map with each code block in Universe.generatedCode."
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9353 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 14:19:54 +00:00