fschneider@google.com
6fc87187a6
Fix implementation of the Iterable interface for typed data lists.
...
Return an Iterable with the correct type arguments (instead of <dynamic>)
when calling Iterable methods.
R=lrn@google.com
Review URL: https://codereview.chromium.org//763443005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42066 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-02 13:25:36 +00:00
iposva@google.com
1ee14fee2e
Fix dartbug.com/21671:
...
- Properly canonicalize enum values.
- Ensure canonical objects are deserialized properly.
R=asiva@google.com
Review URL: https://codereview.chromium.org//745023002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41874 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-20 23:31:10 +00:00
hausner@google.com
4bf624ebc0
Implement enum types in VM
...
Fully support enum types as per language spec version 1.6.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//735723003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41815 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-18 23:10:07 +00:00
regis@google.com
5c55e61647
Resubmit fix for Function::Clone() and Field::Clone() to adjust the class owner
...
of type parameters (issue 18630).
Make sure to clone the parameter type array as well.
Add regression tests.
R=iposva@google.com
Review URL: https://codereview.chromium.org//693693003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41474 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-03 23:16:33 +00:00
iposva@google.com
6266f1d4a0
- Do not attempt to set parameter types if they
...
were already finalized.
R=zra@google.com
Review URL: https://codereview.chromium.org//652743007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41182 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-17 21:50:28 +00:00
regis@google.com
0220e41d72
New bigint implementation in the vm.
...
R=srdjan@google.com
Review URL: https://codereview.chromium.org//509153003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40061 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 21:47:44 +00:00
asiva@google.com
2c7cb613ab
Use isolate parameter while creating handles during class finalizers.
...
R=regis@google.com
Review URL: https://codereview.chromium.org//506683003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39568 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 20:54:16 +00:00
hausner@google.com
0bbf6c5b16
Runtime support for evaluation of static field initializer expressions
...
Eliminates the generation of field initializer functions by the parser.
Adds a runtime call that creates a one-shot function to evaluate the
initializer of a static field. The runtime function gets called from
the implicit static getter function for the field.
R=srdjan@google.com , zra@google.com
Review URL: https://codereview.chromium.org//471283002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39387 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 21:53:44 +00:00
fschneider@google.com
54a7410866
Fix bug with CHA dependencies by recording a set of classes for registering code.
...
CHA is not only used with the receiver class, but also with other classes
when doing type propagation. The optimized code has to be registered with
all classes that are affected by CHA so that deoptimization occurs whenever
the set of subclasses changes for these classes.
R=vegorov@google.com
Review URL: https://codereview.chromium.org//463103002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39194 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 12:43:03 +00:00
fschneider@google.com
a908179df8
VM: Fix bug in CHA for signature classes.
...
The subclasses for the _FunctionImpl class were not tracked in the VM.
As a result, CHA would incorrectly assume that _FunctionImpl does not have
any subclasses.
This may cause incorrect optimization and caused unnecessary deoptimizations.
R=vegorov@google.com
Review URL: https://codereview.chromium.org//446373002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38981 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-07 12:46:18 +00:00
regis@google.com
7800e258ca
Finalize the redirection type of a redirecting factory when the class of the
...
factory is finalized.
R=asiva@google.com
Review URL: https://codereview.chromium.org//412543003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38468 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-22 18:17:24 +00:00
asiva@google.com
a323a9c9db
The dart version of typeddata library has changed to be compatible with the dart2js implementation
...
(typeddata does not implement ByteBuffer anymore).
Added new Dart API functions to account for this change.
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//392043003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38351 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-17 22:08:07 +00:00
iposva@google.com
0ab6d72ffb
Fix bug 20078:
...
- Do not use shared code or variables after a setjmp.
R=kustermann@google.com
Review URL: https://codereview.chromium.org//397273003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38327 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-17 13:12:34 +00:00
regis@google.com
aac127e4dd
Add missing call to finalize type parameters when finalizing upper bounds.
...
Fixes issue 19757.
Review URL: https://codereview.chromium.org//367113002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37953 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-02 18:06:42 +00:00
regis@google.com
32f3e11d99
Cleanup of error and warning reporting.
...
R=hausner@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//340203003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37468 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-18 22:30:34 +00:00
rmacnak@google.com
f4f4713eb8
Put metadata fields in their owner class to maintain the class-field bidirectional relationship asserted Field::PrintJSON.
...
Extended metadata scope test based on suspicions regarding the ordering of adding type parameters metadata fields versus ordinary fields of a class.
BUG=http://dartbug.com/18652
R=iposva@google.com , regis@google.com
Review URL: https://codereview.chromium.org//269253005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35926 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-08 18:15:33 +00:00
regis@google.com
91388a5f79
Simplify and fix instantiation of recursive types.
...
Add tests for non-contractive types.
Cleanup language tests status file.
Enhance tracing of type finalization.
R=hausner@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//224793002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34739 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-04 18:27:53 +00:00
regis@google.com
f60ab4dd11
Detect and reject illegal recursive types (non-contractive types).
...
Fixed instantiation and equality of recursive types.
Added many asserts to detect issues with recursive types.
Disabled bad tests. They declare illegal types and will be fixed in a later cl.
R=hausner@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//211963003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34460 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-26 23:38:18 +00:00
hausner@google.com
a7d344aa79
Fix checked tests
...
Follow-on change to implicit static getter elimination. Class finalizer
needed to be updated accordingly so type checks are made on non-final
fields as well.
TBR
Review URL: https://codereview.chromium.org//191063002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33435 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-07 16:59:17 +00:00
srdjan@google.com
3ffe7579ce
Minor VM performance improvements based on profiling.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//185553015
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33333 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-05 17:42:40 +00:00
regis@google.com
9b13508243
Avoid repeated resolution of types by marking them as resolved.
...
R=hausner@google.com
Review URL: https://codereview.chromium.org//165523002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32706 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-14 17:43:11 +00:00
regis@google.com
9380c54628
Make cycle checking of super interfaces linear instead of quadratic by marking
...
classes as checked (issue 16343).
R=asiva@google.com
Review URL: https://codereview.chromium.org//162163002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32636 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-13 00:14:36 +00:00
regis@google.com
2673ef210d
Do not resolve type arguments when only a resolved type class is needed to
...
calculate number of type arguments during type finalization (issue 16640).
Add regression test.
R=asiva@google.com
Review URL: https://codereview.chromium.org//160753004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32624 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-12 21:18:59 +00:00
regis@google.com
7830430adf
Implement eager instantiation and canonicalization of type arguments at run
...
time using a cache in uninstantiated type arguments.
Remove InstantiatedTypeArguments class.
Fix a bug in optimized code: do not update unused type test cache for Smi.
Fix a bug in optimized code on ARM and MIPS in type test cache lookup.
R=iposva@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//154393003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32447 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 19:54:33 +00:00
srdjan@google.com
8b7ebed54f
Mark optimized code that used CHA for optimization so that lazy class 'finalization' does not invalidate that code.
...
R=fschneider@google.com
Review URL: https://codereview.chromium.org//150923002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32335 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-05 20:31:57 +00:00
regis@google.com
8aac3612cf
Share the same type parameters of a mixin application class to propagate
...
identical type arguments to the super type and to the mixin type, thereby
allowing for further optimizations, such as instantiator vector reuse or
sharing of type arguments with the super class.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//149723002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32140 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-29 21:10:53 +00:00
regis@google.com
17196f6467
Make a type malbounded if one of its type arguments is malbounded, even if
...
independently of the declared bounds for the type (fix issue 16149).
R=srdjan@google.com
Review URL: https://codereview.chromium.org//140913005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31901 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-16 22:56:35 +00:00
regis@google.com
5fdae0d636
Leave uninitialized type arguments of a type being finalized as null instead of
...
temporarily setting them to dynamic for improved code robustness, since dealing
with a null type is less forgiving than dealing with dynamic.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//137983006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31843 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-15 18:56:10 +00:00
regis@google.com
b48d1455c2
Share mixin type with interface type in mixin application classes.
...
R=hausner@google.com
Review URL: https://codereview.chromium.org//138273005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31807 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-14 22:30:59 +00:00
regis@google.com
c2f0dec5ec
Support bounded mixins in the VM (fix issue 14453).
...
Add tests.
R=gbracha@google.com , hausner@google.com
Review URL: https://codereview.chromium.org//137543004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31794 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-14 18:41:27 +00:00
srdjan@google.com
b7d93c342a
Fix 15721: When checking for bad overrides we must eagerly finalize superclasses.
...
R=regis@google.com
Review URL: https://codereview.chromium.org//128263005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31628 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-08 21:45:05 +00:00
zra@google.com
fdeff1ba17
Replaces LongJump with LongJumpScope.
...
LongJump required explicitly restoring the old
long jump base before function return. This was
sometimes forgotten, leading to crashes. This
change puts the base restoration into the
destructor so that it happens automatically on
return.
R=iposva@google.com
Review URL: https://codereview.chromium.org//108383007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31463 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-04 01:23:43 +00:00
regis@google.com
3bdeaf9813
Add missing ResolveType call (fix issue 15738).
...
Remove unused parameter from ResolveType.
Review URL: https://codereview.chromium.org//113163008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31336 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-20 14:26:53 +00:00
regis@google.com
fb6d24945f
Introduce class TypeRef in the VM to fully support recursive types.
...
Fix issues 15244, 15148, 14869, 14000, and 13688 (was closed, but fragile).
Note that the current solution is not final as it may not be correct in more
complex cases not yet covered by language tests.
The final solution will require a 'trail' instead of a simple mark bit to
prevent operations involving recursive types to diverge.
R=asiva@google.com
Review URL: https://codereview.chromium.org//103913005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31087 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-11 22:51:19 +00:00
fschneider@google.com
cd54507fc2
Mark native functions when they are created.
...
Until now the parser marked native functions as native when parsing.
This may be too late for some functions. E.g. the native typed list
constructor may not be invoked because the intrinsic code is executed
instead (unless for example new-space allocation fails).
This causes missing type information when optimizing functions using
those recognized factory functions like Uint8List._new.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//99373002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30846 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-04 10:32:43 +00:00
srdjan@google.com
3274f92827
Rename FinalizeTypeHierarchy to ProcessPendingClasses.
...
R=regis@google.com
Review URL: https://codereview.chromium.org//83983004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30688 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-27 00:11:32 +00:00
srdjan@google.com
3485989ae7
Do not eagerly finalize classes in CHA, instead regard unfinalized classes as ’non-existent’ and only invalidate optimized code at finalization of the class.
...
Rename FinalizePendingClasses to FinalizePendingClassInterfaces as the class finalization occurs lazily.
TODO: add dependency information to deoptimize/remove only relevant optimized code.
R=regis@google.com
Review URL: https://codereview.chromium.org//81333003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30582 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-22 17:59:23 +00:00
regis@google.com
d1e945994e
Improve type test and type equality for generics (issue 15148).
...
R=srdjan@google.com
Review URL: https://codereview.chromium.org//81363002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30546 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-21 21:30:51 +00:00
regis@google.com
db2cec593d
Distinguish between malformed and malbounded types more efficiently using the
...
recently introduced LanguageError 'kind' field.
R=hausner@google.com
Review URL: https://codereview.chromium.org//75713002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30383 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-18 23:31:12 +00:00
regis@google.com
2a355a7bb6
Lazily format LanguageError messages (fix issue 15069).
...
R=iposva@google.com
Review URL: https://codereview.chromium.org//68113028
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30308 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-15 18:54:24 +00:00
regis@google.com
694401d38e
Rename mixin typedef to mixin application alias in VM.
...
R=hausner@google.com , rmacnak@google.com
Review URL: https://codereview.chromium.org//71693003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30277 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-14 17:42:39 +00:00
regis@google.com
e3da5e16e4
Check type bounds of redirecting factories (issue 14699).
...
Add tests for malbounded redirecting factories.
Clean up bound checking code and type error reporting code.
R=hausner@google.com
Review URL: https://codereview.chromium.org//66033006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30177 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-11 22:59:48 +00:00
hausner@google.com
2139b9d5f0
Undo change 29900
...
Undo a gratuitous change to the parser.
@kmillikin: please at least be courteous enough to ask one of the front-end
authors to review a change that is not a pressing issue, such as style preferences.
Review URL: https://codereview.chromium.org//61413002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29954 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-06 01:21:32 +00:00
kmillikin@google.com
a59e0881cf
Clean up Parser::ParseTryStatement in the VM.
...
Streamline the implementation, factor out repeated code, rename some cryptic
identifiers, and fix a misspelling.
Also, disentangle an implicit include dependency: class_finalizer.cc was
getting code_generator.h implicitly from something included (unnecessarily
as it turns out) by parser.h.
R=fschneider@google.com
Review URL: https://codereview.chromium.org//59683002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29900 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-05 12:49:14 +00:00
fschneider@google.com
91ca330ac8
VM: Fix initialization of statics in presence of exceptions.
...
In a static- or top-level variable v
var v = expr
static v = expr
If the initializer expression expr throws, the VM throws a
CyclicInitializationError when loading v afterwards, even though
this has nothing to do with cyclic initialization.
I'm changing the way implicit static getters and static initializers are
compiled. Static initializers are invoked from static getters.
They look as follows:
get:v {
if (field.value === transition_sentinel) {
field.value = null;
throw new CyclicInitializationError();
}
if (field.value === sentinel) {
field.value = transition_sentinel;
init:v();
}
return field.value;
}
init:v {
try {
field.value = expr;
} catch {
if (field.value === transition_sentinel) {
field.value = null;
}
rethrow;
}
}
BUG=http://dartbug.com/5802
TEST=language/lazy_static3_test,
language/throwing_lazy_variable_test,
co19/Language/12_Expressions/30_Identifier_Reference_A08_t02
R=hausner@google.com
Review URL: https://codereview.chromium.org//54713003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29797 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-04 10:08:47 +00:00
fschneider@google.com
ce9573722c
VM: Fix checked mode crash (issue 13831).
...
The AST for static getters differs between parsing the first time, and
subsequent parsings. This leads to a mismatch in deoptimization-ids
between the optimized and the unoptimized code.
This CL avoids creating different ASTs for the same static getters. To allow
better inlining of these getters, the initialization expression is wrapped in a
hidden static initializer-function. As a result the size of such getters is
constant and does not depend on the initializer expression.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//51123003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29680 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 16:49:55 +00:00
regis@google.com
3fa7a61efc
Implement latest spec changes regarding malformed types (see issue 14006):
...
- a malformed type used in a is, as, or catch type test results in a dynamic
type error being thrown.
- a malformed type is not mapped to dynamic anymore.
For now, this applies to type tests in checked mode as well, but discussion is
still on-going.
R=hausner@google.com
Review URL: https://codereview.chromium.org//53583003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29608 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 23:30:32 +00:00
regis@google.com
65379851a8
Implement stricter rule about self referencing typedefs (fix issue 13675).
...
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//49853004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29460 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-29 17:04:21 +00:00
regis@google.com
20badfb06e
Register synthesized mixin application classes in the library and reuse them
...
when possible (fix issue 14318).
R=asiva@google.com , hausner@google.com , rmacnak@google.com
Review URL: https://codereview.chromium.org//42723003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29276 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-25 19:46:32 +00:00
regis@google.com
177276f059
Report compile-time error for const factories redirecting to malformed type
...
(fix issue 14305).
R=iposva@google.com
Review URL: https://codereview.chromium.org//29013005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29123 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-23 21:03:11 +00:00