Commit Graph

1278 Commits

Author SHA1 Message Date
srdjan@google.com d6abdfb6b8 Eliminate IncrOpStaticFieldNode, replace a set of nodes.
Review URL: https://chromiumcodereview.appspot.com//9592031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5063 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 00:40:48 +00:00
hausner@google.com 5f72e92b4e Re-introduce string concatenation
This change re-introduces concatenation of adjacent
string literals, i.e. the compiler concatenates "abc" "123"
into the literal "abc123" at compile time. If the literals
contain interpolations, the concatenation happens at
runtime.

The change also re-introduces interpolated compile-time
string literal constants, but the feature is disabled because
several tests need to be changed.
Review URL: https://chromiumcodereview.appspot.com//9582040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4991 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 23:47:34 +00:00
srdjan@google.com 1d7321e3f2 Fix Issue 1846: Improve error reporting in presence of imports. With this CL:
'/Users/srdjan/bdartall/dart/runtime/bug3.dart': Error: line 2 pos 1: unexpected token 'abstract'
abstract class A { }
^
'/Users/srdjan/bdartall/dart/runtime/bug2.dart': Error: line 2 pos 1: library handler failed
#import("bug3.dart");
^
'/Users/srdjan/bdartall/dart/runtime/bug1.dart': Error: line 2 pos 1: library handler failed
#import("bug2.dart");
^
Review URL: https://chromiumcodereview.appspot.com//9559001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4773 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-29 23:53:07 +00:00
asiva@google.com 33d2e2fe26 Changes to shrink the token stream representation from two words to one word.
On standalone dartium which has about 50000 tokens in the libraries (core, coreimpl, builtin, io etc.) this reduces the heap size by about 180kb. The size of the standalone snapshot buffer reduces by about 72kb.

Also moved the keyword symbol table to the object store so that it does not have to repopulated on every script compilation. Should benefit regular user script load times.
Review URL: https://chromiumcodereview.appspot.com//9462003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4734 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-29 02:46:29 +00:00
regis@google.com 47724a8491 Add support for malformed types and postpone some related errors from compile
time to execution time.

Still to do (once spec is clarified):
- properly handle generic type bounds errors
- properly handle 'instance of' type checks involving malformed types
- fix bad tests
Review URL: https://chromiumcodereview.appspot.com//9515011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4732 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-29 02:14:18 +00:00
hausner@google.com eff1a31d6f Fixing bugs: 1612, 1843, 1847
- Fix error location when referring to types in object allocation.
- Handle CR/LF correctly at beginning of source.
- Detect duplicate identifier in typedef declaration.
Review URL: https://chromiumcodereview.appspot.com//9466030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4584 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-25 00:47:06 +00:00
hausner@google.com 1ecc0a9e97 Fix handling of unresolved names
Fixes issue 1805 (http://code.google.com/p/dart/issues/detail?id=1805)

The VM didn't turn unresolved identifiers into instance getter calls in all cases. Refactored the code that handles primary expressions.
Review URL: https://chromiumcodereview.appspot.com//9453020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4550 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 19:55:57 +00:00
iposva@google.com f0c1954e9b Fix issue 732:
- Add handling for #resource library tags: Ignore at runtime, they are only used
  by the Dart Editor at the moment.
Review URL: https://chromiumcodereview.appspot.com//9431038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4493 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 21:40:07 +00:00
regis@google.com 25fcaf5044 Generic bound errors are static type errors not to be reported by the VM.
Review URL: https://chromiumcodereview.appspot.com//9428015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4476 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 17:48:05 +00:00
srdjan@google.com 87089f37f1 Fix cacthing exception object: a null exception is always caught.
Review URL: https://chromiumcodereview.appspot.com//9416067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4411 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-21 22:07:59 +00:00
srdjan@google.com acb395f713 Fix issue 979: operator arity must be verified.
Review URL: https://chromiumcodereview.appspot.com//9414005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4401 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-21 17:34:00 +00:00
asiva@google.com 3983c61041 Implement capability to use the same library prefix for multiple library imports (currently this is flagged as an error).
e.g:

#import("mylib101.dart", prefix:"mylib");
#import("mylib102.dart", prefix:"mylib");
#import("mylib103.dart", prefix:"mylib");
Review URL: https://chromiumcodereview.appspot.com//9363048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4289 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-15 20:53:28 +00:00
regis@google.com 83e063f330 Simplify type resolution in parser.
Review URL: https://chromiumcodereview.appspot.com//9395017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4240 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-15 00:44:16 +00:00
asiva@google.com d50bbba277 Implement support for specifying string interopolation style variable substitution in the import and source statements.
e.g:
sivamach[runtime]>more /workspace/asiva/expr/test1.dart
#library('test1.dart');
#import('${GOOGLE}$SRC/test2.dart');
#import('$DART/test3.dart');
test1() {
  print("test1");
}
main() {
  test1();
  test2();
  test3();
}
sivamach[runtime]>more /workspace/asiva/expr/src/test2.dart
#library('test2.dart');
#source('$GOOGLE$SRC/test2a.dart');
test2() {
  print("test2");
  test2a();
}
sivamach[runtime]>more /workspace/asiva/expr/src/test2a.dart
test2a() {
  print("test2a");
}
sivamach[runtime]>more /workspace/asiva/expr/src/test3.dart
#library('test3.dart');
#source('test3a.dart');
test3() {
  print("test3");
  test3a();
}
sivamach[runtime]>more /workspace/asiva/expr/src/test3a.dart
test3a() {
  print("test3a");
}

sivamach[runtime]>out/Debug_ia32/dart --import_map=GOOGLE,/workspace/asiva/expr --import_map=SRC,src --import_map=DART,/workspace/asiva/expr/src /workspace/asiva/expr/test1.dart
test1
test2
test2a
test3
test3a
Review URL: https://chromiumcodereview.appspot.com//9359009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4199 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-13 22:50:19 +00:00
iposva@google.com 242a784291 - Revert r4135: va_copy is not available everywhere.
Review URL: https://chromiumcodereview.appspot.com//9381009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4136 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-10 17:08:22 +00:00
iposva@google.com 431e8329bb Fix http://dartbug.com/1133:
- Incrementally concat error messages to avoid hitting
  a maximum error message size.
Review URL: https://chromiumcodereview.appspot.com//9334007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4135 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-10 16:59:41 +00:00
srdjan@google.com 1d7d76a43b Optimizing code generator expects that every AST node is traversed once, i.e., the nodes are not reused. Unfortunately this is not the case in assignment operations with arrays (e.g. a[i] += 3).
The proper solution would be to clone array and index nodes but that would require too many changes. Long term we can't / won't use AST nodes for optimization purposes.
Short term fix is here: load array and index and release their CodeGenInfo before value is traversed so that the value computation can set its own CodeGenInfo on the same node.
Review URL: https://chromiumcodereview.appspot.com//9373025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4121 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-10 08:30:53 +00:00
regis@google.com 851682f104 Represent declared type parameters of a class as an array of TypeParameter
rather than an array of String and simplify code accordingly.
Rename the field holding type parameter bounds of a class.

Note: I retract my earlier suggestion to Srdjan to represent interfaces of a
class (as well as its canonical types) as a TypeArguments. This would require
more code to check for an empty array and for growing the array. Besides, these
are really arrays and have nothing to do with type arguments. I removed the
corresponding TODO(srdjan).
Review URL: https://chromiumcodereview.appspot.com//9368032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4096 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-09 21:28:53 +00:00
hausner@google.com b43152a477 Fix issue 1246
continue; inside a switch statement jumps to outer loop.

http://code.google.com/p/dart/issues/detail?id=1246
Review URL: https://chromiumcodereview.appspot.com//9347032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4013 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-07 23:27:51 +00:00
regis@google.com 2edb4ae9c7 Add token index position to classes and types for more accurate error reporting.
Review URL: https://chromiumcodereview.appspot.com//9325047

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3965 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-06 19:52:02 +00:00
srdjan@google.com be66ab9a1c Fix for issue 1307: throw runtime exception instead of reporting a compile time error if a static call cannot be resolved.
Review URL: https://chromiumcodereview.appspot.com//9316100

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3922 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-03 22:25:16 +00:00
turnidge@google.com 0ddd4c04e9 Dart_PropagateError, take 2.
This change hopefully takes care of the non-mac build issues.  The
checked mode failures are fixed in a separate cl.
Review URL: https://chromiumcodereview.appspot.com//9316071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3863 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 19:05:06 +00:00
turnidge@google.com ae88492093 Revert Dart_PropagateError until I can track down the problems in
checked mode tests.

Sorry for the hubbub.
Review URL: https://chromiumcodereview.appspot.com//9314053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3823 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 23:39:28 +00:00
turnidge@google.com 26e24ede55 More fixes for non-mac builds.
- Don't use NULL in arithmetic in LongJump::IsSafeToJump
- Various functions need to return a faux value on unreachable branches.
Review URL: https://chromiumcodereview.appspot.com//9315041

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3819 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 22:49:36 +00:00
turnidge@google.com 9da62c5fea Add Dart_PropagateError.
This function can be used in native functions to properly pass all
errors up the stack.

Set the long jump base in the Compiler instead of outside of the
compiler.  A bunch of errors that used to be propagated through the
sticky_error are now propagated through return values.  This includes
all of the DartEntry and DartLibraryCall functions.

In particular, we no longer use the long jump to cross dart frames.
Instead errors are propagated across dart frames using the same
mechanism that we use for unhandled exceptions.  I've added assertions
to make sure that we only use the long jump when it is "safe".
Review URL: https://chromiumcodereview.appspot.com//9169102

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3815 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 22:34:16 +00:00
hausner@google.com 0c61be512e Allow assignment expressions in conditional expressions
Fix issue 1243 (http://code.google.com/p/dart/issues/detail?id=1243)
Also fix issue 1370 (name of internal temporary variables, order of expression evaluation.)
Review URL: https://chromiumcodereview.appspot.com//9310007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3768 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 00:49:47 +00:00
srdjan@google.com 9e77768c91 Fix for bug 1229: Unary operator plus is not allowed ... except for literals.
Add tests for incorrect literals, e.g. "+ 5".

Added a temporary token kTIGHTADD that represents an ADD not terminated by a whitespace. It is temporary and eliminated in the parser (code generator ot AST do not see it). It is used to recognize correct literals.
Review URL: https://chromiumcodereview.appspot.com//9264051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3745 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-31 20:05:24 +00:00
regis@google.com 5efeb28010 Fix build breakage.
Review URL: https://chromiumcodereview.appspot.com//9302025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3707 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-31 03:44:01 +00:00
regis@google.com 980cbf9c74 Store resolved library prefix in unresolved class object in order not to repeat
unnecessary library prefix resolution.
Remove redundant Type::NewParameterizedType() helper.
Simplify parsing of qualified identifiers.
Cleanup parsing of factory methods.
Fix resolution of imported types (add tests).
Review URL: https://chromiumcodereview.appspot.com//9233039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3703 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-31 00:07:07 +00:00
regis@google.com 76a765b72f Simplify parsing of 'new' operator.
Fix checking of default factory type parameters (add new tests).
Start cleanup of class resolution code in parser and finalizer.
Review URL: https://chromiumcodereview.appspot.com//9290065

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3632 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-26 23:50:29 +00:00
ngeoffray@google.com b12ed463bd Change error message (and not the internal method names) to report 'final field' instead of 'const field'.
Review URL: https://chromiumcodereview.appspot.com//9117025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3592 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-25 08:09:47 +00:00
regis@google.com 54bf52428d Allow the list of type parameters in the default factory clause to be omitted.
Review URL: https://chromiumcodereview.appspot.com//9169032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3587 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-25 01:30:14 +00:00
regis@google.com f9e785eb29 Remove support for obsolete syntax of factory methods and default classes.
Review URL: https://chromiumcodereview.appspot.com//9285031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3578 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-24 22:37:45 +00:00
ager@google.com 4efd1f98fa Split dart:builtin into dart:builtin and dart:io.
- dart:builtin is implicitly imported.
- dart:io has to be explicitly imported.

I will update the macos and windows stable test binaries when we
are happy with the solution.

R=iposva@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3537 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-24 07:36:59 +00:00
regis@google.com ed9d7a399f Optimize parsing of qualified identifiers.
Review URL: https://chromiumcodereview.appspot.com//9271023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3509 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-23 19:56:35 +00:00
asiva@google.com bf1b2bbeb9 Improve compile times for swarm application startup
- Avoid creation of getter/setter symbol when all we need to do is a lookup
- Add LookupGetterFunction/LookupSetterFunction to avoid having to create the getter name/setter name before doing a lookup
Review URL: https://chromiumcodereview.appspot.com//9265021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3453 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-20 00:55:39 +00:00
hausner@google.com ffa4950202 Fix compiler stats timer code
Account for recursive start/stop of timer. This has probably been broken since the beginning, but was only caught now after Siva added an assert in timer code.
Review URL: https://chromiumcodereview.appspot.com//9150040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3443 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-19 18:52:08 +00:00
regis@google.com 5b1da9fc27 Skip qualified identifiers that are part of ignored types.
Review URL: https://chromiumcodereview.appspot.com//9150036

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3441 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-19 18:31:55 +00:00
asiva@google.com dad0f5c843 Improve compilation times for swarm application startup.
- Avoid multiple calls to LookupFunction and LookupField once for static and once for dynamic.
Review URL: https://chromiumcodereview.appspot.com//9252033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3423 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-19 01:50:32 +00:00
hausner@google.com aaf01d801a Fix named parameter function calls
Issue 1199
Review URL: https://chromiumcodereview.appspot.com//9252027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3422 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-19 00:51:39 +00:00
hausner@google.com 3ebdf081ca Set breakpoint at url, line number
Add debugger functionality to set breakpoint at given url and line number.
Review URL: https://chromiumcodereview.appspot.com//9240014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3420 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 23:15:56 +00:00
asiva@google.com 806f6ddc62 Improve function compilation times for swarm application startup.
- Add a String::Equals(const String& str) method.
- Pass in isolate parameter if present for some handle creation functions.
Review URL: https://chromiumcodereview.appspot.com//9232017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3413 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 20:10:18 +00:00
regis@google.com 366695d347 Ignore parsed types of local variables in unchecked mode and replace them with
the Dynamic type.
Review URL: https://chromiumcodereview.appspot.com//9232016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3404 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 18:08:04 +00:00
hausner@google.com 600c0e4570 Report error on duplicate supertypes
Report error if the same type appears more than once in the implements
or extends list.
Review URL: https://chromiumcodereview.appspot.com//9252001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3403 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 17:58:05 +00:00
turnidge@google.com 53ba5c402e Make the "sticky error" an Error instead of a String.
I do this in preparation for using the sticky error to implement
isolate unwinding.
Review URL: https://chromiumcodereview.appspot.com//9186058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3367 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-17 19:54:02 +00:00
hausner@google.com 6d0e70e334 More parser stuff to handle pseudo keywords as identifiers
More pathological cases.
Review URL: http://codereview.chromium.org//9212018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3318 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-14 00:44:10 +00:00
hausner@google.com 197348daa2 Fix frog build
Doesn't handle pseudo kw right.
Review URL: http://codereview.chromium.org//9174011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3305 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-13 19:41:33 +00:00
hausner@google.com 343dff6255 Proper handling of built-in identifiers
Allow pseudo-keywords (built-in identifiers) as regular identifiers for anything but class names, interface names, typedef names.

Still todo: Update blacklist of class/interface names, disallow pseudo-keywords as type parameter names.
Review URL: http://codereview.chromium.org//9107070

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3303 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-13 19:24:50 +00:00
iposva@google.com 731616c7d3 - Remove support for ">>>" operator.
Review URL: http://codereview.chromium.org//9203004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3279 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-13 09:10:48 +00:00
regis@google.com 5a11b9b3ad A class/interface cannot implement/extend a type parameter (issues 886 and 887).
Added tests.
Review URL: http://codereview.chromium.org//9153006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3122 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-10 00:01:47 +00:00