This allows the optimizing compiler to generate unboxed loads/stores
to fields containing double values. The double value is stored
in a reusable double object.
Unboxed loads/stores are generated for optimized code. Unoptimized code
allocates a new double on loads. To avoid performance regressions
for fields that are only written few times (e.g. only in the constructor)
I put a heuristic in place that
compares the usage count of setters and getters. Unboxed operations
are only generated if the setter is invoked a significant amount of
times (threshold is 10% of getter invocations).
The CL is so big because it changes the way LocationSummmary
is allocated: We now have a bit to generate different summaries
for optimized and unoptimized code.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//99573005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31164 260f80e4-7a28-3924-810f-c04153c831b5
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
-----
Often ToCString returns a representation which would be weighty or
unsightly to users. Instance::ToUserCString tries to return a
representation that will be more familiar to end users.
ToUserCString will be used in the vmservice to produce interesting
instance preview strings w/o calling toString. No doubt we will find
other uses for it too.
For example, strings are represented more as they would be in a user
program, with quotes and escapes: ("this\nis\ta\n\ntest") instead of (this
is a
test).
I intend to add better representations for short lists and maps
later, e.g. ([1,2]) instead of (Instance(length:2) of '_GrowableList').
I've added some tests to track current behavior.
Fix a problem where the vm internal names for private classes were
leaking out through ToCString. This is problematic because Dart's
default toString relies on ToCString (which surprised me). This fix
will be user-visible and, darn it, it's the right thing to do. For
example, before toString (in Dart) might yield:
Instance of '_MyPrivateClass@43df89GARBAGE4389'
Now it will yield:
Instance of '_MyPrivateClass'
(as an aside, do those single-quotes around the class name add any
meaning here?)
Massage the output of ToString for GrowableObjectArray to be more
consistent with other instance ToString output. This should not be user
visible, as lists define a reasonable toString.
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//100833005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30996 260f80e4-7a28-3924-810f-c04153c831b5
Until now the parser marked native functions as native when parsing.
This may be too late for some functions. E.g. the native typed list
constructor may not be invoked because the intrinsic code is executed
instead (unless for example new-space allocation fails).
This causes missing type information when optimizing functions using
those recognized factory functions like Uint8List._new.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//99373002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30846 260f80e4-7a28-3924-810f-c04153c831b5
being generated for the observatory.
- Reset the state that a class is being currently parsed.
- Move the deployed polymer app to a location where it is not
being overwritten by the tools.
- Do not rely on Dart SDK binaries being in your path.
- Check for errors when invoking dart2js as part of build.dart.
Review URL: https://codereview.chromium.org//77043010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30533 260f80e4-7a28-3924-810f-c04153c831b5
some breakpoints to be skipped when set in optimized closure
functions.
Update implicit_closure_function() to always return null for
factories. Factories use the shared data_ field for another purpose.
This fixes an assertion failure when HasImplicitClosureFunciton is
called for a factory.
Add a TODO for an assertion failure in Class::Name which is not in the
scope of this change.
(patched from an earlier review)
Review URL: https://codereview.chromium.org//64173005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30063 260f80e4-7a28-3924-810f-c04153c831b5
In a static- or top-level variable v
var v = expr
static v = expr
If the initializer expression expr throws, the VM throws a
CyclicInitializationError when loading v afterwards, even though
this has nothing to do with cyclic initialization.
I'm changing the way implicit static getters and static initializers are
compiled. Static initializers are invoked from static getters.
They look as follows:
get:v {
if (field.value === transition_sentinel) {
field.value = null;
throw new CyclicInitializationError();
}
if (field.value === sentinel) {
field.value = transition_sentinel;
init:v();
}
return field.value;
}
init:v {
try {
field.value = expr;
} catch {
if (field.value === transition_sentinel) {
field.value = null;
}
rethrow;
}
}
BUG=http://dartbug.com/5802
TEST=language/lazy_static3_test,
language/throwing_lazy_variable_test,
co19/Language/12_Expressions/30_Identifier_Reference_A08_t02
R=hausner@google.com
Review URL: https://codereview.chromium.org//54713003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29797 260f80e4-7a28-3924-810f-c04153c831b5
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
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