Commit Graph

53 Commits

Author SHA1 Message Date
srdjan@google.com 951c878e49 Fix potential problem with mismatch between ICData inloine cache miss handler in optimizing compiler.
Review URL: https://chromiumcodereview.appspot.com//10114010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6664 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-17 23:10:05 +00:00
srdjan@google.com dee5447c56 Fix a crash when optimizing instance field increment: if the increment operation gets interrupted because of an exception during increment the collected classes at getter and setter phases may differ (e.g., one class at getter, zero classes at setter).
Review URL: https://chromiumcodereview.appspot.com//10020058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6443 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 22:28:03 +00:00
regis@google.com 3c063c8d4f Eliminate type checks that can successfully be performed at compile time.
Review URL: https://chromiumcodereview.appspot.com//10051011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6420 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 17:42:39 +00:00
asiva@google.com 8f208ad7ca Wire GrowableArray to use the internal VM object.
This also fixes issue (5526318 : Make access to GrowableArray objects through the dart api more efficient)
Review URL: https://chromiumcodereview.appspot.com//10012042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6341 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-09 21:50:53 +00:00
srdjan@google.com c446c19fb7 Intrinsify methods early. Fix some bugs in trinsified code, mark one precision-related bug as SKIP since sometimes it may pass sometimes not.
Review URL: https://chromiumcodereview.appspot.com//9921017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5985 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-29 17:05:00 +00:00
srdjan@google.com f1bad6571d Improve checked mode a little (more to come in a different CL).
Review URL: https://chromiumcodereview.appspot.com//9854030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5847 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 18:23:37 +00:00
srdjan@google.com 923ed6eb53 It is the setter that can have a result, but not the StoreInstanceFieldNode.
Review URL: https://chromiumcodereview.appspot.com//9581016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4902 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-02 21:52:03 +00:00
srdjan@google.com e2ab4d25fd Added stack overflow checks at backward branches in order to allow interrupting endless loops. Better code will detect if the loop calready contains calls and therefore can omit the extra check (in next compiler).
Review URL: https://chromiumcodereview.appspot.com//9562045

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4889 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-02 17:53:28 +00:00
srdjan@google.com ab3736b98d Fix issue 1845: Mint BIT_AND Smi was incorrect for negative Smi-s. Jump to slow case on negative Smi since the result will be Mint anyway.
Review URL: https://chromiumcodereview.appspot.com//9526001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4730 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-29 01:08:19 +00:00
srdjan@google.com f6dfa63c9a Cleaned up usage of Function::code, since it may be misunderstood that it points to the only Code object that belongs to that function. That is not the case, there can be several Code object generated for the same function. "Renamed" "code()" to "CurrentCode()", use unoptimized_code where it is clear that we are using unoptimized code only. If compiled, there is a 1:1 correspondence between function and unoptimized code.
Review URL: https://chromiumcodereview.appspot.com//9475031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4656 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 01:31:44 +00:00
hausner@google.com 6d9abc5e3b StepOver, StepInto, StepOut
Implement single stepping in the debugger.
- Add PC descriptors for function return
- functions to set temporary breakpoints on all
  locations in a function.
- patching/restoring of function return code pattern
- determine call target of instance calls
Review URL: https://chromiumcodereview.appspot.com//9484002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4639 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-27 22:00:28 +00:00
srdjan@google.com a54f33bf92 ICData is now a wrapper object that refers to the calling function, target name, ic data array, etc. The old ICData C++ class that wrapped around an Array is removed. The advantage is that the ICData object remains the same, only its ic_data array object is being modified as classes are added..
TODO: store ICData-s into function so that the type feedback can be easily extracted (currently must traverse the unoptimized code).
Review URL: https://chromiumcodereview.appspot.com//9395016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4417 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 00:40:03 +00:00
hausner@google.com 4d3a5f658a Add PC descriptor for ret instruction
Adding a new kind of PcDescriptor to mark the location of
function returns in generated code. This will be needed to
put a single-step breakpoint just before the function return.

Also adding a NOP instruction after the ret, so that the
function return code pattern adds up to 5 bytes, which is needed
to patch in a breakpoint call.
Review URL: https://chromiumcodereview.appspot.com//9385022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4159 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-11 01:02:09 +00:00
srdjan@google.com 1d7d76a43b Optimizing code generator expects that every AST node is traversed once, i.e., the nodes are not reused. Unfortunately this is not the case in assignment operations with arrays (e.g. a[i] += 3).
The proper solution would be to clone array and index nodes but that would require too many changes. Long term we can't / won't use AST nodes for optimization purposes.
Short term fix is here: load array and index and release their CodeGenInfo before value is traversed so that the value computation can set its own CodeGenInfo on the same node.
Review URL: https://chromiumcodereview.appspot.com//9373025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4121 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-10 08:30:53 +00:00
srdjan@google.com 4b3a6e1e57 Fixed a bug in isNegate intrinsified code, fixed negation for doubles (handling of negative zeros). Added tests. Fix issue 1554.
Factored out parts of X86Decoder::InstructionDecode in order to satisfy lint (500 lines max per function).
Review URL: https://chromiumcodereview.appspot.com//9338002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3971 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-06 22:16:44 +00:00
srdjan@google.com df94bc5fa5 Use inlined double temporary object for unary operation, add tests. Fix disassembler crash.
Review URL: https://chromiumcodereview.appspot.com//9297026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3666 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 21:04:12 +00:00
srdjan@google.com 71dbd99c77 Fix a perfrormance degradation in Mandelbrot: double comparison may have
left and right temporary objects.
Review URL: https://chromiumcodereview.appspot.com//9225008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3660 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 16:54:14 +00:00
srdjan@google.com 81698d0ad7 Allocate inlined temporary double objects only if the parent node supports it;
fixes bug http://b/issue?id=5903071
More optimizations can be added later.
Review URL: https://chromiumcodereview.appspot.com//9288086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3639 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 01:14:47 +00:00
iposva@google.com 731616c7d3 - Remove support for ">>>" operator.
Review URL: http://codereview.chromium.org//9203004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3279 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-13 09:10:48 +00:00
srdjan@google.com a1bf722c78 Do back propagation of types(classes) for checks in load and store indexed.
Review URL: http://codereview.chromium.org//9022019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2793 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-22 23:27:21 +00:00
srdjan@google.com 1fe386517a Propagate more local variable types: if a load local is followed by a deoptimizationtype check, set the local to have that type from now on.
Review URL: http://codereview.chromium.org//9025025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2788 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-22 21:41:26 +00:00
srdjan@google.com d4e8bf34dc More optimizations.
Review URL: http://codereview.chromium.org//8999031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2739 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-22 01:12:59 +00:00
srdjan@google.com 884228569f More optimizations: in binary operations check sometimesnnn for two classes instead of one; call some target operators directly (checked call) instead of via inline cache call; allow smi/double binary operations to be inlined.
Review URL: http://codereview.chromium.org//8995019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2732 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-21 22:46:01 +00:00
srdjan@google.com 74c0af9144 Optimize indexed store for growable array (intrinsification and inlined optimized).
Review URL: http://codereview.chromium.org//9020030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2731 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-21 22:37:21 +00:00
srdjan@google.com 0e435be09c Add (debug) printing when IC is used in optimized code (must eliminate it).
Do Smi binary op only on two Smi-s.
Increase deopt counter limit to 5., which still may be too low. Deopt counter is here mainly to prevent drastic performance degradations because of bugs or missing implementations.
Review URL: http://codereview.chromium.org//9007027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2673 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-20 22:05:41 +00:00
srdjan@google.com 9fe955e406 Fix a bug in intrinsified Array_setIndexed type check.
Optimize unary double operation negate.
Review URL: http://codereview.chromium.org//8996024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2611 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-20 02:11:18 +00:00
srdjan@google.com d525130469 More optimizations and cleanups.
Review URL: http://codereview.chromium.org//8972005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2548 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-16 23:16:00 +00:00
turnidge@google.com 0b833d4977 Add support for interrupting an isolate in the vm. Interrupts are
implemented by extending the existing support for stack overflow
checking in the vm.  When an interrupt is scheduled for an isolate, we
overwrite the isolate's stack limit with a value guaranteed to cause a
stack overflow.

We support multiple kinds of interrupts, encoded in the low bits of
the stack limit.

Add Dart_InterruptIsolate and Dart_InterruptIsolateCallback to the
dart embedding api to allow the embedder to request and handle
interrupts.

Add EXPECT_SUBSTRING(needle, haystack) testing macro.
Review URL: http://codereview.chromium.org//8851008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2529 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-16 18:41:20 +00:00
srdjan@google.com bdb48aefb4 Use deopt on some instructions that have not collected type feedback when optimizing compierl kicks in. Optimize SAR.
Review URL: http://codereview.chromium.org//8972002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2487 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-15 22:39:21 +00:00
srdjan@google.com a3f519eacc Optimize instance setters for non-implicit-setters and for setters with multiple targets.
Review URL: http://codereview.chromium.org//8945002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2451 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-15 00:46:27 +00:00
srdjan@google.com e48749760e Fix truncate divide bug (reported by sra) when dividing MIN_SMI by -1.
Review URL: http://codereview.chromium.org//8931016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2409 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-14 01:18:12 +00:00
srdjan@google.com 76f7132369 Optimize truncated divide (intrinsics and inline).
Review URL: http://codereview.chromium.org//8934010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2397 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-13 21:09:13 +00:00
srdjan@google.com f1198ffe5e Added type propagation from store to load locals, but only within a sequence node (not across basic block).
Review URL: http://codereview.chromium.org//8919025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2365 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-13 01:11:28 +00:00
srdjan@google.com 46748dc6b1 Allocate double temporaries in old space, because they belong there. Canonicalize more double literals.
Review URL: http://codereview.chromium.org//8921012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2351 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-12 18:59:20 +00:00
srdjan@google.com 7b61cef42b Implement two-arguments-check inline cache. Use it first for Smi binary operations.
Review URL: http://codereview.chromium.org//8827015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2345 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-12 17:24:47 +00:00
regis@google.com 809cd5590a Helper ast node sequences must not wrongly grab ownership of the enclosing
scope (fix issue 736).
Add test.
Review URL: http://codereview.chromium.org//8893008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2324 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-09 21:32:14 +00:00
srdjan@google.com 8b6d22348d Fix crash from issue 744: evaluate left first before deopt happens (strict comparison).
Review URL: http://codereview.chromium.org//8873044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2295 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-09 01:44:10 +00:00
srdjan@google.com 35faa6aaa9 Move more nodes to the optimizing code generator.
Review URL: http://codereview.chromium.org//8678033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1829 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-24 01:14:15 +00:00
srdjan@google.com b7612781f5 Fix crash reported by Florian.
Review URL: http://codereview.chromium.org//8665008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1774 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 01:37:18 +00:00
srdjan@google.com 7397762688 Better tracing of deoptimization (added a reason id and printing of source). Fix a bug with excessive deoptimization for null receiver -- caused by (null).toString().
Review URL: http://codereview.chromium.org//8588002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1593 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-16 23:38:05 +00:00
srdjan@google.com dcdbc97919 Intrinsify StringBase.isEmpty and inline StringBase.get:length.
Review URL: http://codereview.chromium.org//8526005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1419 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-10 19:33:25 +00:00
srdjan@google.com d052449ae8 Fix issue 5564152 (VM crash): stack at exit of method was incorrect. Smi equality with Mint was calling operator ==, the result was pushed instead of evaluated to either push a boolean object or to jump to a label.
Review URL: http://codereview.chromium.org//8451010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1167 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-03 21:45:00 +00:00
srdjan@google.com cb82be7b44 Restructure instance setter and finish the last 1/3 of increment instance field optimization.
Review URL: http://codereview.chromium.org//8439059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1159 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-03 18:37:44 +00:00
srdjan@google.com 67cee5e5d2 Intrinsify String.charCodeAt, String.length and String.hashCode. Improves frog performance by 2x.
Review URL: http://codereview.chromium.org//8440051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1120 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 20:42:23 +00:00
srdjan@google.com aa4ec58426 Optimize 2/3 of instance field increment operation.
Review URL: http://codereview.chromium.org//8439023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1097 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 16:20:58 +00:00
antonm@google.com f05150594a Proper reg for deoptiomization.
EAX may get overwritten by the operation.  Original value can be restored from ECX.

Review URL: http://codereview.chromium.org//8430007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@958 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-31 17:49:28 +00:00
srdjan@google.com 002bb47821 Special code for equality comparison for Smi, allowing null on left or right without calling deoptimization. The full solution is to implement two arguments type feedback collection (maybe also collect null classes for
equality comparison?)
Review URL: http://codereview.chromium.org//8413047

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@923 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-28 22:25:05 +00:00
srdjan@google.com 5acfab56ba Restructure instance calls in optimizing compiler with the goal of eliminating all remaining inline cache calls in optimized code.
Review URL: http://codereview.chromium.org//8404009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@835 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-27 15:19:27 +00:00
srdjan@google.com ffaec5255d Store IC data instead of array of classes in AST node, so that we can easier access targets and future multi-check IC data.
Review URL: http://codereview.chromium.org//8394061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@770 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-26 18:47:17 +00:00
srdjan@google.com 4aa5564622 Handle bug 5442338: PCDescriptors generated wrongly, disallowing optimizations, causing assert failures in debug. Fixed also assembly code generation in optimized code (a jumbo could be far). The test code from bug 5442338 can run now successfully.
Review URL: http://codereview.chromium.org//8240005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@376 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-12 20:04:19 +00:00