Commit Graph

1278 Commits

Author SHA1 Message Date
regis@google.com 12de02cbab Associate the correct type to method receivers (instead of Dynamic type).
Properly name the first implicit parameter to factories as ':type_arguments'
(instead of 'this', which made it accessible to user code).
Various cleanup.
Review URL: https://chromiumcodereview.appspot.com//10831142

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10203 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 23:00:55 +00:00
hausner@google.com 73366bab9e Properly skip expressions that contain the operator as.
Fix 4277.
Review URL: https://chromiumcodereview.appspot.com//10830130

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10151 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 00:11:09 +00:00
hausner@google.com db4653f0e0 Add check for duplicate field initialization
This change adds a check that reports duplicate initialization
of instance fields. Fixes issues 921 and 1034.

There were several tests in the language suite that had duplicate
initializers for final instance fields. Corrected the tests.

dart2js also contained duplicate initializations of a couple
of final fields.
Review URL: https://chromiumcodereview.appspot.com//10825140

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10146 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-01 22:25:36 +00:00
hausner@google.com b3917271aa Optimize away most implicit const getter functions
If a static field has a very simple initializer expression
(a literal number or string for example) we initialize the field
directly while compiling instead of generating an implicit
getter. We only do this if the type of the expression is
assignment compatible with the field. If the expression is not
compatible, we let the implicit getter do the error checking.

This eliminates about 330 implicit getters in the core libraries
and saves 35k in the snapshot (830k, down from 865k).
Review URL: https://chromiumcodereview.appspot.com//10826090

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10098 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-31 23:33:48 +00:00
turnidge@google.com a3a73029f0 Consolidate a few fields in RawFunction using bitfields.
Remove kAbstract from the list of function kinds.  It now has its own
dedicated bit.  This allows us to distinguish abstract methods from
abstract getters and setters.
Review URL: https://chromiumcodereview.appspot.com//10796004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10087 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-31 21:26:28 +00:00
iposva@google.com e5a314d222 - Allow parsing of external methods.
Review URL: https://chromiumcodereview.appspot.com//10821076

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10028 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-30 22:46:24 +00:00
hausner@google.com d03049391b Fix issue 977
Constructors with redirection may not have a function body.
Review URL: https://chromiumcodereview.appspot.com//10820064

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9999 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-27 23:23:24 +00:00
hausner@google.com 741a12cfd6 Support const modifier in fields, variables
Issue 3551

This change adds const as a valid keyword to declare fields and
variables. The mandatory initializer has to be a compile time
const expression.

Static final variables still have to be initialized with
compile time constant expressions. I will add non-const static
finals (issue 3558) in another change.

Other small changes:
- allow null in some compile time constant expressions.
- allow only numbers, booleans, strings and null in compile time
  constant string interpolation.
Review URL: https://chromiumcodereview.appspot.com//10828053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9992 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-27 20:49:24 +00:00
regis@google.com 8fe3e69e37 Improve static type propagation.
Review URL: https://chromiumcodereview.appspot.com//10823022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9943 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-26 16:04:36 +00:00
hausner@google.com a2fec11205 Make sure the "Skip*" functions know about cascades as well.
Also, handle index operator in cascades correctly.
Review URL: https://chromiumcodereview.appspot.com//10809089

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9910 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-25 21:31:02 +00:00
asiva@google.com ed8db0f611 Move more symbols to the vm isolate.
Review URL: https://chromiumcodereview.appspot.com//10808111

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9905 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-25 20:31:26 +00:00
hausner@google.com fdd91990f1 Implement cascade operator in VM
- Factoring out parsing of selectors
- Create temp variable holding the receiver of the cascade
  selectors
Review URL: https://chromiumcodereview.appspot.com//10796109

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9857 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 17:20:49 +00:00
asiva@google.com ec7f44f025 Create frequently used symbols in the vm isolate
- Avoids the need for doing a NewSymbol on these everytime
- saves space as they get shared by isolates
Review URL: https://chromiumcodereview.appspot.com//10783035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9834 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 00:01:50 +00:00
asiva@google.com ef67b96777 Rename some of the enum definitions inside classes to avoid conflict with the ObjectKind enum.
Review URL: https://chromiumcodereview.appspot.com//10808064

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9792 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-20 22:24:49 +00:00
regis@google.com 24944b0ec1 Fix build break, i.e. fix type finalization for function literals not assigned
to a function.
Review URL: https://chromiumcodereview.appspot.com//10807055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9785 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-20 18:08:05 +00:00
regis@google.com 1eed55c529 Add missing type finalization for function literals not assigned to a function
variable.
Various cleanup.
Review URL: https://chromiumcodereview.appspot.com//10797031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9782 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-20 16:08:43 +00:00
srdjan@google.com d173b31373 Minor cleanups: use GrowableArray::is_empty instead of ::length() == 0
Review URL: https://chromiumcodereview.appspot.com//10790086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9780 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-20 16:06:40 +00:00
regis@google.com 318edd938c Hide names of internal classes from the user by mapping them to the documented
interfaces they implement.
Review URL: https://chromiumcodereview.appspot.com//10800002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9748 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-18 21:51:27 +00:00
cshapiro@google.com e964989681 Ensure objects emitted in code are allocated in old space.
BUG=3866

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9649 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-13 23:23:45 +00:00
regis@google.com a7b85ecff8 Provide better error message when passing wrong number of arguments.
Review URL: https://chromiumcodereview.appspot.com//10695137

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9602 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 17:46:55 +00:00
asiva@google.com 08c662b1c0 Represent tokens as a compressed stream instead of an array.
On x86:

Original sizes:
Size of isolate snapshot = 925655
New space (0k of 32768k) Old space (1700k of 1792k) Code space (0k of 0k)
out/ReleaseIA32/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 80944
CorelibIsolateStartup(RunTime): 5636
UseDartApi(RunTime): 404620
Dart2JSCompileAll(RunTime): 1379683
FrameLookup(RunTime): 45

Size with the new TokenStream implementation:
Size of isolate snapshot = 851352
New space (0k of 32768k) Old space (1368k of 1536k) Code space (0k of 0k)
out/ReleaseIA32/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 76918
CorelibIsolateStartup(RunTime): 4056
UseDartApi(RunTime): 502111
Dart2JSCompileAll(RunTime): 1251646
FrameLookup(RunTime): 45

(saves about 332k out of the original TokenStream size of 410k)

On x64:

Original sizes:
Size of isolate snapshot = 924865
New space (0k of 32768k) Old space (3234k of 3444k) Code space (0k of 0k)
out/ReleaseX64/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 109660
CorelibIsolateStartup(RunTime): 3985
UseDartApi(RunTime): 463009
Dart2JSCompileAll(RunTime): 2170309
FrameLookup(RunTime): 35

Size with the new TokenStream implementation:
Size of isolate snapshot = 849675
New space (0k of 32768k) Old space (2436k of 2560k) Code space (0k of 0k)
out/ReleaseX64/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 98716
CorelibIsolateStartup(RunTime): 2938
UseDartApi(RunTime): 509149
Dart2JSCompileAll(RunTime): 2042273
FrameLookup(RunTime): 39

(saves about 798k out of the original TokenStream size of 810k)

Token stats:
Number of tokens:   101470
  Literal tokens:   4550
    Ident tokens:   33020
Review URL: https://chromiumcodereview.appspot.com//10697055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9539 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 00:11:58 +00:00
regis@google.com e6e70d7bb2 Allocate types in proper heap space.
Allow type finalization without canonicalization.
Review URL: https://chromiumcodereview.appspot.com//10696155

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9529 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 21:54:13 +00:00
srdjan@google.com bfd52ec46a Rename Script's source to Source. Trace parser (--trace-parser) only if source is available (thus skipping all the 'noise' of bootstrap methods).
Review URL: https://chromiumcodereview.appspot.com//10752017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9494 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 00:14:25 +00:00
regis@google.com 32c8564b0a Add --trace_type_check_elimination flag for debugging purposes.
Review URL: https://chromiumcodereview.appspot.com//10689099

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9471 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 16:59:15 +00:00
regis@google.com 09d3ecf285 Compile an instance setter call when a static getter is declared, but no field
or static setter are declared (issue 3941).
Add test.
Review URL: https://chromiumcodereview.appspot.com//10689083

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9376 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 20:40:02 +00:00
regis@google.com d95cbc8d7f Use VM type cast and save handles.
Review URL: https://chromiumcodereview.appspot.com//10693071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9317 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-02 21:42:53 +00:00
regis@google.com 1036a3888f Consider upper bounds of type parameters in type checks.
Fix pointer visiting in TypeParameter.
Make TypeParameter::index() non-virtual.
Review URL: https://chromiumcodereview.appspot.com//10696013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9188 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-27 20:08:30 +00:00
regis@google.com 0532a90a2f Implement type cast in the VM.
Review URL: https://chromiumcodereview.appspot.com//10659005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9070 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-25 17:23:11 +00:00
hausner@google.com 0b403430bf Fix parent function of deeply nested closures
We got the parent of nested closures wrong if the nesting level
was > 2.

Fix for issue 3412.
Review URL: https://chromiumcodereview.appspot.com//10665009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9065 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-25 15:43:04 +00:00
asiva@google.com 5cbd276939 Make the parser agnostic to the TokenStream implementation. This is the first step towards compacting the token stream.
Pull the data stream writer/reader code out of snapshot into a generic file so that it can be reused into the token stream compaction implementation.
Review URL: https://chromiumcodereview.appspot.com//10632009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9043 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-22 20:37:01 +00:00
hausner@google.com 56bc7ca48a Fix stuff
Fix for issue 3781: don't hang on to deleted breakpoints (manually tested).
Fix for issue 3390: allow function names in all string interpolation expressions.
Review URL: https://chromiumcodereview.appspot.com//10603003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8956 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-21 00:16:27 +00:00
asiva@google.com 517cd6e6bb - Fix the type test failure for implicit native closures.
- Turn the test back on.
Review URL: https://chromiumcodereview.appspot.com//10572029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8885 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-20 02:15:08 +00:00
hausner@google.com 5fb638b575 Support captured variables in debugger
- Add context level ranges to LocalVarDescriptors
- Add callee-saved context chain register to LocalVarDescriptors
- Add context level and context offset of captured variables
  to LocalVarDescriptors
- Add context chain to ActivationFrame
- Add current context level to ActivationFrame
Review URL: https://chromiumcodereview.appspot.com//10579020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8863 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-19 18:52:34 +00:00
asiva@google.com 73bfbc5da4 Allow implicit 'close your eyes' of native methods. This will hopefully fix issue 3466.
- when resolving the native method which has been closurized account for the 'this' argument in the count of arguments.
- explicitly copy the 'this' parameter in the closure context as the first parameter before calling the native function. This is done by piggy backing on the CopyParameters code used for functions with optional parameters.
Review URL: https://chromiumcodereview.appspot.com//10535180

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8816 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-18 19:56:06 +00:00
hausner@google.com a7f542becb Remove obsolete String + code
Review URL: https://chromiumcodereview.appspot.com//10562038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8810 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-18 18:00:25 +00:00
hausner@google.com f0ccfe83e0 Turn off support for String + operator in the VM
Review URL: https://chromiumcodereview.appspot.com//10568002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8764 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-18 00:56:03 +00:00
regis@google.com 858b662c84 Fix super call invocation (issue 2028).
Review URL: https://chromiumcodereview.appspot.com//10513008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8633 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-13 23:06:23 +00:00
srdjan@google.com bd0bda32f0 Inline setters, getters, various cleanups & restructuring.
TODO: cid, token_index and try_index are often passsed around. We should pack them in a data structure.
Review URL: https://chromiumcodereview.appspot.com//10540040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8406 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-07 19:49:50 +00:00
regis@google.com 395d3ba587 Insert closure calls in conditional expression of assert (issue 1584).
Review URL: https://chromiumcodereview.appspot.com//10446102

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8164 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-31 15:57:06 +00:00
regis@google.com 31180a540e Check upper bounds of factory class type parameters when instantiating an
interface (issue 1380).
Review URL: https://chromiumcodereview.appspot.com//10441115

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8162 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-31 15:51:36 +00:00
hausner@google.com a07ebcc268 Clarify error message when illegally accessing 'this'
Fix bug 3185
Review URL: https://chromiumcodereview.appspot.com//10447102

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8134 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-30 23:41:33 +00:00
srdjan@google.com d8f4aa2fd0 Use temporary variable for StoreIndexed that returns a value.
Review URL: https://chromiumcodereview.appspot.com//10448059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8109 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-30 15:55:46 +00:00
regis@google.com 96ca3951e7 Address review comments missed in previous change.
Review URL: https://chromiumcodereview.appspot.com//10432010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7934 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-23 23:00:20 +00:00
regis@google.com b0593c8af4 Disallow repeated formal parameters (issue 2240).
Review URL: https://chromiumcodereview.appspot.com//10434005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7925 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-23 21:47:05 +00:00
regis@google.com 5fe23d1497 Disallow repeated type parameters (issues 2239 & 2240).
Add test.
Review URL: https://chromiumcodereview.appspot.com//10426002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7922 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-23 20:05:40 +00:00
turnidge@google.com 05b5d44b0e spawnUri. Take two. This time I'll wait for Anton before committing :-).
See original change 7756 for description.
Review URL: https://chromiumcodereview.appspot.com//10407042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7917 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-23 18:32:51 +00:00
fschneider@google.com 13c3beec30 Make saving and restoring of the context around closure calls explicit.
This is a first step to refactor the codegen-templates to be reused
between optimizing and non-optimizing backend.

The context is now explicitly saved in a temporary local variable and
not passed as an argument to the ClosureCall instruction anymore.
Review URL: https://chromiumcodereview.appspot.com//10409043

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7811 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 17:59:02 +00:00
regis@google.com 6fb0a9b281 Default parameter values are now allowed in interface methods and in abstract
methods, but not in function type aliases.
Made a negative test positive.
Disabled erroneous co19 tests (new co19 issue 123).
Review URL: https://chromiumcodereview.appspot.com//10392175

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7782 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 23:59:59 +00:00
srdjan@google.com d016f51e9c Start porting fast typechecks to x64.
Review URL: https://chromiumcodereview.appspot.com//10407018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7760 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 20:10:29 +00:00
turnidge@google.com 76d4586dea Revert my last change.
Review URL: https://chromiumcodereview.appspot.com//10332257

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7757 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 18:35:04 +00:00