Commit Graph

499 Commits

Author SHA1 Message Date
regis@google.com 3969668ab8 Resolve interfaces before starting finalizing classes (issue 5586).
Review URL: https://codereview.chromium.org//11088079

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13563 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-11 17:28:33 +00:00
regis@google.com 1b8e614d7d Change compile-time errors into dynamic errors in instance creation expression
(issue 3085).
Change compile-time errors into dynamic errors in static getter and setter
calls (issues 3088, 3094).
Fix a crash in flow graph builder for missing static getter (issue 4360).
Add support in VM for NoSuchMethodError.
Remove support in VM for StaticResolutionException.
Add, remove, update related language tests.
Triage related co19 tests.
Review URL: https://codereview.chromium.org//11049038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13208 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-04 00:15:38 +00:00
regis@google.com ccacc62ec6 Change many instance creation errors from compile-time errors to dynamic errors
per revised spec (issue 3801).
Add negative tests for factory redirection.
Review URL: https://codereview.chromium.org//10979053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12975 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 17:52:35 +00:00
regis@google.com 656cdf40d4 Fix snapshot reading of canonicalized types.
Change some redirecting factory compile-time errors into dynamic errors after
discussion with Gilad (negative tests still missing).
Review URL: https://codereview.chromium.org//10996002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12872 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 19:26:53 +00:00
regis@google.com 61297238fb Support redirecting factory constructors in the VM (issue 3969).
Add test (negative tests still missing).
Some more work is needed regarding when to throw a dynamic error and when to
report a compile-time error. Some questions are not answered by the spec.
Review URL: https://codereview.chromium.org//10964058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12791 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 17:28:37 +00:00
lrn@google.com 292da5cc48 Make int an abstract class.
This looks deceptively simple (the only real change is in init, which
just copies the code for double, and the rest are just renaming for
consistency). It seems to work.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12304 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 07:17:27 +00:00
regis@google.com e860f819a0 Limit the maximum number of formal parameters (32K fixed and 32K optional)
in order to save space in function objects.
Naming cleanup.
Review URL: https://codereview.chromium.org//10928160

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12288 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 23:35:05 +00:00
hausner@google.com 5692051e4e Convert double interface into abstract class
In a future change, we can implement double in the core
library, eliminating class Double (using the patch class
feature).
Review URL: https://chromiumcodereview.appspot.com//10876100

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11631 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:29:49 +00:00
asiva@google.com 4c24f3f17a Ensure types are canonicalized when canonicalization is requested and the type is already finalized.
(Reduces initial heap size by about 15k)
Review URL: https://chromiumcodereview.appspot.com//10886038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11544 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 20:20:52 +00:00
hausner@google.com c7f5bcd0ca Eliminate interface bool
Replace with concrete class bool instead, and getting rid of class Bool in core_impl library.
Review URL: https://chromiumcodereview.appspot.com//10874071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11418 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 21:09:23 +00:00
hausner@google.com 0300d88b1b Gentle start with removing explicit interfaces
Review URL: https://chromiumcodereview.appspot.com//10832401

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11248 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 18:32:10 +00:00
regis@google.com 9efad2644b Re-enable checking of native resolvers.
Review URL: https://chromiumcodereview.appspot.com//10882007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11206 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 03:26:20 +00:00
regis@google.com 3e6596ba22 Temporarily disable checking of native resolvers to make Dartium build green.
A more permanent fix will follow.
Review URL: https://chromiumcodereview.appspot.com//10869024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11200 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 01:01:14 +00:00
regis@google.com fbd17a4d20 Fix Mac build.
Review URL: https://chromiumcodereview.appspot.com//10869022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11199 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 00:42:43 +00:00
regis@google.com 55c106f812 Make ClassFinalizer indifferent on whether we are generating a snapshot or not.
Add flag --error_on_malformed_type.
Remove obsolete flag --verify_implements.
Support snapshotting of LanguageError (for malformed types) and ApiError.
Review URL: https://chromiumcodereview.appspot.com//10871005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11198 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 00:27:49 +00:00
regis@google.com fea5f83714 Implement class hierarchy analysis in the VM.
Add test.
Review URL: https://chromiumcodereview.appspot.com//10828399

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11006 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-20 23:38:09 +00:00
hausner@google.com 9dc7ab8e1e Implement import scope
Implement the new scope rule for imports.

- Imported identifiers are in a scope that is shadowed
  by the importing library's top-level scope.
- Conflicting names imported from different libraries
  are not an error unless the name is referenced.
- Conflicting type names are only an error in checked mode.

In a follow-on change, I'll remove the "imported_into" pointers in libraries. They are no longer needed.


Issue 2945
Review URL: https://chromiumcodereview.appspot.com//10823396

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10923 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-17 21:06:16 +00:00
cshapiro@google.com 265e2306f5 Add a weak property type to the virtual machine.
Weak properties are key-value pairs.  The liveness of the key determines
the liveness of the value.  If the key is reachable the value is traced.
However, if the key is unreachable, the value is subject to finalization.

At present, the sole finalization action is clearing the key and value
fields.  However, it is possible to extend this to invoking callbacks or
other techniques, as well as processing values in topological order.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10867 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-17 01:17:39 +00:00
iposva@google.com 99d563982c - Support for patching of class methods and fields.
Review URL: https://chromiumcodereview.appspot.com//10827288

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10616 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 00:38:01 +00:00
hausner@google.com 9b47d131bf Support new getter syntax (no formal parameter list)
Support both new and old getter syntax in the VM compiler.
One co19 test becomes invalid, as it expects a compile error
due to missing getter formal parameters.
Review URL: https://chromiumcodereview.appspot.com//10837208

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10541 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 22:53:34 +00:00
asiva@google.com d4d781d636 - Unify class ids and snapshot object ids list so that we don't have disparate
and sometimes confusing values.
- Remove instance_kind_ field from RawClass.
- Rename all class id names to have a Cid suffix.
- Remove code from object.h and object_store.h which dealt with object ids
  of predefined classes for snapshots.
Review URL: https://chromiumcodereview.appspot.com//10827209

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10418 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 19:46:23 +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
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
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
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 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
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
iposva@google.com bee192cbe4 - Rename class index to class id.
- Remove unused method.
Review URL: https://chromiumcodereview.appspot.com//10441111

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8148 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-31 12:41:37 +00:00
regis@google.com 9c094b4330 Properly finalize type with malformed type argument.
Add test.
Review URL: https://chromiumcodereview.appspot.com//10411070

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7871 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-22 18:59:14 +00:00
regis@google.com b3c4682a81 Remove compile-time error for unresolved factory names (issue 3079).
Add test.
Review URL: https://chromiumcodereview.appspot.com//10332276

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7822 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 20:42:34 +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
regis@google.com f5076a5857 Reapply this reverted change:
Implement updated method overriding rules (issue 2943).
Review URL: https://chromiumcodereview.appspot.com//10387186

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7749 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 16:19:39 +00:00
regis@google.com 599ab6e3ca Revert r7729 until Dartium fixes its method override errors.
Review URL: https://chromiumcodereview.appspot.com//10399080

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7730 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 01:04:34 +00:00
regis@google.com 2b00b92ab9 Implement updated method overriding rules (issue 2943).
Add language test.
Review URL: https://chromiumcodereview.appspot.com//10388189

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7729 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 00:28:57 +00:00
regis@google.com 5d9dab620c Implement latest rules prohibiting some self referencing typedefs.
Update tests.
Review URL: https://chromiumcodereview.appspot.com//10377095

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7524 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 23:03:36 +00:00
regis@google.com a1fcd03ca6 Allow self referencing typedefs (issue 2490).
Fix Type::Name for malformed function types (issue 2340).
Added tests.
Removed bad negative test.
Review URL: https://chromiumcodereview.appspot.com//10388019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7422 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-08 16:27:43 +00:00
cshapiro@google.com 1472427af8 Revert "Revert "Implement {Int,Uint}{8,16,32,64} and Float{32,64} typed arrays.""
This reverts commit 63480a81fccbde001494dd535cd06a8fa02ed261.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7352 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 23:16:09 +00:00
cshapiro@google.com 3a14326da4 Revert "Implement {Int,Uint}{8,16,32,64} and Float{32,64} typed arrays."
This reverts commit 747dbeaa8f9c0dc1f49d6d6a369c6a3fe2d8b7c9.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7313 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 05:28:10 +00:00
cshapiro@google.com 537010ea16 Implement {Int,Uint}{8,16,32,64} and Float{32,64} typed arrays.
Internal and external representations of each array are provided.  A
single interface type implementing the ByteArray and List interfaces
is shared among the internal and external implementation type.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7311 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 05:12:19 +00:00
regis@google.com c2f823d92b Support cyclic types and F-bounded quantification (issue 439).
Added tests for F-bounded quantification.
Review URL: https://chromiumcodereview.appspot.com//10243001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7047 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-26 22:39:27 +00:00
regis@google.com efa92f5447 Mark types as instantiated or uninstantiated upon finalization.
Review URL: https://chromiumcodereview.appspot.com//10205006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6894 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-24 16:15:37 +00:00
regis@google.com ac6cb8cb66 Map malformed function result type and malformed function parameter type to
Dynamic in production mode (fix issue 5532534).
Fix bad negative test and make it positive.
Review URL: https://chromiumcodereview.appspot.com//10143004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6777 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 22:59:58 +00:00
regis@google.com f955de9bc0 Throw a type error in production mode when the type of the type test is not
declared (issue 2571).
Add test.
Delete bad negative test now covered by new test.
Update status files of different compilers.
Review URL: https://chromiumcodereview.appspot.com//10035058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6754 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 17:01:28 +00:00
hausner@google.com 475fbca314 Implement implicit interfaces
Amazingly, this small change is all it seems to take to implement
implicit interfaces.
Review URL: https://chromiumcodereview.appspot.com//10103009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6607 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-16 22:21:54 +00:00
regis@google.com 85e4a9c054 Do not require type class to be finalized when performing a type test.
However, make sure that the interfaces are resolved (issue 2523).
A later change will cleanup interface resolution code.
Review URL: https://chromiumcodereview.appspot.com//10050034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6446 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-12 00:18:43 +00:00
srdjan@google.com 1125846660 When checking against non-parametrized types use a cache to hold result tuples (class, result). That cache is stored in the instruction stream. Currently implemented for instanceof, ia32 only. Should migrate to other type tests and architectures.
70x improvement on a benchmark (similar to what is seen in html _unwrap).
Review URL: https://chromiumcodereview.appspot.com//10010029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6281 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-06 16:05:55 +00:00
regis@google.com 9ff0afa50e Do not require upper bounds to be resolved and finalized before comparing them
between the expected and actual factory class (issue 2431).
Add test.
Review URL: https://chromiumcodereview.appspot.com//10008017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6236 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-05 18:11:42 +00:00
regis@google.com 5282e44fb2 Use null type argument vector instead of vector of Dynamic for a generic raw
type when possible.
Fix type finalization of type parameters (always finalize in the context of the
class being parameterized and not in the enclosing class where the type
parameter is used).
Fix wrong generic optimization and added a test (a generic type instantiated
from a raw instantiator is not always raw).
Added printing of type argument vectors.
Review URL: https://chromiumcodereview.appspot.com//9939003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6068 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-30 22:16:52 +00:00
regis@google.com 33bd965e2a Generate a dynamic type error when creating an instance with a bound error.
Review URL: https://chromiumcodereview.appspot.com//9665013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5250 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-09 21:15:11 +00:00