Commit Graph

17 Commits

Author SHA1 Message Date
fschneider@google.com 5aa02dce31 Small cleanup and more test coverage for guarded fields.
Some cases of field guards for guarded length  were not covered by our tests.

Otherwise I removed redundant conditions that are either impossible
or always true from the code generator for GuardFieldInstr.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30887 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-05 11:17:06 +00:00
fschneider@google.com 8b0b3fde4d Generalize if-conversion to arbitrary smi comparisons.
Until now only == and != comparisons were supported.

Further changes are:
 Remove flag FLAG_new_identity_spec: It is not needed anymore.
 Invoke Canonicalize another time before branch optimizations.
 Fixes support for TestSmiInstr with the branch-simplifier pass.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30622 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-25 12:57:21 +00:00
fschneider@google.com b324e06153 VM: Fix identical comparisons with bigints.
The optimizing compiler did not properly preserve registers across
the runtime call that occurs when using identical with bigints.

BUG=http://dartbug.com/14903
TEST=tests/language/vm/regress_14903_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30058 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-07 17:27:16 +00:00
fschneider@google.com 1671427c00 Fix static warning in a test.
Need to import dart:async to use Future class.

TBR=kasperl@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29743 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-01 11:07:50 +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 be9875fb2b VM: Fix bug in polymorphic inlining of recognized methods.
The inliner has to insert a redefinition of the receiver to
prevent illegal hoisting of instructions that depend on the
receiver class id.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29389 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-28 20:20:11 +00:00
fschneider@google.com 369a58132e Fix bugs in load elimination and type propagation.
Load elimination should consider the representation of loads/stores
when numbering places. Different representations result now in different
places so that there can't be mixed representations at phis after
load elimination.

Removed the flag --propagate-types because type propagation is required
for correctness of smi-check hoisting. Therefore, switching it off does not
 make sense anymore.

BUG=https://code.google.com/p/dart/issues/detail?id=6663, https://code.google.com/p/dart/issues/detail?id=14271
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28931 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-21 13:59:56 +00:00
fschneider@google.com b5465cf7ef VM: Fix bug in canonicalization of identical in the optimizing compiler.
Make sure that BranchInstr::Canonicalize does not mutate it's input before
all conditions for the optimzations to take place are met. Otherwise, bailing out
leaves the affected comparison instruction in an invalid state.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28646 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-15 15:15:47 +00:00
fschneider@google.com a329b0e6bc Dart VM: Simplify code generation for equality operators.
By inserting the necessary checks for null inside the callee
at the AST level, the code generation of == operations can be
greatly simplified.

This is a performance-neutral change and a step for allowing
generic inlining of arbitrary == methods. So far we could only
inline them for a common set of types in the flow graph
optimizer.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28084 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 10:10:50 +00:00
fschneider@google.com 1072bc1c60 Reland: Fix bug in field type tracking and polymorphic inlining.
Original CL: https://codereview.chromium.org/24096018/

This fixes the bug by changing FlowGraphBuilder to a zone object
because it is needed by the inliner later in the pipeline.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27695 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-20 10:35:01 +00:00
asiva@google.com 53a1ec9456 Revert
https://code.google.com/p/dart/source/detail?r=27655
as it is causing dartium build breakage.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27675 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-19 20:32:16 +00:00
fschneider@google.com 7dea1d8a2c Fix bug in field type tracking and polymorphic inlining.
When inlining implicit getters via the polymorphic inliner
(and not through the flow graph optimizer) the fields loaded
must be added to the list of guarded fields that trigger
deoptimization when a store violated the field type guard.

Also, this CL avoids adding fields to the list from inlining
candidates that do not get inlined after all. Previously, the
optimizer pass on the callee graph would add guarded fields
even if the final graph does not get inlined.

TEST=tests/language/vm/optimized_guarded_field_test.dart
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27655 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-19 11:21:11 +00:00
sgjesse@google.com a2865875f2 Update language.status
Add some more issue numbers. Rewrite some tests

R=kustermann@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27193 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-05 12:37:31 +00:00
fschneider@google.com e174a4c18e Fix a compiler bug caused by Utils::IsPowerOfTwo treating zero as a power of two.
The IsPowerOfTwo function is used together with ShiftForPowerOfTwo.  Both function
do not work with zero. This caused the optimizing compiler to generate invalid code
for the expression

x ? 0 : 0

where it assumed that if one of the constants is a power-of-two, it can
be computed by (1 << n). We check for 0 in a number of places, but instead
I decided to fix Utils::IsPowerOfTwo itself and remove unnecessary checks
for the zero case.

TEST=tests/language/vm/if_conversion_vm_test.dart, runtime/vm/utils_test.cc
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27033 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 09:28:34 +00:00
fschneider@google.com 92e97e5d1a Fix bug with reflection on VM-internal native methods.
My previous approach was not enough, since methods can
be invoked via reflection before they are parsed/compiled.

This CL fixes the problem at hand, but I'd like a more general
approach to mark those methods. Maybe an annotation at the declaration
would be better.

I also refactored the test case as suggested in the previous code review.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27009 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-02 10:43:59 +00:00
fschneider@google.com eba0f840f9 Move VM specific test to the correct location.
TBR=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26627 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 09:29:58 +00:00
sgjesse@google.com 550f3ab7f4 Add issue numbers to language tests status files
Moved VM specific tests to a separate directory

R=kustermann@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26596 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-23 11:31:25 +00:00