Commit Graph

16 Commits

Author SHA1 Message Date
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Zachary Anderson 103881d01c Make header include guards great again
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER

This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.

R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/2450713004 .
2016-10-26 00:26:03 -07:00
koda@google.com 9c181ec6d5 Thread/Isolate refactoring: new(Isolate*) -> new(Zone*)
Refactor all remaning cases where the current zone is used through new(Isolate*) and remove this interface.

Removing this interface is needed to move towards multiple threads per isolate, and also makes the caller more aware of the scope of the zone used, reducing the risk of use-after-free.

Make the current thread and the stack zone created around native/runtime entries directly available in their body, saving an indirection (and optimized away if unused).

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44541 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-17 19:24:26 +00:00
vegorov@google.com 094e899972 Fix Range::Mul for fully non-positive ranges.
BUG=http://dartbug.com/22541
R=fschneider@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44046 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-26 12:40:55 +00:00
vegorov@google.com 4a5d1bc80d Improve bitwise OR, AND ranges by using the same approximation we use for XOR.
BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42258 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 18:36:37 +00:00
vegorov@google.com 8f7f26c0a4 Reland "Suppress canonicalization of Unbox() instruction that can deoptimize."
This relands commit r41693 with additional fixes in canonicalization pass.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41736 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-14 11:19:42 +00:00
vegorov@google.com 29f021439a Infer range for BIT_XOR.
When selecting representations unbox integer phis that have Int32 range and have only constants or boxing operations flowing into them.

BUG=http://dartbug.com/13869
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41667 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-11 14:51:10 +00:00
vegorov@google.com 0a8e45ae35 Improve precision of range analysis by allowing it to track ranges across all int typed phis.
Even when range of the integer definition is unknown we can optimistically assign full int64-range to it even though tagged integer definition can contain instance of the Bigint. This is based on the following observation: we only use ranges when working with unboxed arithmetic in the optimized code, but the widest possible unboxed arithmetic is 64-bit (mint) one and corresponding unboxing operations will deoptimize if they get Bigint as an input. This makes it safe to assume that any integer definition fits into 64-bit range *once unboxed*.

Additional small fixes:

- Fix ranges assigned to loads from Int32/Uint32 arrays on 64-bit platform - it was overly conservative;

- Add UnboxUint32 range inference to ensure that range is not lost when it passes through box-unbox pair;

- When canonicalizing Binary/Unary Integer operations ensure that we unwrap UnboxUint32(Constant(C)) -> C.

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41640 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-10 17:16:14 +00:00
vegorov@google.com e6113cc0f5 If bounds check 0 <= index < length is not redundant we attempt to
replace it with a sequence of checks that guarantee

          0 <= LowerBound(index) < UpperBound(index) < length

and hoist all of those checks out of the enclosing loop.

Upper/Lower bounds are symbolic arithmetic expressions with +, -, *
operations and are computed based on discovered simple induction variables.

Simple induction variable is a variable that follows the pattern v1 <- phi(v0, v1 + 1)

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40969 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 18:50:29 +00:00
vegorov@google.com c8e5382693 Address review comments for r39595.
R=srdjan@google.com, srdjan@googe.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39697 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-29 11:36:11 +00:00
vegorov@google.com 9f9e250e92 Support Int32 representation for selected binary operations.
BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39595 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 14:49:19 +00:00
vegorov@google.com a8e81404e7 Don't check for reaching type in the RangeAnalysis::GetRange.
Canonicalizer rewrites

v1 = _Int32Array._new(v0)
v2 = v1.length
use(v2)

as

v1 = _Int32Array._new(v0)
use(v0)

without changing reaching type of v0 to Smi at the use.

This means right now we can't expect that uses at Smi operations have propagated smi type.

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39331 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-18 15:04:46 +00:00
vegorov@google.com 336dbd4cbf Reland r39293.
Switch to a fix-point based range analysis to improve its precision.

Dominator based algorithm was very imprecise for loop phis.

Use widening to ensure fast convergence and narrowing to improve precision.

Fixed compared to r39293:

Type propagation is more sophisticated now compared to the time
when range analysis was originally implemented and is able to derive Smi-ness
from more than just CheckSmi instruction (e.g. GuardFieldClass). This creates
situations when use's reaching type is Smi but definition itself is not a Smi
and thus will never have range assigned to it.

It is incorrect to treat ranges of such uses as unknown (_|_), because unknown
means "not yet computed". Instead we must use the widest possible approximation:
full smi range.

InferRange methods were rewritten to use a newly introduced GetRange helper
instead of accessing value()->definition()->range() directly.

As a side-effect we no longer need to insert artificial constraints after CheckSmi instructions.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39327 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-18 11:06:27 +00:00
vegorov@google.com f2c3859068 Revert "Switch to a fix-point based range analysis to improve its precision."
This reverts r39293.

The dart2js part of the tree is on fire.

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39296 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-15 15:44:31 +00:00
vegorov@google.com 2b42387699 Switch to a fix-point based range analysis to improve its precision.
Dominator based algorithm was very imprecise for loop phis.

Use widening to ensure fast convergence and narrowing to improve precision.

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39293 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-15 15:29:31 +00:00
vegorov@google.com 1acb21443f Consolidate all range analysis related code in a separate file.
This makes working with it easier, similar to how we have all type propagation code in flow_graph_type_propagator.{cc,h}

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38928 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-06 12:43:49 +00:00