Commit Graph

13143 Commits

Author SHA1 Message Date
lrn@google.com 6f2cf94aa8 Rename CastException to CastError.
Review URL: https://codereview.chromium.org//10977078

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13009 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 12:13:58 +00:00
ager@google.com abee5139e5 Reapply change to hide VM-only List implementation classes.
The performance issue was that I had not updated the method
recognizer.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13003 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 11:08:38 +00:00
zerny@google.com 5936a443d6 Instruction size and growth threshold for inlining.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13000 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 10:22:29 +00:00
zerny@google.com ddd377b294 Disable slow debug assertions in use-list verification code.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12995 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 08:34:35 +00:00
sgjesse@google.com cff26ea449 Handle receiving GrowableObjectArrays correctly on native ports
The deserialization when receiving GrowableObjectArrays through native
ports was not correct. A GrowableObjectArrays is now handled as an
internal VM object and is now handled on all code paths.

Added a more comprehensiive test using array literals which are
represented as GrowableObjectArrays.

R=ager@google.com

BUG=dart:5474

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12992 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 07:55:00 +00:00
zerny@google.com 02822c775b Inlining functions with control flow.
Functions containing control flow are now inlined and incrementally extend the graph in SSA form. For the special case of a function with only one exit, we locally update the dominator tree. If multiple exits occur, we currently recompute the dominator tree for the full resulting graph.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12990 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 07:10:06 +00:00
zerny@google.com 05dc0a226d Don't inline recursive calls.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12989 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 07:09:30 +00:00
iposva@google.com b85f604f66 - Implement first class types in the VM.
- Make AbstractType a subclass of Instance and map it and its subclasses
  to private Dart classes in dart:core implementing the Type interface.
- Avoid dispatching through statics in Object if not strictly needed.
Review URL: https://codereview.chromium.org//10979058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12981 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 21:19:00 +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
ager@google.com fe66a0af1a Revert hiding of VM-only coreimpl list implementation types. While I
investigate performance regression (even after fixing constructors
in the intrinsifier).

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12963 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 14:07:56 +00:00
ager@google.com 2d9645ea5a Intrinsify named constructors on private classes.
This was broken before my GrowableArray change as well for the
_Double.fromInteger constructor.

This is using the fact that named constructors are the only method
names that contain '.'. Therefore, it is enough to check that the
classes match and that the method name starting at the '.' matches.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12958 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 13:35:19 +00:00
lrn@google.com 37197c2553 Stop using the Hashable interface.
All objects have a hashCode method, so there is no need for a Hashable
interface.
The interface itself is retained for at least two weeks, to give time for
code to remove uses of it.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12955 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 13:07:54 +00:00
ager@google.com 8e6a2c8345 Hide VM-only coreimpl List implementation types. These should not be
exposed as visible parts of coreimpl.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12952 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 12:37:30 +00:00
ager@google.com 81e81825c9 Make data setter private on GrowableObjectArray.
There is no data setter on Lists. Additionally, this allows to
create buffer overflows.

R=vegorov@google.com,iposva@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12941 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 06:21:07 +00:00
srdjan@google.com 0c9dd53739 More compact code for strict compare with 0.
Noticed while tracking mysterious Bubblesort performance degradation.
Review URL: https://codereview.chromium.org//10984051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12929 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-26 21:00:51 +00:00
hausner@google.com a241a7bae6 Make throw an expression
Throw e is now an expression rather than a statement. The language
spec says that throw without an expression (i.e. rethrowing the
current exception) is an expression as well. I have not implemented
this. It is rather difficult to determine at expression level whether
the keyword "throw" is followed by an expression or not. Thus,
throw without an expression is only allowed at statement level.

I think we should change the language spec to that effect.
Review URL: https://codereview.chromium.org//10982051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12928 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-26 20:53:36 +00:00
iposva@google.com b1f0b23fc7 - Remove obsolete class.
Review URL: https://codereview.chromium.org//10979035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12920 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-26 17:25:39 +00:00
fschneider@google.com 71767f5218 Add code for CPU feature detection and use it to detect SSE3 and SSE 4.1.
The Dart VM now requires at least SSE3 to build and run.

There is a new flag --use-sse41 (default:true) to disable the use of 
SSE 4.1 features manually. 
Review URL: https://codereview.chromium.org//10990028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12897 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-26 09:08:21 +00:00
zerny@google.com 630defd4cb Relax assertions on equality of load fields.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12896 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-26 08:28:45 +00:00
ager@google.com 7977b42215 Update all occurrences of raw strings.
R=hausner@google.com,kasperl@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12893 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-26 06:01:23 +00:00
srdjan@google.com 51011ad470 Fix incorrect strict not-equal comparison when both arguments are constants.
Review URL: https://codereview.chromium.org//10977021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12881 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 20:59:37 +00:00
srdjan@google.com 8415b6e37c In strict comarison use constants instead of registers if possible.
Review URL: https://codereview.chromium.org//10977020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12879 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 20:34:15 +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
srdjan@google.com 4c81a6bfc7 Call compiled static targets directly instead of resolving them at first call.
Review URL: https://codereview.chromium.org//10987031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12870 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 19:04:06 +00:00
hausner@google.com ffedcb612d Make assert a reserved word
Issue 5051.

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12861 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 17:59:35 +00:00
srdjan@google.com 11abda4702 Move HasOneTarget to ICData.
Review URL: https://codereview.chromium.org//10981010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12854 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 17:19:11 +00:00
hausner@google.com c13e591405 Implement part header
This is the final piece in the new import syntax.
Review URL: https://codereview.chromium.org//10989010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12850 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 16:45:14 +00:00
zerny@google.com 7c03f02086 Fix error in r12771 disabling licm.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12849 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 16:41:51 +00:00
vegorov@google.com 7e949446ca Disregard constants with no SSA temp index in register allocator.
R=fschneider@google.com
BUG=dart:5416

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12848 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 16:36:56 +00:00
zerny@google.com cd514c84b4 Add is_inlinable field to functions.
Repeated attempts at inlining functions that cannot be inlined leads to
noticeable performance regression when compiling with dart2js.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12842 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 12:58:51 +00:00
lrn@google.com a1faa6f135 Change IllegalArgumentException to ArgumentError.
Review URL: https://codereview.chromium.org//10989013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12841 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 12:27:52 +00:00
asiva@google.com 690b823195 Fix the types used in bit fields and a few other places.
Review URL: https://codereview.chromium.org//10967044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12820 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 23:25:44 +00:00
hausner@google.com aaf9159b8a Implement part directive
This replaces the existing #source directive.
Review URL: https://codereview.chromium.org//10985005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12818 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 23:18:04 +00:00
srdjan@google.com f02b385f3c Emit kDeoptBefore only in unoptimzied code (target when switching from optimized to unoptimized code).
Review URL: https://codereview.chromium.org//10979004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12812 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 21:54:51 +00:00
hausner@google.com 928148cfc3 Address Siva's comments
TBR=asiva
Review URL: https://codereview.chromium.org//10982012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12811 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 21:53:45 +00:00
hausner@google.com 201bce4219 Support for show/hide combinators
- Add a new VM object called a Namespace.
- A Namespace is a library, and two list of names to hide/show.
- Convert Library and LibraryPrefix to contain Namespace
  objects instead of Libraries in their import list.
Review URL: https://codereview.chromium.org//10967052

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12804 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 20:46:56 +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
kmillikin@google.com c70bcfcfa3 Support constant folding of instructions with constant smi values.
In sparse conditional constant propagation, replace instructions with
constant smi values with their constant value.  Extend the analysis to
understant shift and bitwise binary operations.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12778 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 13:14:54 +00:00
zerny@google.com 89bf06ab7f Remove caller arguments from nested deoptimization environments.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12777 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 13:01:55 +00:00
kmillikin@google.com c6ef238b86 Check for a NULL value before passing it to a function that assumes non-NULL.
R=vegorov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12776 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 12:56:25 +00:00
vegorov@google.com 6560f5c84b Fix convergence issues in range analysis.
Split it into three phases: initialization, widening and narrowing.

During widening and narrowing phi-ranges change according to classical widening and narrowing operators defined as:

Widening:
  [_|_, _|_] v [a, b] = [a, b]
  [a, b] v [c, d] = [c < a ? -inf : a, d > b ? +inf : b]

Narrowing:
  [a, b] ^ [c, d] = [(a == -inf) ? c : min(a, c), (b == +inf) ? d : max(b, d)]

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12772 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 12:00:19 +00:00
zerny@google.com b4ccb26cb6 Disable loop invariant code motion on deoptimized functions.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12771 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 11:28:51 +00:00
kmillikin@google.com 63fa392807 Reapply "A simpler scheme for garbage collection of ureachable phi inputs."
Fix two issues:

* Unreachable code elimination did not correctly identify all unreachable
  blocks.

* Loop detection in the register allocator relied on the block IDs.

R=vegorov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12756 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 07:27:36 +00:00
vegorov@google.com e5d132e2f8 Disable range analysis. Causes timeouts on dart2js buildbots.
TBR=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12740 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 21:51:40 +00:00
vegorov@google.com 5cc5ab0e04 Do not collect smi values with no ssa index for range analysis.
TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12738 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 21:08:32 +00:00
vegorov@google.com 5355309db1 Fix Mac build broken by r12733.
TBR=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12734 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 20:17:15 +00:00
vegorov@google.com 17907d32de Implement range analysis for smi values.
And use it to eliminate overflow checks on + and - operations.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12733 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 20:06:31 +00:00
zerny@google.com eecf2ae922 Fix for off-by-one error in assertion for r12715.
TBR=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12718 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 15:25:21 +00:00
zerny@google.com 2f549da394 Use the inner deoptimization frame when setting incoming arguments.
This fixes issue 5318 where deoptimization of an inlined call resulted in an
incorrect value being set in the deoptimized frames.

R=vegorov@google.com
BUG=5318

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12715 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 14:58:30 +00:00
fschneider@google.com d2e7dba0b5 Fix bug in assigning the positions of safepoints.
Safepoints are associated with the end of instructions so that
splitting a live range at a safe point position makes the safepoint
at that position belong to the correct live range.
Review URL: https://codereview.chromium.org//10963029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12708 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 14:07:46 +00:00