Commit Graph

2354 Commits

Author SHA1 Message Date
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
ager@google.com 02b566ee62 Add documentation to the Object class in the core library.
R=lrn@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12770 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 11:07:34 +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
jackpal@google.com 3e510176c2 Fix Android build breaks
Prevent Android's STLPort from undefining global functions from
math.h when cmath is included after math.h.

The Android STLPort does not provide std::assert or std::atexit. Use
the C versions of these functions on Android.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12741 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 22:04:37 +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
vegorov@google.com 149c119a01 Improve ShouldSpecializeForDouble to handle ICs with multiple checks.
R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12703 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 13:30:23 +00:00
ager@google.com 5c9f9ef74f Avoid needless int64_t to intptr_t conversion in eventhandler.
R=sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12693 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 11:40:40 +00:00
ager@google.com 6236cd51a5 Use native fields for process pid and fix bug that allowed killing
a process before it was started.

We should make the change to make Process.start return a future that
does not complete unless the process is actually started. That would
have avoided this issue as well.

R=sgjesse@google.com
BUG=dartbug.com/5301

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12691 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 11:07:36 +00:00
sgjesse@google.com 4ecf9c3a19 Update documentation for HTTP response status code
R=ager@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12685 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 09:06:50 +00:00
ager@google.com c6aea6b1eb Use native wrapper fields to store socket ids.
This relies on landing the change to fix implicit super constructors
for subclasses of something that has native fields.

R=sgjesse@google.com
BUG=dartbug.com/5301

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12684 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 08:19:01 +00:00
ager@google.com b065e9cb29 Fix implicit super constructor calls for sub-classes of native field wrappers.
The current code does not add implicit super calls for any sub-classes
of native field wrappers. It should only omit them from the actual
native field wrappers.

I encountered this issue when looking into dartbug.com/5301.

The test in the parser is not pretty. However, since the native field
wrappers can be generated through the API a better solution was not
immediate. I wanted to check if the class was from the
dart:nativewrappers library, but through the API you can create
native wrappers in any other library as well.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12679 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 05:40:33 +00:00
asiva@google.com 4140ed9d5b Fix for issue 5223 : Import 'dart:core' implicitly only if it has not been
already explicitly imported in the script.
Review URL: https://codereview.chromium.org//10949028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12673 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 00:43:08 +00:00
iposva@google.com eee4bbc1ef - Add definition of "int hashCode()" to Object.
- Implement hashCode in the VM.
- Mark hashCode as unimplemented in dart2js.
- Update test using the identity hashcode.
Review URL: https://codereview.chromium.org//10956026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12669 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 00:32:58 +00:00
asiva@google.com 72f3a9c2ba Issue a more meaningful error message when we see duplicate definitions (ambiguous reference)
Review URL: https://codereview.chromium.org//10969002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12657 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 21:04:14 +00:00
iposva@google.com b9327e0236 - Make the VM understand the --checked flag to be aligned with dart2js.
- Adjust some of the checked mode tests to pass --checked and --enable-checked-mode.
Review URL: https://codereview.chromium.org//10962013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12651 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 18:19:06 +00:00
iposva@google.com e95e5160ce - Fix flag names.
Review URL: https://codereview.chromium.org//10958002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12649 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 17:38:01 +00:00
zerny@google.com 5d2c29fef7 Disable inlining by default.
Inlining deoptimizable code currently causes errors.

See Issue 5318.

R=fschneider@google.com
BUG=5318

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12645 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 15:36:26 +00:00
lrn@google.com c0f42d2748 Made removeAt errors consistent between dart2js and VM.
Reneabled test for VM.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12632 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 12:52:54 +00:00
vegorov@google.com 5fdc89e84b Improve SminessPropagator to propagate sminess across cycles of phis.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12630 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 12:05:02 +00:00
lrn@google.com eeeab5f0ad Add list.removeAt method.
Review URL: https://codereview.chromium.org//10970009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12627 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 10:50:00 +00:00
kmillikin@google.com 52af2225e9 Revert "A simpler scheme for garbage collection of ureachable phi inputs."
This reverts svn revision 12621.  It causes unexpected test timouts.

TBR=sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12624 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 09:11:44 +00:00
kmillikin@google.com 13ef2a994e A simpler scheme for garbage collection of ureachable phi inputs.
Simplify the garbage collection of unreachable phi inputs.  Assign immutable
block ids to basic blocks and ensure that both predecessor blocks and phi
inputs are kept sorted by block id.

R=vegorov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12621 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 08:47:57 +00:00
kmillikin@google.com 67021511ca Make some static helpers into member functions.
Four helper functions that moved from lib/integers.cc to vm/object.cc so
they could be used during constant folding are more properly member
functions than static functions.

R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12620 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 08:38:33 +00:00
ager@google.com 45da470ddf Fixes to tests and updating status file to make buildbot green.
R=lrn@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12619 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 07:54:18 +00:00
ager@google.com e676e88f81 Introduce a VM-only dart:scalarlist library for byte arrays.
Include it in the SDK so users can use it. Create a dummy
implementation and patch file for the library for dart2js so it can be
documented. Johnni, can you think of a nicer way of making
documentation generation work for a VM only library? Also, it seems that
patching kills the documentation comments and they do not show up in
the generated docs.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12616 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 07:08:10 +00:00
vegorov@google.com cd578d9de7 Ensure that parser throws an error when parsing x is! T with malformed type T.
Otherwise VM crashes in the flow graph builder

R=regis@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12608 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 21:48:50 +00:00
regis@google.com 99818005d8 Control static type propagation with a flag in optimizing compiler.
Minor cleanup.
Review URL: https://codereview.chromium.org//10952009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12601 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 20:59:01 +00:00
hausner@google.com 38f8f3cbfa Add virtual method to Object to ease dictionary code
Add a virtual method at the root of the object hierarchy
that returns the name of the object that is used in the
namespace dictionary. Only object types that are kept in
the dictionary need to overwrite the default implementation. 
Review URL: https://codereview.chromium.org//10945020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12577 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 17:09:42 +00:00
kmillikin@google.com 76495c3a8a Fix a typo in an input index computation.
Bug was found by varying the order of predecessors.

R=vegorov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12570 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 16:05:58 +00:00
ahe@google.com 3f1932a563 Handle backslashes and newlines when escaping strings.
Review URL: https://codereview.chromium.org//10943027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12568 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 15:43:41 +00:00
vegorov@google.com adf926862d Turn definitions that do not produce results (e.g. Checks) into instructions.
This allows more uniform iteration of IR for example when we are looking for all Smi values.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12563 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 14:38:31 +00:00
ager@google.com 576532edcc Bug cleanup: unify on allowing radices from 2 to 36 in
num.toRadixString. Add test and documentation.

R=lrn@google.com,floitsch@google.com
BUG=dartbug.com/461

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12562 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 14:15:39 +00:00
kmillikin@google.com be0492a8a8 Reapply "Initial implementation of sparse conditional constant propagation."
With a fix for compilation on Mac.  GrowableArray is DISALLOW_COPY_AND_ASSIGN,
so we can't create a temporary one to be ignored and have to pass one in to be
ignored.

R=fschneider@google.com,zerny@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12561 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 14:10:14 +00:00
zerny@google.com 58b3f8871c Remove check for stack overflow on entry to an inlined function.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12556 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 12:43:48 +00:00
zerny@google.com 8ca2c4e6e9 Replace start_env with initial_definitions in GraphEntryInstr.
The initial definitions do not have any deoptimization information and can be
represented as just a list of definitions. For easy access, the constant_null
getter remains but assumes that index 0 contains the constant.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12555 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 12:37:57 +00:00
kmillikin@google.com 5e449aea52 Revert "Initial implementation of sparse conditional constant propagation."
Revert due to compilation failures on Mac.

TBR=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12552 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 11:04:36 +00:00
kmillikin@google.com ae9efbfab0 Initial implementation of sparse conditional constant propagation.
Use the results of SCC to eliminate unreachable code.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12549 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 10:34:14 +00:00
ahe@google.com d0f3e48063 Work around for bug 4995 to unbreak VM build.
Review URL: https://codereview.chromium.org//10947026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12541 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 09:00:38 +00:00
fschneider@google.com 542c853d64 Delete code for the now unused IL instruction NumberNegate.
It was replaced by an unboxed double operation in a previous change.
Review URL: https://codereview.chromium.org//10938011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12539 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 08:33:07 +00:00