Commit Graph

119 Commits

Author SHA1 Message Date
fschneider@google.com e2a0c8f7ca Optimize stores to ExternalUint8Array and ExternalUint8ClampedArray in the optimizer.
This CL adds support for these two array types to the StoreIndexed instruction.
Review URL: https://codereview.chromium.org//12263010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18517 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-14 12:59:51 +00:00
fschneider@google.com f0caa40576 Add optimized loads from ExternalUint8ClampedArrays.
The generated code is exactly the same as for ExternalUint8Array.

TEST=tests/standalone/byte_array_test.dart
Review URL: https://codereview.chromium.org//12225049

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18183 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-06 19:00:50 +00:00
fschneider@google.com dfda7854a8 Fix source position for stack traces with optimized top function.
Fix decoding of the deoptimization info when constructing a stack trace.

Fix stack trace for checked mode exceptions from optimized code.

BUG=dart:8058
TEST=runtime/tests/vm/dart/optimized_stacktrace_test.dart,
     tests/language/stack_overflow_stacktrace_test.dart
Review URL: https://codereview.chromium.org//12049039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17755 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-29 12:38:27 +00:00
fschneider@google.com 64039d8ec3 Optimize loads and stores to Int32Array and Uint32Array.
Review URL: https://codereview.chromium.org//12041005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17362 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-21 16:19:42 +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
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 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
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
srdjan@google.com 04fc29c7e1 Optimize function at its entry instead of at exit.
The code can be patched if it should not be executed any longer.
The code can be now patched at other location than at entry, the requirement is still that patching code does not overwrite an inlined object.
Intrinsic methods that do not have a fall through cannot be patched.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16897 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-10 00:28:57 +00:00
hausner@google.com e8a293c05a Allow optimized code when debugger is active
The debugger allows the VM to optimize code unless there is a breakpoint inside the
function. Whenever a new breakpoint is set (explicitly or implicitly by stepping)
all optimized code is discarded.
Review URL: https://codereview.chromium.org//11780005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16815 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-08 18:57:19 +00:00
fschneider@google.com 87a3a4b479 Support immediate and memory operands for PushArgumentInstr in optimized code.
If a value is a constant or stored on the stack this change avoids loading it into a
new register before pushing it.
Review URL: https://codereview.chromium.org//11791051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16806 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-08 16:51:57 +00:00
srdjan@google.com 0af16251b5 Intrinsify Uint8ClampedArray's store and load indexed, inline load indexed.
Review URL: https://codereview.chromium.org//11783006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16666 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-05 01:07:32 +00:00
asiva@google.com 4c069867e4 - Make Boolean 'true' and 'false' singleton VM isolate objects.
- Change all uses of it
Review URL: https://codereview.chromium.org//11745022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16623 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-04 01:52:05 +00:00
srdjan@google.com 84d5fb4614 Sort checks by counts before emitting test-and-call polymorphic instance calls.
Review URL: https://codereview.chromium.org//11602014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16517 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-27 18:24:03 +00:00
srdjan@google.com b7ed42c921 Fix test failure issue 7471: Signature classes have different type checking rules, i.e., they have no subclasses but other signature classes may be subtypes (must check signature).
Review URL: https://codereview.chromium.org//11640025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16339 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-19 19:47:13 +00:00
kmillikin@google.com a119414b2f Cache lookups at megamorphic call sites in optimized code.
The function name and argument descriptor are mapped to a lookup cache
at compile time.  The cache maps class id to target function.  It is
resizable.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15889 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-10 09:48:52 +00:00
kmillikin@google.com 275c8d928f Introduce a class encapsulating arguments descriptor arrays.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15727 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-05 12:05:57 +00:00
fschneider@google.com 3c81141f1c Instantiate uninstantiated types with known constant type-arguments.
The enables eliminating more type-checks.

For type-checks that have a uninstantiated target type and a constant
instantiator type arguments as input, we can instantiate the type
at compile-time.
Review URL: https://codereview.chromium.org//11280230

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15689 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-04 14:51:43 +00:00
srdjan@google.com 888e564924 Attempt to do direct class comparison for type checks using CHA.
Next step is to convert instanceof nodes to an integer comparison node, which would then be automatically merged with branch.
Review URL: https://codereview.chromium.org//11348289

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15486 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-29 00:49:42 +00:00
fschneider@google.com 26e054bbc4 Support loads from Uint8Array and ExternalUint8Array in the optimizing compiler.
This is done by extending LoadIndexed to handle Uint8Array and ExternalUint8Array.

Small cleanups:
 - Share code for computing the element addresses for indexed loads.

 - Remove kGrowableArrayCid where it cannot occur. We only ever emit
   LoadIndexedInstr for fixed-size arrays. Loads from growable arrays
   are split into loading the backing store first and then an indexed
   load from the backing store.
Review URL: https://codereview.chromium.org//11411142

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15305 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-26 11:50:07 +00:00
srdjan@google.com a6dae8cd4a First part of static call cleanup: store static call targets into code object, referenced by code-offset.
Review URL: https://codereview.chromium.org//11418046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15091 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 16:39:07 +00:00
fschneider@google.com 59a1f747f4 Enable inlining of functions containing instance-of.
The corresponding issues have been fixed and all tests pass now.

BUG=dart:5216,dart:5217
Review URL: https://codereview.chromium.org//11369230

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14872 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-13 23:45:23 +00:00
srdjan@google.com 7375693321 In optimized code use IC calls for instance calls that have no IC data instead of deoptimizing. The optimized IC call increments usage counter and reoptimizes optimized function if the threshold is met.
Recognize closure calls and mark them in ICData. Closure calls do not populate ICData, i.e., number of checks is always 0 (unless mixed closure calls with regular instance calls). Therefore closure IC calls do not count for reoptimization.
Review URL: https://codereview.chromium.org//11361225

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14860 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-13 18:34:05 +00:00
srdjan@google.com dc8115e19a Remove unused/not working function tracing flag and functionality.
Other small fixes, use stub to call optimization of a function (in preparation for reoptimization).
Review URL: https://codereview.chromium.org//11364184

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14756 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-09 20:55:31 +00:00
srdjan@google.com a397650682 For megamorphic calls (IC calls in optimized code), use a stub without attempting to count usage of function.
Review URL: https://codereview.chromium.org//11359046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14499 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-02 20:21:33 +00:00
srdjan@google.com 078bc44a1d Various little cleanups to avoid excessive allocation of handles.
Review URL: https://codereview.chromium.org//11358052

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14486 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-02 16:35:05 +00:00
srdjan@google.com 86e8ff0a06 Add flag --always_cleared_ic_data, which forces a cleared ICData to be emitted with each IC call (instead of propagating the ICData from unoptimized to optimized code). This addresses Kevin's concern that propagating the ICData may hurt performance when inlining methods as the IC calls of inlined methods may not need all classes as the unoptimized code. Currently running with cleared ICData slows dart2js by > 2%, probably because the ICData has to be repopulated by optimized code through calls to runtime. Adding the flag for experimenting as we work on inlining strategies and megamorphic calls.
Review URL: https://codereview.chromium.org//11347049

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14367 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 20:07:31 +00:00
asiva@google.com ebbb7c4134 - Represent strings internally in UTF-16 format, this makes it
compatible with webkit and will allow for easy externalization of
  strings. One byte strings are retained for pure ASCII strings.
  (The language specification was changed recently to reflect this as
   follows "A string is a sequence of UTF-16 code units").
- Remove four byte string class and all references to it.
- Rename some of the string functions in Dart API to make them
  consistent and better describe the underlying functionality
  Dart_NewString => Dart_NewStringFromCString
  Dart_NewString8 => Dart_NewStringFromUTF8
  Dart_NewString16 => Dart_NewStringFromUTF16
  Dart_NewString32 => Dart_NewStringFromUTF32
  Dart_NewExternalString8 => Dart_NewExternalUTF8String
  Dart_NewExternalString16 => Dart_NewExternalUTF16String
  Dart_NewExternalString32 => Dart_NewExternalUTF32String
  Dart_StringGet8 => Dart_StringToUTF8
  Dart_StringGet16 => Dart_StringToUTF16
  Dart_StringToCString => Dart_StringToCString
  Dart_IsString8 => Removed
  Dart_IsString16 -> Removed
  Dart_StringToBytes -> Removed
  Dart_StringGet32 -> Removed
Review URL: https://codereview.chromium.org//11318018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14357 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 17:56:46 +00:00
srdjan@google.com dc55e9817f Use unary class checks when emitting instance calls in optimized mode.
Review URL: https://codereview.chromium.org//11339033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14350 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 16:35:30 +00:00
kmillikin@google.com 3d684dcc70 Compress deoptimization information by sharing common suffixes.
For all the deoptimization entries in a function, build a suffix trie.  Add
a new deoptimization instruction that indicates the rest of the translation
is a fixed-length suffix of another entry.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14252 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 09:50:35 +00:00
srdjan@google.com 39931e05c5 Propagate ICData from unoptimized code to instance calls in optimized code.
Review URL: https://codereview.chromium.org//11341025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14236 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 00:48:11 +00:00
iposva@google.com dc2c8b3707 - Consolidate code into the old generation.
- Record pointers between code objects.
- Collect unreferenced code objects.
Review URL: https://codereview.chromium.org//11265026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14113 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-25 23:46:01 +00:00
johnmccutchan@google.com d90ad834d5 Inline load and store index on Float32Arrays.
Review URL: https://codereview.chromium.org//11198072

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13893 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-22 17:04:50 +00:00
srdjan@google.com fc6afec8de Inline indexed load and store of typed array float64.
NavierStokes time improves from 34,775us to 12,000us (v8 runs NavierStokes in 16000 us).
Review URL: https://codereview.chromium.org//11092090

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13682 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-16 15:40:54 +00:00
fschneider@google.com 54ea76dc6b Remove support for optimized dart leaf functions.
This optimization does not bring any benefit since all functions
have at least a call in the slow-path of the stack-overflow check.

I'm suggesting to remove support for this optimization since it
does not get triggered currently, therefore is also not tested.
Plus we have inlining now, which already makes calls to (small 
enough) leaf functions fast.
Review URL: https://codereview.chromium.org//11086044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13555 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-11 16:35:47 +00:00
srdjan@google.com 717e3c0396 Support for mixed null/smi equality: do not deoptimize, emit same optimized code as if that was smi-equality only.
Moved assert for duplicate class checks into ICData.
Allow CheckClassInstr to check for Smi as well.
Review URL: https://codereview.chromium.org//11048032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13254 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-04 19:35:23 +00:00
kmillikin@google.com 8a6dd23f3c Run canonicalization again after constant propagation.
This eliminates smi checks of constant-valued instructions.  Also fix
printing of block numbers in code comments.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13170 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-03 11:09:19 +00:00
kmillikin@google.com d7115e5eda Remove deoptimization index PC descriptors.
Put the PC (offset) of the deoptimization point and the deoptimization
reason in the DeoptInfo table.  The table entries are now triples of
(PC offset, info, reason).

R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13056 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-01 10:16:22 +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
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
zerny@google.com aa5281c88a Reapply "Deoptimization support in inlined code."
This reapplies r12488 with a fix.

R=kmillikin@google.com,fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12499 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 13:41:20 +00:00
zerny@google.com e174be3f27 Revert "Deoptimization support in inlined code."
This reverts commit a78e33f178aae74a97f4231ca98183adf97fda71.

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12492 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 12:18:04 +00:00
zerny@google.com 64a9ca2b81 Deoptimization support in inlined code.
Review URL: https://codereview.chromium.org//10928232

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12488 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 11:53:59 +00:00
fschneider@google.com 761e09e948 Improve register usage for StoreInstanceField and StoreIndexed.
No need for a temp if we don't emit a write barrier and
use a immediate operand for the value if available.
Review URL: https://codereview.chromium.org//10910252

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12310 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 10:49:01 +00:00
lrn@google.com 292da5cc48 Make int an abstract class.
This looks deceptively simple (the only real change is in init, which
just copies the code for double, and the rest are just renaming for
consistency). It seems to work.

Review URL: https://chromiumcodereview.appspot.com//10933039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12304 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 07:17:27 +00:00
srdjan@google.com 62a76d0783 Using type feedback, eliminate store barriers for indexed stores.
Review URL: https://chromiumcodereview.appspot.com//10910224

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12268 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 15:52:58 +00:00
vegorov@google.com 5f9ff89e0a Add support for WritableRegister policy in the register allocator.
Use it to eliminate push/pop on the fast path of the write barrier.

Tighten assertions in StoreIntoObject to ensure that value register is not equal to object register. Current code can't cope with that.

BUG=

Review URL: https://chromiumcodereview.appspot.com//10909169

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12193 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 12:50:52 +00:00
kmillikin@google.com 8201f0db6b Introduce nested deoptimization environments.
Add an optional outer deoptimization environment to support inlining.
Introduce a pair of environment iterators.

Original codereview: https://chromiumcodereview.appspot.com/10928048/

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

Review URL: https://chromiumcodereview.appspot.com//10909168

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12190 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 12:30:21 +00:00
regis@google.com 7cc84c2892 Implement new optional parameters syntax in the vm (issue 4290).
Provide --reject_named_argument_as_positional flag to ease transition to new
syntax (default is false).
Add tests.
Review URL: https://chromiumcodereview.appspot.com//10910119

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12004 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 01:13:27 +00:00