Commit Graph

9232 Commits

Author SHA1 Message Date
Ivan Posva 7b75f2dbb7 - Allow specifying of package: URIs for packageConfig and packageRoot when
spawning a new isolate.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1586653003 .
2016-01-14 08:20:59 -08:00
Ryan Macnak 5579786161 Don't suppress compile-time errors when inlining.
When precompiling, it is possible to encounter a compile-time
error when inlining because the target never went through unoptimized
compilation or optimized compilation where it was the root function. Some checks
for compile-time errors are not idemponent because have they have
side-effects: in particular, the checks for a cyclic redirecting factory or
const expressions that have a runtime error may not trigger the second
time they are parsed.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1568613007 .
2016-01-13 17:10:48 -08:00
Siva Annamalai 8359b9e20c Do not include resolved_names_ and loaded_scripts_ consistently in both the full and script snapshots. Initialize the resolved names cache correctly in both cases when reading the snapshot.
This reduces the isolate snapshot size from 255324 to 249714.

R=hausner@google.com

Review URL: https://codereview.chromium.org/1588783002 .
2016-01-13 16:42:29 -08:00
Ryan Macnak 2ebe6f459e VM: Don't do free("") in shutdown when we can't find the cpu model field in /proc/cpuinfo.
Also fix field names of /proc/cpuinfo for Linux ARM64.

BUG=http://dartbug.com/25424
R=zra@google.com

Review URL: https://codereview.chromium.org/1586663005 .
2016-01-13 16:37:29 -08:00
Regis Crelier ca1d105c5a Fix finalization of recursive type graph with bounds (issue 25389).
Add regression test.
Rename malformed_error to bound_error.
Fix internal name of bounded type (broken by a previous cl).

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1580643004 .
2016-01-13 11:19:14 -08:00
Zachary Anderson ebbd05a8b2 Marks spawn_shutdown_test Pass, Slow for debug builds.
The test is timing out on the Debug windows bot, but always finishes for
me locally even under load. If it continues to timeout even when marked
Slow, I will investigate more locally.

R=asiva@google.com

Review URL: https://codereview.chromium.org/1585733002 .
2016-01-13 10:38:39 -08:00
Zachary Anderson 6c8a3e0053 Restore IsolateData destructor
Shutdown is turned on, and the race on IsolatData
deletion has been fixed, so this should be safe
to re-enable.

R=iposva@google.com

Review URL: https://codereview.chromium.org/1581443002 .
2016-01-13 10:12:49 -08:00
Ivan Posva 6d066c7e53 Add package config support to dart:isolate
- Add "static Future<Uri> get packageRoot;",
  "static Future<Uri> get packageConfig;" and
  "static Future<Uri> resolvePackageUri(Uri packageUri)" to Isolate class.
- Added "Uri packageRoot, Uri packageConfig, bool automaticPackageResolution: false" parameters to spawnUri.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1553233002 .
2016-01-12 18:19:04 -08:00
Ryan Macnak 80702cb272 Fall back to inlining intervals to generate stack traces in --noopt. Inlined frames will lack line and column positions, but they will at least be expanded.
Fix stack traces when visible functions are inlined into an invisible function.

Fix off-by-one expanding inlined functions in the profiler.

BUG=http://dartbug.com/24783
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1582683003 .
2016-01-12 16:45:00 -08:00
John McCutchan bda2b3d2ff Source position tests for switch and try catch finally
- Give AwaitMarkerNode a token position.
- Make it possible to provide a token position for SaveContext, RestoreContext, StoreContext, and CurrentContext.
- Pass in a token position to internally generated StoreLocal and LoadLocal instructions for try-catch-finally.
- Introduce a Context ClassifyingTokenPosition to be used when we can't attribute a context related instruction to a source position.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1575953005 .
2016-01-12 15:02:35 -08:00
Siva Annamalai 797c69bacf Fix race in Debug_InterruptIsolate which results in the following crash:
stderr:
runtime/vm/os_thread_linux.cc:258: error: pthread error: 22 (Invalid argument)

R=hausner@google.com

Review URL: https://codereview.chromium.org/1582683002 .
2016-01-12 13:50:00 -08:00
John McCutchan e51dc673ba Fix SourcePosition_IfElse test
Some column positions were off by 2.

Review URL: https://codereview.chromium.org/1585433002 .
2016-01-12 13:17:32 -08:00
John McCutchan 958e713f5e Use classifying token position for control flow IR instructions
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1574363002 .
2016-01-12 12:52:02 -08:00
Ryan Macnak 2cec39657a Precompilation: Use smaller values for inlining_constant_arguments_max/min_size_threshold.
dart2js ARM precompiled snapshot: 25087606 => 24608537 (-1.91%)
--noopt benchmarks: geom mean -0.11% (ARM Cortex A53)

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1579793002 .
2016-01-12 12:49:55 -08:00
Ryan Macnak 87eae28239 Fix simarm and simmips builds on Mac.
Broken by a7ebeb00fb.

R=asiva@google.com

Review URL: https://codereview.chromium.org/1574393002 .
2016-01-12 12:47:26 -08:00
Todd Turnidge 97a7db5a71 typo: association -> associations
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1578703003 .
2016-01-12 10:31:47 -08:00
Matthias Hausner 0964f26d24 Add flag to make await and yield keywords
Using --await_is_kw forces the parser to treat await and yield as keywords even in synchronous code.

BUG=
R=iposva@google.com, zra@google.com

Review URL: https://codereview.chromium.org/1573153003 .
2016-01-12 09:52:51 -08:00
Siva Annamalai 2a1d4234ef Do not allow creation of signature classes in the background compilation path until we have the fix from regis to not use signature classes.
R=fschneider@google.com, regis@google.com

Review URL: https://codereview.chromium.org/1579583003 .
2016-01-12 08:53:57 -08:00
Vyacheslav Egorov 8ea0f17289 Add more dart:io related precompilation roots.
File, Directory, Link and FileSystemException are allocated by the runtime code.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1579643005 .
2016-01-12 14:14:50 +01:00
John McCutchan 903709eb97 More source position tests
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1575193002 .
2016-01-11 14:18:22 -08:00
Chinmay Garde f85c015ccd Fix iOS implementation of |GetCurrentMonotonicMicros|.
Fixes regression introduced in dd4ef29098

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1571343003 .
2016-01-11 13:21:46 -08:00
John McCutchan 768e4ddee7 Add --check-code-pointer flag for debug builds
- Introduce --check-code-pointer which is false by default.
- Sort DECLARE / DEFINE flag macros in assembler*.cc

Fixes #25361

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1574993003 .
2016-01-11 13:20:13 -08:00
Siva Annamalai a0fedf3879 1. Add code to grow the heap instead of collecting garbage in Heap::AllocateOld when allocation is done by a non mutator thread which is at a safepoint. Garbage collection is triggered after the safepoint is done.
2. Add code to avoid multiple garbage collection requests on different threads to sync up and allow only one request to proceed at a time, other requests wait for this garbage collection request to be done and then proceed to allocation once the request is done.

R=iposva@google.com

Review URL: https://codereview.chromium.org/1562853003 .
2016-01-11 11:00:59 -08:00
Zachary Anderson 963946af00 Disable TLS destructors on Windows before calling abort() for an ASSERT.
This fixes some flaky failures and timeouts on Windows in tests where
an ASSERT fails.

This change requires Using OS::Abort in platform/assert.cc so that the
flag disabling tls destructors can be set.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1572913002 .
2016-01-11 10:35:00 -08:00
John McCutchan 3ca0a08117 More source position improvements and tests
- Provide source positions for some ConstantInstrs.
- Classify all other ConstantInstrs.
- Use the token position of ++ rather than x in the expr: "x++;" for the add, constant 1, and final load operations.
- More tests
- Improvements to the test helpers.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1576583003 .
2016-01-11 10:19:08 -08:00
Ryan Macnak 43d93de2eb ARM64: Move THR to R26 so special registers are contiguous.
R=regis@google.com

Review URL: https://codereview.chromium.org/1575583002 .
2016-01-11 10:11:15 -08:00
Matthias Hausner 4ffdcb76df Eliminate phase parameter in constructors
Super initializer calls get implicitly moved to the end of the initializer list, so we don't need the two-phase constructor protocol anymore.

Ryan, can you please look at the mirror changes and check wether I've missed something?

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

Review URL: https://codereview.chromium.org/1569213003 .
2016-01-08 15:41:51 -08:00
John McCutchan 2dada05646 Fix clang build failures
BUG=

Review URL: https://codereview.chromium.org/1569413002 .
2016-01-08 13:38:49 -08:00
John McCutchan c64d073174 Add ClassifyingTokenPositions
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1574433003 .
2016-01-08 13:34:40 -08:00
Zachary Anderson 1ce512b69f Fix Shutdown race.
This CL fixes a race during VM shutdown in which the embedder's
isolate creation callback is passed an invalid isolate data pointer.

BUG=http://dartbug.org/25351
R=asiva@google.com

Review URL: https://codereview.chromium.org/1560853002 .
2016-01-08 12:30:57 -08:00
John McCutchan 789ed02b39 Don't test directly against Scanner::kNoSourcePos instead use >= 0.
A follow up CL will introduce new sentinel token positions that are < Scanner::kNoSourcePos (-1)

Gazoo

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1568353002 .
2016-01-08 12:20:24 -08:00
John McCutchan bb62d81011 Start testing source positions in flow graph
- Introduce SourcePositionTest helper class with ::InstanceCallAt and ::FuzzyInstructionMatchAt utility methods.
- Test one function

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1566163003 .
2016-01-08 11:09:44 -08:00
Ryan Macnak 9328d724f8 Precompilation:
- When using --compile_all + --noopt, run Dart_CompileAll before Dart_Precompile to avoid skipping functions dropped by Precompile / asserting out on functions retained but uncompiled by Precompile.
 - Fail gracefully when attempting to use more than one of --noopt, --gen_precompiled_snapshot, or --run_precompiled_snapshot.
 - Fix tree shaking roots to include the right VM entry point for creating assertion failures.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1567953002 .
2016-01-08 10:19:14 -08:00
Zachary Anderson 97158fed8c Adds strict compilation flags to Dart_IsolateFlags
Also removes the API call for setting these, which is no longer needed.

R=iposva@google.com

Review URL: https://codereview.chromium.org/1569833003 .
2016-01-08 09:54:58 -08:00
Rico Wind 55c7aa561b Print the data we get back from the tcp socket meta data service
We are seeing flakes on win64 with this test

R=sgjesse@google.com
BUG=

Review URL: https://codereview.chromium.org/1565403003 .
2016-01-08 11:46:33 +01:00
Todd Turnidge a283265955 Add the forceCompile param to _getSourceReport.
Deal with some empty ranges that were being emitted.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1562993003 .
2016-01-07 11:33:33 -08:00
Ryan Macnak 642f754219 Note that R19 is a C preserved register, fixing crash returning from the first Dart entry on Linux ARM64.
Bug was introduced by 91bc8005fe.

 - Move the Dart stack pointer from R19 (C preserved) to R15 (C volatile) so it isn't among the registers saved by the InvokeDartCode stub.
 - Set a default cross compiler for ARM64.
 - Use ARM32 instead of IA32 binary to build Observatory on ARM64 hosts.

R=regis@google.com

Review URL: https://codereview.chromium.org/1559223003 .
2016-01-07 09:30:17 -08:00
Vyacheslav Egorov 122722f50b Fix assertion in ConstantPropagator::VisitInstanceOf.
Propagated type doesn't have to match value representation because it is
affected by dominating checks (these checks will always deopt if there is
a mismatch making all subsequent code dead).

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

Review URL: https://codereview.chromium.org/1567023002 .
2016-01-07 16:19:38 +01:00
Vyacheslav Egorov 2306f29cc4 Remove unreachable exits from the list collected by InlineExitCollector.
Otherwise we might crash if we try to inherit a deoptimization target
from an unreachable exit as it was not visited by SSA construction and
has no environments attached to it.

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

Review URL: https://codereview.chromium.org/1563703005 .
2016-01-07 15:21:47 +01:00
Siva Annamalai e31db435f2 Fix build break for the simulator versions.
Review URL: https://codereview.chromium.org/1561423002 .
2016-01-06 21:56:30 -08:00
Siva Annamalai a7ebeb00fb Add a CompareAndSwapUint32 variant to AtomicOperations so that it is possible to a CAS of a 32 bit value.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1562253002 .
2016-01-06 17:08:31 -08:00
John McCutchan a0260c8c24 Add token position to StoreStaticFieldInstr
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1568713002 .
2016-01-06 14:38:54 -08:00
John McCutchan 6e4dcdf879 Add a token position to LoadLocal, StoreLocal, and LoadStaticField instructions
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1569613002 .
2016-01-06 13:29:01 -08:00
Todd Turnidge 61d9752c7e Expose the new _getSourceReport api in the service protocol.
Allow multiple reports to be requested simultaneously.

I'm not exposing this publicly yet -- still nailing down the format a bit.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1566793002 .
2016-01-06 13:01:33 -08:00
John McCutchan 89d05debec Improve token position for the entry CheckStackoverflowInstr
- Have it use the same token position as the DebugStepCheckInstr at entry.
- Add a token pos to ConstantInstr (but it's not really used yet).

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1561833006 .
2016-01-06 11:21:00 -08:00
Florian Loitsch e0fe0c0ed8 Add support for configuration-specific imports to the VM.
R=hausner@google.com, iposva@google.com

Review URL: https://codereview.chromium.org/1380383002 .
2016-01-06 20:16:09 +01:00
Ryan Macnak c4480b6ded More 0 => Scanner::kNoSourcePos.
Arguably method extractors, invoke-field dispatchers and noSuchMethod dispatchers should also have their token position as kNoSourcePos instead of 0, but this would complicate how parser initializes its token iterator, so I'm leaving them as is.

R=hausner@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1566553003 .
2016-01-06 11:12:03 -08:00
Florian Schneider e9968ca5ff Fix VM bug with try-catch inside of try-finally.
There were two exception handlers with the same index added to the code so that only the one added
last was executed. In case of an exception that means that a re-throw may be omitted, causing invalid
control flow.

Also, add assertion to ensure unique try-index for exception handlers.

BUG=#25333
R=hausner@google.com

Review URL: https://codereview.chromium.org/1569523002 .
2016-01-06 18:50:53 +01:00
John McCutchan cb8b641cc9 Make Scanner::kNoSourcePos be a true sentinel value
- It is possible to write a Dart program with a function token_pos of 0.
- Switch Scanner::kNoSourcePos from 0 to -1.

R=hausner@google.com

Review URL: https://codereview.chromium.org/1564493002 .
2016-01-06 09:06:28 -08:00
Florian Schneider 3e3ca58375 Drop precompiler-related code from dart_precompiled binary.
Also drop stub-code generation code, which pulled in large parts of the assembler as well.

This reduces the size of dart_precompiled/libdart_precompiled by around 100K on x64.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1560663002 .
2016-01-06 11:40:43 +01:00