Commit Graph

13143 Commits

Author SHA1 Message Date
srdjan@google.com d56766f251 More ^= to |=
Review URL: https://codereview.chromium.org//11941021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17308 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 19:43:19 +00:00
asiva@google.com 069b3dabc4 Use new |= operator instead of ^= where it is possible to do so.
Review URL: https://codereview.chromium.org//11941005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17302 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 18:47:03 +00:00
srdjan@google.com aec77f4d71 Use new |= operator in object.cc .
Review URL: https://codereview.chromium.org//11938023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17301 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 18:37:06 +00:00
fschneider@google.com 3e94e4a2fa Fix bug in optimization in the presence of externalized strings.
The class-id of string objects can be changed via the Dart API. The optimizer
has to disable hoisting class-id checks across calls. For now, loop-invariant
code motion is disabled for checks of string class-ids.
Review URL: https://codereview.chromium.org//11867020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17288 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 16:29:02 +00:00
vegorov@google.com f6f7f1579e Optimize double.floor and double.ceil down to roundsd when SSE4.1 is available.
R=fschneider@google.com
BUG=dart:7971

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17278 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 14:28:25 +00:00
floitsch@google.com c2446d4626 Move many iterable classes to collection_dev.
Review URL: https://codereview.chromium.org//11931042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17276 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 14:08:41 +00:00
fschneider@google.com 657c4944c3 Remove StringCharCodeAtInstr and handle it as part of LoadIndexed.
Review URL: https://codereview.chromium.org//11970038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17274 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 14:03:40 +00:00
floitsch@google.com fb1632180e Add dart:collection_dev library.
Committed: https://code.google.com/p/dart/source/detail?r=17263
Reverted: https://code.google.com/p/dart/source/detail?r=17265

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17269 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 13:07:27 +00:00
floitsch@google.com 8d1020c6d2 Revert "Add dart:collection_dev library."
This reverts commit 17263.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17265 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 12:34:34 +00:00
floitsch@google.com ba73897a3e Add dart:collection_dev library.
Review URL: https://codereview.chromium.org//11959012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17263 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 12:26:09 +00:00
vegorov@google.com a77fc9701c When requested to extract a method M from class C inject a method extractor (consisting of a single AST node CreateClosure) as a getter get:M into C.
This allows to cache and optimize method extraction requests as normal method invocations and at hot method extraction sites that significantly decreases overhead of method extraction which previously required two trips into runtime system and was not cached at all.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17261 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 11:54:45 +00:00
regis@google.com 912194a756 Fix vm code base so that it can be built for --arch=simarm (no snapshot yet).
Review URL: https://codereview.chromium.org//11956004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17246 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 00:34:20 +00:00
hausner@google.com 0b01d53bd9 Remove support for old style function literals
Fix issue 6709.

TBR=iposva
Review URL: https://codereview.chromium.org//11996003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17245 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 00:24:19 +00:00
asiva@google.com fff63865e6 Add a new operator |= which does a simple assignment of the raw pointer into
a handle without any vtable settings. In debug mode there are the usual checks
to ensure that the vtable in the handle matches the expected vtable value
based on the dynamic type of the object.

It is useful in loopy code as follows:
  const Array& funcs = class.functions();
  Function func = Function::Handle();
  for (int i = 0; i < 100000000; i++) {
    func |= funcs.At(i);
  }
Review URL: https://codereview.chromium.org//11979003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17244 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 00:24:06 +00:00
hausner@google.com eee56248f0 Remove support for legacy abstract declarations
Make keyword 'abstract' illegal in front of class member declarations.
Review URL: https://codereview.chromium.org//12016005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17243 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 00:01:14 +00:00
tball@google.com 9146f935d9 Added heap capacity and used space status methods, for use by status tools.
Review URL: https://codereview.chromium.org//11973035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17235 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-17 21:06:59 +00:00
srdjan@google.com 8451080044 Improve function lookup speed by working with raw objects only.
Review URL: https://codereview.chromium.org//11970043

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17232 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-17 19:27:00 +00:00
fschneider@google.com 4982f8ff33 Fix a bug with store-to-load forwarding for typed arrays.
Stores to typed arrays implicitly convert the value stored.
This CL disables store-to-load forwarding for these array stores.

Normal arrays and float64 arrays can be still optimized as before (no
conversion occurs on store)

TEST=tests/language/int_array_load_elimination_test.dart
Review URL: https://codereview.chromium.org//11962036

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17208 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-17 14:08:04 +00:00
podivilov@google.com d2d26a6656 Fix use of uninitialized memory in debug assert.
deopt_id() -> ASSERT(CanDeoptimize()) -> operands_class_id_ which is not initialized at this point.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17205 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-17 13:43:44 +00:00
fschneider@google.com 8c5b198d95 Optimized loads/stores for scalar list: Uint8Clamped, Int8, Int16, Uint16.
This CL adds optimized stores for Uint8ClampedList, and
loads+stores for Int8List, Int16List and Uint16List.


TEST=tests/standalone/byte_array_test.dart, tests/standalone/int_array_test.dart
Review URL: https://codereview.chromium.org//11967012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17190 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-17 10:43:46 +00:00
hausner@google.com 79f4b5b61b Simplify exception handler table
Sort entries and drop the try_index field. This simplifies lookup
of exception handlers when walking the traces on exceptions.
Review URL: https://codereview.chromium.org//11970024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17179 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-17 01:10:42 +00:00
srdjan@google.com 37a715bbbf Lookup functions by name that contains the private key, except for dart_api which allows ignoring the private key.
Review URL: https://codereview.chromium.org//11968022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17178 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-17 00:42:03 +00:00
hausner@google.com cfb3b53aac Check whether exceptions are caught
The debugger can now determine whether an exemption will be caught or not.
Review URL: https://codereview.chromium.org//11946020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17167 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-16 22:16:09 +00:00
asiva@google.com c8284ad1bb Fix for 7941
- mark unused space in an object whose type has been transformed as
  Int8Array instead of Array. This ensure that GC does not traverse
  the contents of the unused space.
Review URL: https://codereview.chromium.org//11968020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17165 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-16 21:45:49 +00:00
fschneider@google.com 3cd9fa513f Fix bug in the x64 assembler's movw instruction.
The order of prefixes was wrong.  The operand size prefix (0x66)
must occur before the REX prefix.  From the instruction set reference:

[...]the REX prefix byte must immediately precede the opcode byte or
the escape opcode byte (0FH). [...]

Also, make movw(reg, addr) unavailable, consistent with ia32.

TEST=runtime/vm/assembler_x64_test.cc
Review URL: https://codereview.chromium.org//11961013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17135 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-16 12:12:21 +00:00
hausner@google.com 245c0e2c3e Collect debugging info for catch clauses
Collect info about try-statement nesting, and a list of
handled types in each catch clause. This will be used by
the debugger to determine whether an exception is handled
by any handler on the stack.
Review URL: https://codereview.chromium.org//11883023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17100 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-15 22:43:00 +00:00
srdjan@google.com 9320b18911 Improve compilation speed on a pathological case > 2x (7 sec -> 2.7 sec) by improving local lookups.
Review URL: https://codereview.chromium.org//11893002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17085 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-15 19:08:55 +00:00
fschneider@google.com 2904e5bf35 Fix crash bug when deoptimizing from an optimized sqrt operation.
Review URL: https://codereview.chromium.org//11880048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17084 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-15 17:11:11 +00:00
vegorov@google.com d11d988998 Set statically known ResultCid for AllocateObject.
Specialize PolymorphicInstanceCall in ApplyClassIds if receiver cid
was infered: filter out all but one target for attached ICData and drop
checks.

Canonicalize away CheckClass if reciever cid matches at least one in the list of checked.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17079 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-15 15:51:24 +00:00
srdjan@google.com 843e48f6f0 Add Dart class for _ExternalUint8ClampedArray and API to allocate it.
Review URL: https://codereview.chromium.org//11881031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17040 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-15 01:14:17 +00:00
iposva@google.com 4726853cfe - Dump Smi objects into the heap profile.
Review URL: https://codereview.chromium.org//11881010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17036 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-14 23:38:00 +00:00
fschneider@google.com 339ac7f288 Immediate index operand for string [] and streamline code for generating array ops.
Replace sizeof(RawArray) with Array::data_offset where it is used to compute the start
of the array data.

Refactor helpers for generating array addressing mode and use them for string []
operations as well.
Review URL: https://codereview.chromium.org//11880022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17019 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-14 17:00:34 +00:00
vegorov@google.com 260c80a4bb When printing constants in the flow graph truncate them at the first new line character.
This makes IR more machine readable.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17018 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-14 16:05:31 +00:00
vegorov@google.com c2776cdbcc Canonicalize away redundant checks that appear after store-to-load forwarding.
BUG=dart:7513

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17016 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-14 12:15:11 +00:00
fschneider@google.com e0395cf4bb Optimize stores to Uint8List.
Review URL: https://codereview.chromium.org//11855007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17014 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-14 10:27:28 +00:00
fschneider@google.com 75c4844bf5 Cleanup uses of X::CheckedHandle where X::Cast or X::Handle is sufficient.
The only places where CheckedHandle is appropiate is with arguments to
runtime functions and values from Dart API functions.

For other places in the VM either normal Handle and ^=, or Cast is sufficient.

T::Cast is used when the value is guaranteed to be of type T (and never Object::null()).
Otherwise, the operator^= is used for casting.

Also fix a style issue where a Raw* should be used as return type.
Review URL: https://codereview.chromium.org//11826024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17013 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-14 09:51:48 +00:00
cshapiro@google.com 9b890bce4e Emit fake classes to please the third party HPROF tool infrastructure.
Review URL: https://codereview.chromium.org//11879008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17005 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-12 02:43:57 +00:00
cshapiro@google.com 268e059da3 Use a named constant for the object id size when writing out the header.
Review URL: https://codereview.chromium.org//11823002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17003 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-12 00:44:46 +00:00
srdjan@google.com faeb58ba40 Fix printing of deoptimized function.
Review URL: https://codereview.chromium.org//11886008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17002 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-12 00:44:16 +00:00
asiva@google.com a02f310d91 Added code to trace zone and handles creation/deletion under flags
--trace-zone and trace-handles
Review URL: https://codereview.chromium.org//11879005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17001 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-12 00:33:16 +00:00
asiva@google.com 62115b51fe Fix for issue 7757
- Iterate and collect all the inlined functions in an optimized dart frame
  into the stack frame when throwing an exception.
- Added a OptimizedDartFrameIterator class which iterates over all the inlined
  functions of a single optimized dart frame.
Review URL: https://codereview.chromium.org//11833025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17000 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-12 00:24:28 +00:00
srdjan@google.com 2ad98117fd Fix performance of array literals (e.g. "[1, 2]"). Improves speed of DeltaBlue.
Simplify code to allocate groable object array from an object array.
Review URL: https://codereview.chromium.org//11882005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16999 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 23:39:00 +00:00
srdjan@google.com ec59e1e5e0 Fix printing of the function that cannot be optimized.
Review URL: https://codereview.chromium.org//11878006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16997 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 23:15:51 +00:00
iposva@google.com 51447e92ba - Start adding meta data for fields of VM internal classes.
- Correctly report instance size in bytes.
- At least report field sizes for variable sized objects.
Review URL: https://codereview.chromium.org//11880004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16996 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 23:05:57 +00:00
srdjan@google.com 40a7130741 Inline Doubles truncate and round.
Review URL: https://codereview.chromium.org//11573044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16983 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 20:42:47 +00:00
tball@google.com 3ca9ed33bc Fixed warnings reported by clang compiler.
Review URL: https://codereview.chromium.org//11823067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16982 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 19:17:28 +00:00
kmillikin@google.com 0f65888e88 Change the inlining context from an enum to a class.
To support inlining in test contexts, the inlining context needs to have its
dispatched behavior and state.  This change introduces a context class
representing calls inlined for their value or solely for their effects.  The
intermediate array of exits is moved from the graph to the inlining context.
The implementation behavior is otherwise the same as before.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16965 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 11:43:48 +00:00
srdjan@google.com 6cbaf5b800 Increase deoptimization counter threshold to 16, cleanups.
Review URL: https://codereview.chromium.org//11823070

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16945 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 00:43:56 +00:00
hausner@google.com 7e70aaddf7 Support for embedded Dart scripts
Add a line and column offset to scripts so that errors and exceptions
in embedded Dart scripts are reported at the proper location.
New API call Dart_LoadEmbeddedScript() that allows to specify
line and column offsets.

Stumbled on and fixed a bug. Script::kind field was not externalized to snapshot.
Review URL: https://codereview.chromium.org//11824067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16934 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-10 21:47:09 +00:00
fschneider@google.com 15432b2fee Add canonicalize optimization for branches.
Comparisons where the result is only used in a branch on true
can be folded into the branch instruction.

Patterns like this can occur after inlining and constant propagation.
In normal code, we merge branches and comparisons already at graph
building time.

v3 <- (v1 == v2)
Branch if (v3 === true)

is optimized to

Branch if (v1 == v2)

Also: Remove outdated TODOs and rename the canonicalization pass to a 
better name.
Review URL: https://codereview.chromium.org//11819031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16919 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-10 13:18:31 +00:00