Commit Graph

70 Commits

Author SHA1 Message Date
Regis Crelier ba69c8a898 Enumerate URIs of all types in type errors in order to help the user diagnose
the error (it was previously only printed for types with identical names).
Cleanup and simplify construction of type errors.

R=hausner@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org/1778133002 .
2016-03-09 15:16:47 -08:00
Ivan Posva 8d18298fed - Remove Isolate::Flags structure and store flags directly in isolate.
- Make enable_asserts, enable_type_checks, error_on_bad_override and
  error_on_bad_type release mode flags only.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1737693003 .
2016-02-25 18:06:56 -08:00
John McCutchan fda3a9bc2b Remove more things
(stripped) dart_product before: 5307888
(stripped) dart_product after: 5275088

Reduction in size: 32800 bytes.

Removed entirely:

- debuginfo*
- elfgen*
- gdbjit*
- TraceBuffer
- vtune support

Removed in product:

- Compiler stats
- Code observers

R=asiva@google.com

Review URL: https://codereview.chromium.org/1711163002 .
2016-02-22 08:53:11 -08:00
Srdjan Mitrovic 72528aba85 Fix background compilation crashes due to allocation of types in new space. Remove default arguments of InstantiateFrom and others where space argument is being passed, in order to preemptively fix crashes and prevent future problems (always be explicit where the type is allocated, make sure the 'space' argument is propagated).
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org/1691163002 .
2016-02-12 09:05:08 -08:00
Regis Crelier bb649318e4 Remove support for Javascript warnings in the VM.
This cl is a clone of cl https://codereview.chromium.org/1683363002/ deleted by
accident. Already LGTM'ed.

Review URL: https://codereview.chromium.org/1690903003 .
2016-02-11 09:16:06 -08:00
John McCutchan d77d376124 Replace intptr_t with TokenDescriptor
- Use TokenDescriptor instead of intptr_t for all token positions.
- Use TokenDescriptor in raw_object instead of int32_t.
- TokenDescriptor is a POD with an int32_t (this shrinks the size of AST and IR nodes by 32-bits on 64-bit architectures).

There are some cleanups I plan on doing as a follow up CL:

- Replace TokenDescriptor::value() with TokenDescriptor::TokenPos()

R=iposva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1644793002 .
2016-02-02 10:15:44 -08:00
Regis Crelier 7f57ebcfa1 Remove signature classes from the VM.
They were used as the class of closure instances and as the type class of
function types.
All closure instances now have class _Closure and function types are represented
by a new class FunctionType extending AbstractType.
Fix issue 24567 and add regression test.

R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1584223006 .
2016-01-19 16:32:59 -08:00
Regis Crelier 48bc8bbf33 Remove instantiator argument in generated code for type tests.
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1533383003 .
2015-12-21 13:07:32 -08:00
Srdjan Mitrovic d503d2f0ed Added full deferred loading semantic to precompiled/--noopt/eager-loading code (some corner cases, e.g., compile-time errors for constants, still missing)
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1211273011 .
2015-07-09 10:56:55 -07:00
Srdjan Mitrovic 5711c13f69 Make frequent type checks (instanceof) faster by adding dedicated instanceof methods; improves dart2js startup
There is a possibility of adding intrinsics for all new instanceOf methods; my measurements did not show any benefits, therefore they were removed from this CL.

BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1222863003 .
2015-07-07 10:20:41 -07:00
Ivan Posva f5e3f94019 Fix http://dartbug.com/23578:
- Complete revamp of isolate-specific flags.
- Associate flags with the isolate on creation.
- Dart_CreateIsolate and associate callback do take an
  extra flags argument.
- Make sure to clear IC data array when clearing code.

BUG=23578

Review URL: https://codereview.chromium.org//1162033005
2015-06-07 17:57:34 +02:00
srdjan@google.com 3ac643115f Remove unneeded flag declaratiosn (enable_type_checks, enable_asserts).
R=hausner@google.com

Review URL: https://codereview.chromium.org//1133793002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45647 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 16:48:43 +00:00
srdjan@google.com 6a524865a1 Remove public int.is64Bit.
R=asiva@google.com

Review URL: https://codereview.chromium.org//1105453003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45407 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-24 18:53:05 +00:00
koda@google.com 92a8c39d3c Keep zone cached in SnapshotReader to allow removing ZoneHandle(Isolate*) interface.
Add a StackZone around API snapshot reading call.
Also remove CheckedHandle(Isolate*) interface by migrating its users to Zone*.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1012333002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44580 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-19 17:42:40 +00:00
iposva@google.com ebabd58de8 - Add a _fatal helper function into dart:core, so that we can
abort if we get into an unrecoverable state in the core library.

R=hausner@google.com

Review URL: https://codereview.chromium.org//953973003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44010 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-24 23:27:56 +00:00
zra@google.com 1299ad1485 Allows turning on checked mode on a per-isolate basis
using the embedding API.

R=regis@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//883263004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43481 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 18:32:48 +00:00
rmacnak@google.com dd3c1fa32e Remove several entries from invocation fuzzer blacklist.
Add event loop, isolate startup, and symbol helper functions to the invisible list.

Include doubles as a target.

BUG=http://dartbug.com/15274
BUG=http://dartbug.com/20583
BUG=http://dartbug.com/21707
R=regis@google.com

Review URL: https://codereview.chromium.org//775223002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42092 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-03 22:08:32 +00:00
koda@google.com c22d3cf74a Avoid UTF-8 decoding in num.toString.
4-7% speedup on SplayHarder.

Introduce _Num class to make Dart and VM hierarchies match and enable sharing code between integers and doubles.

R=iposva@google.com

Review URL: https://codereview.chromium.org//473673004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39383 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 21:15:39 +00:00
hausner@google.com 4258c115b4 Handle load errors in deferred code
IO errors on the URL of a deferred library are forwarded to the Future
that handles the deferred load. Syntax errors and finalization errors
are lethal, killing the isolate.

Review URL: https://codereview.chromium.org//419103003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38800 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-31 21:09:33 +00:00
srdjan@google.com d44423b766 Add VM internal Dart class 'ClassID' used to manage class-ids of known classes. Next CL: add constant fields corresponding to each class id (smiCid, oneByteStringCid, etc).
R=asiva@google.com

Review URL: https://codereview.chromium.org//345223003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37567 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-20 20:56:55 +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
hausner@google.com 4eac05607f Lazy loading of deferred libraries
Defer reading of source code of deferred libraries until the
Dart code executes the loadLibrary() call.

R=iposva@google.com

Review URL: https://codereview.chromium.org//328923002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37334 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-13 22:43:31 +00:00
srdjan@google.com ee8543f057 Intrinsify [] for ExternalUint8 and Uint8 typed data. Gives significant speedup when compiling Hello.dart in unoptimized code.
R=zra@google.com

Review URL: https://codereview.chromium.org//308513005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36833 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-30 19:49:35 +00:00
regis@google.com dec11d8b7b Add support for javascript incompatibility warnings (work in progress).
For now, warnings are only issued when applicable for type tests, type casts,
and toString.
Fix newly reported lint errors.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//260713008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36001 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-09 22:42:10 +00:00
hausner@google.com ed24226376 Support deferred library prefix syntax
First step towards deferred library support:
- Parse the “deferred as” import clause.
- Implement p.loadLibrary() which returns a future that
  completes when the library is loaded.
- Treat type annotations of deferred types as malformed.
- Throw NoSuchMethodError when calling functions from
  unloaded libraries.
- Libraries are still read synchronously, but items in the
  library won’t be visible through the deferred prefix until
  the future returned by loadLibrary() completes.

Review URL: https://codereview.chromium.org//208323015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34481 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-27 21:20:47 +00:00
iposva@google.com f2a6f1b4b6 Another round of cleanups for http://www.dartbug.com/15922
- Address warnings about 64-bit to 32-bit conversions.

R=ajohnsen@google.com, asiva@google.com

Review URL: https://codereview.chromium.org//169893003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32831 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-19 23:35:55 +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 9c16a399ca Cleanups.
R=regis@google.com

Review URL: https://codereview.chromium.org//146843008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32000 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-24 22:00:04 +00:00
iposva@google.com e100129f8e - Use canonicalized type of non-parameterized classes when
available.
- Do not attempt to make types for objects of Context.

R=fschneider@google.com, regis@google.com

Review URL: https://codereview.chromium.org//102053010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31194 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-17 16:59:14 +00:00
fschneider@google.com 9031c80c88 Change == into an instance call to allow polymorphic inlining of ==.
In unoptimized code equality is now just another instance call.

The optimizer replaces it with a specialized implementation based on static
 type information and type feedback.

Many of the manual optimizations of == in the optimizer are now just handled
 by the generic inliner, plus polymorphic inlining of == calls is now possible.
This also eliminates the need for a lot of duplicated code in the backend.

I adapted the inlining heuristics to compensate for the slightly larger
inital flow graph size.

Review URL: https://codereview.chromium.org//27307005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29800 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-04 11:32:52 +00:00
regis@google.com 9ec07853c5 Report correct error message in case of super invocation (fix issue 8208).
R=hausner@google.com

Review URL: https://codereview.chromium.org//30533004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29042 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-22 22:12:07 +00:00
regis@google.com 5a5edb7f0c Report use of malbounded interface in type test.
Fix language tests related to malbounded types (issues 14123, 14131, 14132).

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//33313003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28943 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-21 19:49:19 +00:00
srdjan@google.com 1676113897 Fix runtimeType for strings, integers and double: return their interface type.
R=asiva@google.com

Review URL: https://codereview.chromium.org//25674017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28286 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-04 22:08:55 +00:00
iposva@google.com f1583dec18 - More use of pre-allocated read-only handles.
R=zra@google.com

Review URL: https://codereview.chromium.org//23510006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27490 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-13 16:55:57 +00:00
kmillikin@google.com 4f80ef09df Change Bool::Get to return a handle instead of a pointer to a raw object.
Replace occurrences of 'expr ? Bool::True() : Bool::False()' with simply
'Bool::Get(expr)' and analogously for its negation.  The pointer to the raw
object can still be extracted with 'Bool::Get(expr).raw()'.

R=iposva@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//23480005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26770 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 08:38:56 +00:00
regis@google.com 3b7cdf80a0 Update VM to handle malformed types according to revised spec (issues 9055,
12105, 7247).
Update language tests.
Update status files.
Allow map literals to specify a key type that is not a String.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//21049012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25666 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-31 15:20:28 +00:00
srdjan@google.com cbb9d76c4b Fix wrong type test optimization when testing against a signature class: we must always consider the instance type arguments as well. FIxes failing tests when run with --optimization-counter-threshold=5.
R=regis@google.com

Review URL: https://codereview.chromium.org//18807007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24961 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 17:31:19 +00:00
iposva@google.com 56b0fc10a7 Reland r24563 and r24564 with fixes cumbersome API leading to leaks.
- Add a WeakTable to the VM. This is used to remember the
  native peers registered through the Dart C API as well
  as assigning identity hashcodes to objects when needed.
- Use the hashcode to lookup entries in the Expando.

Review URL: https://codereview.chromium.org//18826007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24822 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-08 21:41:05 +00:00
iposva@google.com fb06bcdff3 - Revert r24564 and r24563 due to unexplained malloc corruption.
Review URL: https://codereview.chromium.org//18051007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24565 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-28 00:27:25 +00:00
iposva@google.com 9c9989d2f6 - Add a WeakTable to the VM. This is used to remember the
native peers registered through the Dart C API as well
  as assigning identity hashcodes to objects when needed.
- Use the hashcode to lookup entries in the Expando.

R=asiva@google.com

Review URL: https://codereview.chromium.org//17992002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24563 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-28 00:01:47 +00:00
iposva@google.com e24d83c10d - Add a GetClassId() to Object, so that we do not have to
create a temporary class handle only to get at an object's
  class id, which is stored in the object header.

R=asiva@google.com

Review URL: https://codereview.chromium.org//15338008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22904 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-20 21:01:31 +00:00
srdjan@google.com 7797d39362 Added Object._cid getter, optimized it. Added to (some) classes a static final _clCid. Use those to test for exact type in VM's libraries.
R=iposva@google.com

Review URL: https://codereview.chromium.org//14703005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22695 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-14 18:16:44 +00:00
srdjan@google.com 706e79d074 Fix error reporting when calling static methods and closures withh mismatched arguments.
Closures BEFORE:
----
Unhandled exception:
Class '(dynamic, dynamic, dynamic) => dynamic' has no instance method 'call'.

NoSuchMethodError : method not found: 'call'
Receiver: Closure: (dynamic, dynamic, dynamic, dynamic) => dynamic from Function 'foo':.
Arguments: [2]

Closures NOW:
----
Closure call with mismatched arguments: function 'A.foo'

NoSuchMethodError: incorrect number of arguments passed to method named 'A.foo'
Receiver: Closure: (dynamic, dynamic, dynamic, dynamic) => dynamic from Function 'foo':.
Tried calling: A.foo(2)
Found: A.foo(a, b, c)


Statics BEFORE:
----
Unhandled exception:
No top-level method 'foo' declared.

NoSuchMethodError : method not found: 'foo'
Receiver: Type: class '::'
Arguments: []

Statics NOW:
----
Unhandled exception:
No top-level method 'foo' with matching arguments declared.

NoSuchMethodError: incorrect number of arguments passed to method named 'foo'
Receiver: top-level
Tried calling: foo(...)
Found: foo(a, b, c)

R=regis@google.com

Review URL: https://codereview.chromium.org//14652008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22209 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-30 22:05:14 +00:00
srdjan@google.com 60e57ecfe1 Optimizes 'as' operation in similar way as 'instanceof': collect type feedback in unoptimized mode and try to convert it to a simple classcheck in optimized code.
Review URL: https://codereview.chromium.org//13190014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20783 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-02 15:30:14 +00:00
iposva@google.com c900112af7 - Improve the message for NoSuchMethodErrors that are
determined statically at compile time.
Review URL: https://codereview.chromium.org//12328019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18848 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 18:53:27 +00:00
regis@google.com 47e08870ca Support Null type in Class::TypeTest and simplify Instance::IsInstanceOf.
Review URL: https://codereview.chromium.org//11785006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16664 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-05 00:45:52 +00:00
asiva@google.com 4c069867e4 - Make Boolean 'true' and 'false' singleton VM isolate objects.
- Change all uses of it
Review URL: https://codereview.chromium.org//11745022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16623 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-04 01:52:05 +00:00
srdjan@google.com 29e06db609 In unoptimized code use call for instanceof instead of inlined checks. This allows us to collect type feedback and to reduce the code size of unoptimized code. Next will be work on type tests as well.
Review URL: https://codereview.chromium.org//11694003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16589 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 22:22:39 +00:00
tball@google.com 929344a574 Issue 7549: fix for invalid runtimeType.toString() for int, double, and
string constants.
Review URL: https://codereview.chromium.org//11624034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16516 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-27 18:08:16 +00:00
asiva@google.com 8af296c9c8 Cleanup the exceptions create code to use Arrays instead GrowableArrays so
that it is consistent with the DartEntry invoke code that it calls finally.
Review URL: https://codereview.chromium.org//11639007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16295 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-18 23:47:35 +00:00