Commit Graph

247 Commits

Author SHA1 Message Date
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
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
zra@google.com daf539e2f9 Fixes a couple problems with GC of unoptimized code.
1. Instead of making a pass before the Marking phase,
   this change does not visit code pointers in functions
   during marking. Then after marking, if the code has
   still not been marked, code pointers in functions
   are nulled out.
2. Since code pointers in functions may be nulled out,
   functions are no longer used as proxies for code in
   deoptimization info.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30600 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-23 00:17:28 +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
johnmccutchan@google.com 29c01044bc This is the final breaking change in dart:typed_data needed for Dart 1.0. We need this change because the ECMAScript SIMD specification only includes Int32x4 and Int32x4List and our types must match.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29849 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-04 21:56:59 +00:00
fschneider@google.com a037e4874b Fix bug with guarded fields and deserialization.
Since deserialization does not involve the normal object construction
procedure, any values written there won't be reflected in the guarded field
type. This results in incorrect optimized code because deoptimization of
dependent code objects in not triggered.

This CL adds tracking of field types and guarded list length when creating
objects via deserialization.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29741 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-01 10:39:09 +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
johnmccutchan@google.com 8a0fd8ce4d Add Uint32x4List to typed_data
R=asiva@google.com, srdjan@google.com, vsm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29639 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 04:57:38 +00:00
asiva@google.com 9809b88c4a Fix RawObject::IsVMHeapObject to use Contains instead of relying on the mark bit.
Review URL: https://codereview.chromium.org//51253003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29572 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 17:51:36 +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
rmacnak@google.com e8d030b338 Do not hide membership of implementation classes in dart:core.
BUG=http://dartbuc.com/12141
R=ahe@google.com, asiva@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28695 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-16 00:15:10 +00:00
regis@google.com 2f900dab13 Cache number of type arguments in class object instead of recalculating it.
Reduce size of num_native_fields field in class object.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28670 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-15 18:31:31 +00:00
asiva@google.com 9641c3eb7d Fix snapshot generation to ensure that the snapshot does not contain
the instance size of internal VM defined classes. These classes have
non word fields and the instance_size_in_words will not be correct
across different platforms.

This fixes the Dartium for Android build issue (snapshot is generated
on the host which is 64 bit and loaded later into a 32 bit process
on Android).

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28391 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-08 23:10:39 +00:00
srdjan@google.com db2516d7c2 Add a is_recognized bit to function kind field. Improves performance of method recognizer and thus the compilation speed.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28026 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-27 21:00:59 +00:00
regis@google.com 6c92ec5439 Simplify VM internal representation of a mixin application clause (MixinAppType
object) by removing some redundant field and type arguments.
Tolerate mixins with wrong number of type arguments and update tests.
Note: this is a first cleanup step in preparation of more mixin bug fixes.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27363 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 00:41:07 +00:00
johnmccutchan@google.com e571ecdf87 Tests for GuardField length check along with bug fixes
R=regis@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27279 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-08 21:44:42 +00:00
srdjan@google.com e3ce299913 Traverse inlined frames lazily when printing the stacktrace. No need to carry separate function and code array, since function can always be extracted from code.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27209 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-05 20:25:00 +00:00
regis@google.com 765aac1496 Keep track of the application of a mixin type to a mixin application class,
which includes setting up its type parameters (fix issue 12871).

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27157 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-04 22:21:36 +00:00
srdjan@google.com cfb81a40aa Last round of cleanups in exception handler, before going to the next stage.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26941 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-30 20:47:02 +00:00
iposva@google.com da4806e40c - Reapply change r26880.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26933 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-30 18:01:18 +00:00
kmillikin@google.com ea5dfcd2e4 Revert "Compress memory usage. Imprive speed of finding exception handle..."
This reverts svn revision 26880.  That change has broken stack traces for
exceptions, making it impossible to use them for debugging Dart code.

BUG=https://code.google.com/p/dart/issues/detail?id=12940

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26909 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-30 11:19:22 +00:00
srdjan@google.com e8117fea14 Compress memory usage. Imprive speed of finding exception handlers: if a code does not have any handlers, do not reaverse the PC descriptors.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26880 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-29 16:47:49 +00:00
srdjan@google.com e06ea63b60 Mark exception handlers if they have a stacktrace specified. Do not build a stacktrace if the handler has no stacktrace.
R=asiva@google.com, hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26823 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 22:42:21 +00:00
johnmccutchan@google.com c8b370ab50 Initial support for length guards on final fields.
R=regis@google.com, srdjan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26433 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 15:32:45 +00:00
fschneider@google.com 0b94e4c329 Clean up VM class DartFunction.
DartFunction was the VM-internal class associated with
the Dart class "Function". It does not have any functionality
on it and therefore we don't need a VM-internal class for it.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26063 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-13 17:05:46 +00:00
srdjan@google.com c891612920 Adapt Random class to be able to run in javascript integer compatibility mode.
R=asiva@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25753 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-02 23:07:55 +00:00
rmacnak@google.com 8ebdd7f9d8 Make LibraryMirror.members an internal native and lazy.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25451 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-24 23:51:15 +00:00
regis@google.com 191d2673c8 Use proper internal name for implicit static final getters.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25053 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 16:29:59 +00:00
fschneider@google.com 13b7b7242a Faster invocation of fields as methods.
Until now there was a large discrepancy between

x.f() and
(x.f)()

This CL makes x.f() as fast as (x.f)() by automatically
generating  a intermediate dispatcher function that loads
the field and invokes the result as a closure.

The approach resembles the one taken for fast noSuchMethod
invocation and reuses the same per-class cache
of dispatcher functions.

It also fixes a bug in the debugger so that VM-generated 
implicit dispatcher functions (like for noSuchMethod, or
field-as-method invocation) don't show up the debuggers
stack trace.

BUG=https://code.google.com/p/dart/issues/detail?id=11041
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25001 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-15 11:12:09 +00:00
fschneider@google.com f260416fb8 Support fast noSuchMethod dispatch for any number of arguments.
Until now, the fast dispatch was only available with getters and
zero argument methods.

This CL generalizes the approach to any number of arguments. The
dispatcher functions that are auto-generated by the compiler
are not attached to the class anymore. Instead the dispatcher
is only stored in the IC data of each call site. Each class
contains a cache of dispatcher function that map
(name, arguments descriptor) => dispatcher.

This also fixes a bug where the VM report a wrong error message
when throwing a NoSuchMethodError.

BUG=https://code.google.com/p/dart/issues/detail?id=11528
BUG=https://code.google.com/p/dart/issues/detail?id=11223
TEST=tests/language/no_such_method_dispatcher_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24876 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-10 10:09:14 +00:00
rmacnak@google.com 04e9e1fe56 Add a VM defined class VMReference as an opaque pointer for Dart code to VM internal objects.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24694 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-02 16:17:25 +00:00
fschneider@google.com 0bf7251d1a Reland: Optimizing noSuchMethod invocation with no arguments.
This is the same CL as https://codereview.chromium.org/17315008/ with
one bug fixed:

If a method is invoked with a mismatching number of arguments, we don't
add a no-such-method-dispatcher function since the dispatcher currently
can only invoke noSuchMethod and would not work if the method
is invoked with correct arguments at a later point.

I extended the test to cover that case.

TEST=tests/language/no_such_method_dispatcher_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24351 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-24 17:18:51 +00:00
srdjan@google.com fa7817bf79 Change static calls in unoptimized code to always call via a stub. Using ICData, the call count of static calls is collected as well.
TODO: Use call frequency to guide inlining.

R=asiva@google.com, hausner@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24307 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 23:35:10 +00:00
fschneider@google.com 48555c83ac Back out r24266 to investigate dartium test failure.
TBR=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24284 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 11:56:32 +00:00
fschneider@google.com ab1981b421 Optimizing noSuchMethod invocation with no arguments.
On each call that triggers a noSuchMethod invocation we 
attach a custom dispatch function that allocates the 
invocation object and invokes noSuchMethod. This dispatcher
is compiled and optimized like a normal Dart function.

Similar to method-extractors, these implicit dispatchers
do not show up as normal functions.

As a first step this CL only handles invocations of getters
and methods with no like o.foo or o.foo().  This CL gives
a >25x speedup of such noSuchMethod invocations. Calls with
multiple arguments still go through the slow path.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24266 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 07:31:51 +00:00
srdjan@google.com 47de186e76 Store arguments descriptor in ICData. Remove loading of arguments descriptor at unoptimized call site (the ones using ICData).
R=asiva@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24239 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 16:29:39 +00:00
fschneider@google.com 3208230580 Revert r23330 and r23136 because of a bug with loop invariant code motion.
This CL temporarily remove deoptimzation history which was put in to prevent
repeated deoptimization caused by loop invariant code motion. It caused
illegal code motion under certain conditions.

BUG=https://code.google.com/p/dart/issues/detail?id=11245
TEST=tests/language/licm3_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23989 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 15:52:33 +00:00
bak@google.com 5cb3b20063 Object histogramin the vm (--print-object-histogram).
Reviewed and LGTMed in:
https://codereview.chromium.org/16077018/

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23954 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 09:06:43 +00:00
hausner@google.com 0374dc9b12 Reified metadata in the VM
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23912 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-12 15:44:57 +00:00
asiva@google.com 7f8320e042 Make ImmutableArray a sub class of AllStatic.
This enables Array to be a FINAL_HEAP_OBJECT and the operators
'=' and '^=' would be a simpler implementation which does not
require a call to initializeHandle().

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23884 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 21:52:39 +00:00
asiva@google.com 37c551db05 - Remove the unvisited handles code from handles implementation as it is not
used anywhere
- Added IsFreeListElement to RawObject

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23710 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-06 18:47:51 +00:00
fschneider@google.com c1a33f3ea6 Add deoptimization history to optimized functions.
Each function that is optimized or inlined into an optimized
functions keeps an array of deoptimization ids.

This history is used to avoid repeated deoptimization caused by
speculative hoisting of check instructions.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23136 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 12:03:40 +00:00
asiva@google.com e33c2d4254 Delay Class parsing until the class is actually used.
Prior to this change the initial heap sizes were as follows:
ia32:
Size of isolate snapshot = 1230921
New space (0k of 32768k) Old space (1446k of 1604k)

X64:
Size of isolate snapshot = 1223943
New space (0k of 32768k) Old space (2630k of 2692k)


After this change the initial heap sizes are as follows:
ia32:
Size of isolate snapshot = 686443
New space (0k of 32768k) Old space (677k of 836k)

X64:
Size of isolate snapshot = 684731
New space (0k of 32768k) Old space (1220k of 1412k)

R=hausner@google.com, iposva@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23115 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 00:13:10 +00:00
iposva@google.com 083c9e5e95 - Remember the fact that an object has been added to the
store buffer by a bit in the header.
- This bit can be used to filter out redundant additions
  into the store buffer making the dedup sets not needed.
- Remove the need for a HashSet when remembering old to
  new references.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22393 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 20:59:42 +00:00
hausner@google.com d852cd37c4 Another fix for debugging stack traces and captured variables.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22196 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-30 19:46:07 +00:00
iposva@google.com cd59df700e - Remove kFreeBit, as it is not needed any longer
except during snapshotting.
- Move the kWatchBit into the available space as its
  use does not overlap with snapshotting.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22181 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-30 15:05:45 +00:00
iposva@google.com 6c4ac09cb9 - Remove heap tracing.
Review URL: https://codereview.chromium.org//14179015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21844 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-22 21:43:57 +00:00
kustermann@google.com e2216f61bf Fast copy between TypedData and ExternalTypedData
Until now, copying data from TypedData to TypedData and from ExternalTypedData
to ExternalTypedData was fast. But copying between TypedData and
ExternalTypedData was not handled in a fast way.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21791 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-22 08:27:15 +00:00