Commit graph

41959 commits

Author SHA1 Message Date
Zachary Anderson c1313a5ec7 Format GN files and add a presubmit check that GN is properly formatted
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2451613005 .
2016-10-26 08:50:54 -07:00
Zachary Anderson e3f1794ba3 GN: Fix dart_bootstrap build
Makes sure we are using the no_snapshot variants of the libraries,
that we get builtin.cc instead of builtin_nolib.cc, and that all of
the right library sources get built in.

fixes=27668

R=vegorov@google.com

Review URL: https://codereview.chromium.org/2449223004 .
2016-10-26 08:24:23 -07:00
Vyacheslav Egorov 12968edb9c Revert "Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork.""
This reverts commit 4e7a31262e.

Windows bots are broken now.

R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2451893004 .
2016-10-26 17:07:18 +02:00
Zachary Anderson 1ed9dc3ac0 GN: Fix arm cross build to match gyp build
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2456463003 .
2016-10-26 07:58:42 -07:00
Vyacheslav Egorov 16e4f2f1c2 Revert "Revert "Revert "Recognize and optimize a.runtimeType == b.runtimeType pattern."""
This reverts commit e495e100dd.

Commit breaks bots that are using Android devices (SIMARM is unaffected).

R=rmacnak@google.com
BUG=

Review URL: https://codereview.chromium.org/2449013004 .
2016-10-26 16:53:32 +02:00
Vyacheslav Egorov 4e7a31262e Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork."
This relands commit 2fed1c3905 with fixes to ensure that analyzer summaries are correctly created and XARM build does not try to use target binaries on the host.

R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2453773002 .
2016-10-26 16:48:28 +02:00
Konstantin Shcheglov f797154673 Fix for LibraryDirective annotations while applying resynthesized element model.
This allows us to clean up the analysis driver.

I will NOT land this without your review.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2445193003 .
2016-10-26 07:40:07 -07:00
Lasse R.H. Nielsen 22a57bbe2c Adapt analyzer to new warnings around switch-case fallthrough.
Fixes issue #27664.
BUG= http://dartbug.com/27664
R=brianwilkerson@google.com

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

Committed: 1322877f5b
Committed: 1f7d8924c6
Committed: 9c2306c7dc
2016-10-26 14:03:14 +02:00
Vyacheslav Egorov cf7ff42e60 Revert "Merge more Kernel infrastructure from kernel_sdk SDK fork."
This reverts commit 2fed1c3905.

SDK builds are failing

TBR=zra@google.com

Review URL: https://codereview.chromium.org/2455593002 .
2016-10-26 13:06:27 +02:00
Vyacheslav Egorov 2fed1c3905 Merge more Kernel infrastructure from kernel_sdk SDK fork.
- bring patched SDK generation scripts and VM patch tweaks that allow VM patch files to be parsed by analyzer front-end;
  Patched SDK is an SDK with all VM patches spliced into it. Kernel compiler is based on the analyzer front-end which does
  not have any patch files support/model so for it to produce Kernel files that match VM we need to generate a such patched SDKs.

- bring test script modifications that allow to test Kernel pipeline

BUG=
R=asiva@google.com, kmillikin@google.com, whesse@google.com, zra@google.com

Review URL: https://codereview.chromium.org/2434123003 .
2016-10-26 13:02:54 +02:00
Lasse R.H. Nielsen 9c2306c7dc Adapt analyzer to new warnings around switch-case fallthrough.
Fixes issue #27664.
BUG= http://dartbug.com/27664
R=brianwilkerson@google.com

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

Committed: 1322877f5b
Committed: 1f7d8924c6
2016-10-26 12:56:54 +02:00
Vyacheslav Egorov e495e100dd Revert "Revert "Recognize and optimize a.runtimeType == b.runtimeType pattern.""
This reverts commit 890f694de5.

Previous commit was passing field_type_map_ down in a place where it was not passed down before.

This caused some handles to be used across zones, which caused crashes.

BUG=

Review URL: https://codereview.chromium.org/2453463006 .
2016-10-26 12:25:48 +02:00
Lasse R.H. Nielsen 1f7d8924c6 Adapt analyzer to new warnings around switch-case fallthrough.
Fixes issue #27664.
BUG= http://dartbug.com/27664
R=brianwilkerson@google.com

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

Committed: 1322877f5b
2016-10-26 11:30:55 +02:00
Lasse R.H. Nielsen 1322877f5b Adapt analyzer to new warnings around switch-case fallthrough.
Fixes issue #27664.
BUG= http://dartbug.com/27664
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2446093003 .
2016-10-26 10:51:50 +02: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
Lasse R.H. Nielsen 1d4657f3d4 Add test for warning-conditions around switch cases.
Only tested on analyzer.

R=eernst@google.com

Review URL: https://codereview.chromium.org/2446923003 .
2016-10-26 09:02:58 +02:00
Konstantin Shcheglov fcce68e2df Analyze priority files first.
TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2453693002 .
2016-10-25 21:44:48 -07:00
Konstantin Shcheglov d59c39fee5 Verify one changed file at a time.
TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2446083003 .
2016-10-25 21:16:56 -07:00
Konstantin Shcheglov d1636b38b3 Replace Stream with monitor.
TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2450053003 .
2016-10-25 20:00:20 -07:00
Konstantin Shcheglov 3d730e3735 Fix and simplify _File creation.
TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2451973002 .
2016-10-25 18:34:19 -07:00
Ryan Macnak 890f694de5 Revert "Recognize and optimize a.runtimeType == b.runtimeType pattern."
This reverts commit f4ec20abac.

Revert "Use ZoneHandle when creating ConstantInstr"

This reverts commit cb87f2d82f.

This change introduced crashes on AOT and runtime errors on the GN SDK build.

TBR=vegorov@google.com

Review URL: https://codereview.chromium.org/2451893002 .
2016-10-25 13:19:33 -07:00
Zachary Anderson 624675349a Stub out Socket::LookAddress on Fuchsia
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/2446343002 .
2016-10-25 13:07:23 -07:00
Konstantin Shcheglov b363f00d64 Move unlinked bundle access to _File itself.
TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2451733003 .
2016-10-25 11:21:40 -07:00
Konstantin Shcheglov 4a5d98fa37 Actually compute AnalysisResult(s).
For now we don't have state transitioning and perform all work in a
single loop. Later we will break the loop and wait for the "has work"
stream after each operation. BTW, I don't like this stream approach,
but I don't know yet anything better.

The promise to produce the resolved CompilationUnit for every added
file does not scale well for initial results. I want to weaken it to the
promise that only priority and getResult() results get full content/unit.
For all other files we need only errors, which can be cached.

For index we need to use another apporach. I have a plan :-)

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2446803003 .
2016-10-25 09:49:13 -07:00
Ryan Macnak e109c9bb0e Change build.py to invoke gn with '--check' to match the build bot's script and Flutter's usage.
R=zra@google.com

Review URL: https://codereview.chromium.org/2449503002 .
2016-10-25 09:43:37 -07:00
Regis Crelier 3342380ff8 Avoid parsing formal type parameters a second time from inside an async body,
as default values may not be resolved correctly and may conflict with already
parsed formal parameters (fixes #27659).
Added regression test.

R=hausner@google.com

Review URL: https://codereview.chromium.org/2452623002 .
2016-10-25 08:11:37 -07:00
Regis Crelier 6418f8f36c Create runtime type in new space and canonicalize to old space (fixes #27663).
R=asiva@google.com, hausner@google.com

Review URL: https://codereview.chromium.org/2452563002 .
2016-10-25 04:56:49 -07:00
Stephen Adams 7eaad70e2f Improve condition strengthening for last test in short-circuit.
This strengthens

   t1 = s == null || t == null;
   if (t1) return;
   known-here:  t != null

There are not many hits since the 'interesting' tests are usually
earlier in the short-circuit expression.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2438543004 .
2016-10-25 04:48:35 -07:00
Lasse R.H. Nielsen 6e6ff496ed Allow rethrow to end a switch case. Allow braces around switch cases.
Add `rethrow` as one of the statements that are allowed to end a switch case
without a warning.
Change wording to not claim that `throw` is a statement.
Also allow wrapping case statements in a block statement without causing
more warnings. Currently, a `case 4: { break; }` is required to warn because
the last statement is a block statement, not a break statement.

Fixes issue #27650
BUG= http://dartbug.com/27650
R=eernst@google.com, floitsch@google.com, rnystrom@google.com

Review URL: https://codereview.chromium.org/2447613003 .
2016-10-25 13:04:36 +02:00
Vyacheslav Egorov cb87f2d82f Use ZoneHandle when creating ConstantInstr
BUG=
TBR=fschneider@google.com

Review URL: https://codereview.chromium.org/2446093002 .
2016-10-25 11:15:14 +02:00
Vyacheslav Egorov f4ec20abac Recognize and optimize a.runtimeType == b.runtimeType pattern.
Start by removing all get:runtimeType overrides in the patch files to have a single point computing the runtime type - Object.get:runtimeType. Handle string, double and integer types inside both intrinsic and runtime call to unify their handling and guarantee that code works even with intrinsifier disabled.

With overrides removed we can easily check that get:runtimeType is unique function name within the application that is being precompiled and use that to convert InstanceCall(get:runtimeType, ...) into StaticCall even nothing is known about the receiver.

This enables us to check if both left side and right side of comparison are StaticCall(Object.get:runtimeType, ...) when specializing InstanceCall(==, x, y). If they are we convert InstanceCall(==, StaticCall(get:runtimeType, a), StaticCall(get:runtimeType, b)) into StaticCall(Object._hasSameRuntimeType, a, b). A canonicalization rule will later delete unused get:runtimeType invocations.

Object._hasSameRuntimeType is implemented in C++ and intrinsified. It operates without creating new runtime types (except for Closures - where it does for simplicity). Cases of different class ids (i.e. a.[cid] != b.[cid]) and non-parameterized types are handled completely in the intrinsic. The rest is handled in the runtime code.

Microbenchmarking results:

Same parameterized classes: 15x improvement
Different parameterized classes: 300x improvement
Different/same non-parameterized classes: 2x improvement

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

Review URL: https://codereview.chromium.org/2379733002 .
2016-10-25 10:03:06 +02:00
Konstantin Shcheglov 581e6bc6e1 Extract _ReferencedUris information from UnlinkedUnit.
I considered removing it altogether, but reading unlinked bundles costs
something. So, we might consider caching this graph information.

OTOH, I agree that we might want to delay adding caching until we solve
the extra invalidation problem in _verifyUnlinkedSignatureOfChangedFiles.

TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2447903002 .
2016-10-24 14:05:45 -07:00
Konstantin Shcheglov d2347b6903 Exclude the file URI from _ReferencedUris.
Also fix a bug with adding bundles with the same content hash, but
different URIs. Add directly into the corresponding Map(s) for now.

TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2447873002 .
2016-10-24 13:13:43 -07:00
Konstantin Shcheglov a42e0e94d8 Delay invalidating linked hashes until after checking the API signature of the changed file.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2443083002 .
2016-10-24 12:16:07 -07:00
Konstantin Shcheglov b7c412c672 Apply tweaks to address other review comments.
TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2444993003 .
2016-10-24 10:55:46 -07:00
Konstantin Shcheglov 795be1983a Fixes for review comments.
TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2450483002 .
2016-10-24 10:23:11 -07:00
William Hesse 057b9ceba7 Update pkgbuild status for analyzer and front-end.
BUG=https://github.com/dart-lang/sdk/issues/27655
BUG=https://github.com/dart-lang/sdk/issues/27654
R=sortie@google.com

Review URL: https://codereview.chromium.org/2440423002 .
2016-10-24 13:37:10 +02:00
Florian Loitsch 6bc6ea34b5 Use different bug-number for skipped test.
BUG=

Review URL: https://codereview.chromium.org/2442203003 .
2016-10-24 10:56:24 +02:00
Vijay Menon a7f53aca4d Mark canary as failing
Looks like a test (audiocontext) is behaving different on stable vs canary.

TBR=jmesserly@google.com,alanknight@google.com

Review URL: https://codereview.chromium.org/2444773003 .
2016-10-24 09:10:36 +02:00
vsmenon 2cafc4d044 Update README.md 2016-10-24 09:01:50 +02:00
Konstantin Shcheglov e0563e7dbd Remove unused code.
TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2440363002 .
2016-10-23 23:48:01 -07:00
Konstantin Shcheglov 6ca7d24211 Cache URIs resolution.
TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2440343002 .
2016-10-23 21:34:20 -07:00
Konstantin Shcheglov 64c776d30d Include linked hashes into the current file state.
Also put the file content into the AnalysisContext to avoid race
condition if the file content is being changed.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2447603002 .
2016-10-23 20:59:38 -07:00
Konstantin Shcheglov e7b596ce5b Initial implementation of AnalysisDriver.
I will need to add more documentation, implement state transitions,
actually implement computing analysis results, add optimizations, etc.

TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2439343002 .
2016-10-23 20:08:04 -07:00
Konstantin Shcheglov f275b096c2 Update ByteStore documentation.
TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2445623002 .
2016-10-23 15:30:32 -07:00
Konstantin Shcheglov 46aa3ced6f Update the API documentations with Paul review comments.
TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2443013002 .
2016-10-23 13:55:54 -07:00
Konstantin Shcheglov c3e7be4f12 API for the new AnalysisDriver.
TBR

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2442993002 .
2016-10-22 20:12:29 -07:00
Zachary Anderson c39525802e GN: Fix build
GN is unhappy when a rule that consumes a file generated by
another rule doesn't depend directly on that rule.

This change also quiets output from invoking Dart to follow the
rule of GN builds that a successful build generates no output.

Review URL: https://codereview.chromium.org/2446473002 .
2016-10-22 00:05:39 -07:00
Zachary Anderson c9537f56e4 runtime: Use Linux timezone implementation on Fuchsia
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/2435273003 .
2016-10-21 23:42:07 -07:00
Ryan Macnak af7bf4dab0 GN: Build the SDK with app snapshots instead of script snapshots.
R=zra@google.com

Review URL: https://codereview.chromium.org/2442513003 .
2016-10-21 17:40:21 -07:00