Commit Graph

9080 Commits

Author SHA1 Message Date
Florian Schneider dff13bef8d VM: Fix bug in type propagation at conditionals.
Propagating type/cid at conditional branches is not possible because
it may cause invalid code motion.

For this to be safe we need to explicitly represent the dependency
between checks eliminated in a branch and the condition that constrains the type/cid.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1491373005 .
2015-12-03 21:14:35 +01:00
Ryan Macnak d94b68cb41 Precompilation: Don't drop an uncompiled function if it has a compiled implicit closure function.
This ensures the implicit closure function is enumerated in later steps. Fixes crash in co19 test reducible as

import 'dart:math';
main() {
  print(const [1, 2.0, "3"].fold(0, max));
}

Also enumerate invocation dispatchers to avoid a similar situation there, though I cannot find a crashing example involving them.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1489203004 .
2015-12-03 11:03:23 -08:00
Matthias Hausner 4733386ca8 Reset top-level class finalization
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org/1493533002 .
2015-12-02 09:59:32 -08:00
Ryan Macnak 56239b1476 Use the same clock for the profiler samples and timeline events.
Preparation for overlaying samples in the timeline.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1492653002 .
2015-12-02 09:37:23 -08:00
Srdjan Mitrovic abef5cb3ed Correct overflow check; signed integer overflow is undefined in C++.
BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1490853002 .
2015-12-02 08:45:41 -08:00
Florian Schneider 46f3e7bfe7 VM: Reduce size of AST-nodes vtables.
Make Is## methods of AST nodes non-virtual, like we do for IL instruction nodes.

This saves around 10k in vtables on ia32.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1482153006 .
2015-12-02 13:38:26 +01:00
Florian Schneider dd095404b7 Fix Windows SDK build.
TBR=srdjan@google.com

BUG=

Review URL: https://codereview.chromium.org/1493703002 .
2015-12-02 13:18:06 +01:00
Florian Schneider 59fd6c8397 VM: Small clean up and const-ness fix for Thread/OSThread constants.
BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1482243006 .
2015-12-02 12:30:12 +01:00
Florian Schneider 5f073e7be0 VM: More read-only handles for constant null-objects/-instances.
Use Object::null_## for null-constants where possible.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1488773004 .
2015-12-02 11:36:30 +01:00
Ryan Macnak 6fc5018282 Standalone: Use new support in dart:core for decoding data uris.
R=iposva@google.com

Review URL: https://codereview.chromium.org/1489603002 .
2015-12-01 13:46:20 -08:00
Matthias Hausner 1df143b6b6 Removing an assert that trips after the TL class removal.
I will look into why the assertion fails in a follow-on change.

Review URL: https://codereview.chromium.org/1486923005 .
2015-12-01 13:04:32 -08:00
Ryan Macnak 414dd5d778 Precompilation:
- Weaken check in Dart_New: it is okay to invoke a factory constructor or redirecting constructor of a class that was removed. We only need the class of a generative constructor to have been retained.
 - Fix crash sending two-byte symbols in isolate messages. Only occurs in precompilation because there are no two-byte string literals in the core libraries, and so no type-byte entries in the VM isolate's symbol table.
 - Fix crash getting expression snippet for assertion failures.

R=srdjan@google.com

Review URL: https://codereview.chromium.org/1493433002 .
2015-12-01 12:44:33 -08:00
Zachary Anderson 618d4ee9b7 Thread and Timeline fixes for Mojo.
Creates an OSThread in OSThread::Current() if a thread doesn't
already have one.

Also removes the setup of an unneeded StackZone from a Timeline API
function.

BUG=

Review URL: https://codereview.chromium.org/1483113002 .
2015-12-01 10:52:19 -08:00
Florian Schneider a05ad6111a VM: In CompileAll, don't iterate collected closures for every class
Instead iterate all collected closures at the end. This avoids unnessarily
visiting of the collected closures array and calling Function::Owner.

BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org/1491503003 .
2015-12-01 18:26:33 +01:00
Matthias Hausner ad0f14e0ce Eliminate all but one top-level class per library.
Each script has an associated top-level class in which the top-level functions and fields are stored, and the reference to the script. All other fields in the TL class are unused. There are 380 TL classes in corelib alone; eliminating them saves space.

This CL eliminates all TL classes but one per library. All TL functions and fields in the library are stored in that TL class. Because scripts are not stored directly in functions and fields, but are accessible via their owner class, the owner of TL entities are now PatchClasses, rather than classes.

Before:
Size of vm isolate snapshot = 930813
New space (0k of 0k) Old space (1184k of 1624k)
VM Isolate: Number of symbols : 14909
Size of isolate snapshot = 261873
New space (0k of 2048k) Old space (987k of 1024k)

After:
Size of vm isolate snapshot = 931101
New space (0k of 0k) Old space (713k of 1156k)
VM Isolate: Number of symbols : 14907
Size of isolate snapshot = 256956
New space (0k of 1024k) Old space (514k of 768k)

R=iposva@google.com

Review URL: https://codereview.chromium.org/1410383020 .
2015-12-01 09:21:17 -08:00
Florian Schneider d2ecf1d421 VM: Inlining of small constructors/factories, optimizations on inlined function bodies
Inline small constructors/factories more aggressively - the same way we already do for
small getter/setter and certain operator methods.

More local optimizations (ApplyClassIds) on inlined flow graphs with precompilation.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1472363002 .
2015-12-01 10:17:31 +01:00
Matthias Hausner 29e8118403 Handle potentially const interpolation
Fixes issue reported in 24970. As with all analysis for "potentially constant" expressions, this fix is too permissive. (See issue 392 for details.)

BUG=24970
R=iposva@google.com

Review URL: https://codereview.chromium.org/1455213002 .
2015-11-30 14:37:49 -08:00
Ivan Posva bc89cfccbf - Remove unused PrintInvokedFunctions method.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1490583002 .
2015-11-30 13:42:29 -08:00
Zachary Anderson c888f04ba3 Fixes setjmp clobbering warnings.
Also fixes an unused result warning.

BUG=https://github.com/dart-lang/sdk/issues/25052
R=whesse@google.com

Review URL: https://codereview.chromium.org/1484653002 .
2015-11-28 14:00:53 -08:00
Siva Annamalai ca9082332a Pure indentation changes.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1480753002 .
2015-11-25 15:12:36 -08:00
Zachary Anderson 5ee95b085f Move tar archive parsing to C++
This gives a 30+ms speedup to startup.

Also uses HashMap instead of Map for assets.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1474603003 .
2015-11-25 14:39:19 -08:00
Siva Annamalai 01b69ebabc Move ApiLocalScope out of class ApiState into class Thread so that the API local handles and zone etc. are thread specific instead of being Isolate specific.
R=zra@google.com

Review URL: https://codereview.chromium.org/1473403003 .
2015-11-25 11:07:22 -08:00
Siva Annamalai 569b3f77ee Copy the passed in name string into the os_thread structure and delete it in the destructor.
R=iposva@google.com

Review URL: https://codereview.chromium.org/1475863002 .
2015-11-25 09:23:08 -08:00
Matthias Hausner e3457758ed Remove Field::FindFieldIndex() and update service protocol
This paves the way to remove functions and fields from top-level
classes. They are looked up via the class dictionary when resolving
names.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1477573002 .
2015-11-24 15:42:03 -08:00
Ryan Macnak 5b57280d5e When deciding not to walk the native stack, don't overwrite the vm_tag set in SetupSample.
This causes ticks in the precompiler on a Mac to be correctly bucketed under
Compile, VM, etc instead of Embedder.

R=asiva@google.com

Review URL: https://codereview.chromium.org/1471953002 .
2015-11-24 15:36:55 -08:00
Ryan Macnak c44419805c - Display a pseudo-receiver for static function activations.
- Add missing breadcrumbs to class heirarchy, flags and timetime view.
 - Truncate large objects by default so we can look at them without falling over.
 - Demangle local variable names.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1463123002 .
2015-11-24 12:39:43 -08:00
Lasse R.H. Nielsen 027b8dca39 Add StackTrace.current getter.
R=floitsch@google.com, iposva@google.com, sra@google.com

Review URL: https://codereview.chromium.org/1448003002.
2015-11-24 08:26:03 +01:00
Ryan Macnak c0a0c92a5e Document the Inspect event in the service protocol.
BUG=http://dartbug.com/24998
R=turnidge@google.com

Review URL: https://codereview.chromium.org/1465673002 .
2015-11-23 16:56:08 -08:00
Matthias Hausner 849a635927 Remove dead code
Function::FindFunctionIndex() is not used anywhere.

Review URL: https://codereview.chromium.org/1469243002 .
2015-11-23 16:39:24 -08:00
Todd Turnidge bd2b840be0 Revert my recent changes to the Dartium test status files.
We have restored blocking isolate spawning under a flag.

--------

Revert "Update test status files.  Issue #24990."

This reverts commit 05bf1d6bb6.

Revert "Skip isolate spawning tests on Dartium."

This reverts commit c6c6f121ed.

BUG=

Review URL: https://codereview.chromium.org/1472783004 .
2015-11-23 15:15:55 -08:00
Todd Turnidge 08b3164bf3 Add the --i-like-slow-isolate-spawn flag for those who like slow spawning.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1469063003 .
2015-11-23 14:18:33 -08:00
Ryan Macnak 6d69da223d Don't ignore result of EnsureIsFinalized in Precompiler; update helper scripts to use dart_precompiled.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1464933002 .
2015-11-23 09:33:06 -08:00
Florian Schneider 367022b486 Update status of two flaky VM tests to make bots greener until issue is fixed.
These are expected to crash in debug mode, but time out frequently on Windows.

TBR=zra@google.com
BUG=#24596

Review URL: https://codereview.chromium.org/1470903002 .
2015-11-23 13:32:18 +01:00
Florian Schneider 166b3ddfe3 VM: Fix optimizer bug in smi-op widening.
Only consider operations that are used (have an SSA temp) for widening.

Operations without uses will be eliminated as dead code anyway later.

BUG=dartbug.com/24987
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1468433002 .
2015-11-23 09:47:45 +01:00
Siva Annamalai 4992bc72a0 Remove support for object grouping during Garbage Collection
- remove support for prolog weak persistent handles
- remove support for construction of weak reference sets

R=iposva@google.com

Review URL: https://codereview.chromium.org/1459173004 .
2015-11-20 12:36:16 -08:00
Todd Turnidge c6c6f121ed Skip isolate spawning tests on Dartium.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1455233007 .
2015-11-20 11:10:17 -08:00
Ryan Macnak 75cd019a9c Add RPC and UI for reachable size of an object / all instances of a class.
BUG=http://dartbug.com/24945
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1453983002 .
2015-11-20 10:02:16 -08:00
Florian Schneider 64e71a0b2e VM: Make more globals constant where easily possible.
Remove -fdata-section again from the Linux build configuration: It prevented
some optimizations in gcc and clang - fewer things were recognized as constants.

Add const to pointers/arrays in some places to help compilers with determining
what is a constant.  A common pattern is strlen of a string literal const char*,
or an array of function pointers.

Tested with gcc 4.8.4 / clang 3.4 and improves code qualtiy + reduces binary size.

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

Review URL: https://codereview.chromium.org/1462953002 .
2015-11-20 10:52:07 +01:00
Siva Annamalai f0ad800700 Fix architecture.
Review URL: https://codereview.chromium.org/1459913003 .
2015-11-19 17:13:11 -08:00
Siva Annamalai 59ddaa02f7 Update status file to indicate failure in vm/cc/TestObjectCompare under asan
(Issue https://github.com/dart-lang/sdk/issues/25002 has been filed to investigate this)

Review URL: https://codereview.chromium.org/1462253003 .
2015-11-19 16:58:17 -08:00
John McCutchan aaf37ad035 Landing patch set 7 from https://codereview.chromium.org/1450113003/
Review URL: https://codereview.chromium.org/1466523002 .
2015-11-19 14:18:52 -08:00
Siva Annamalai 8ce6b085a9 Fix build break.
Review URL: https://codereview.chromium.org/1462193002 .
2015-11-19 14:00:15 -08:00
Siva Annamalai 9e19d236ca - Add an OSThread structure which is the generic TLS structure for all C++
fields in a thread (i.e fields that are not Dart VM related)
- Split the Thread structure to be a pure Dart per thread structure and add
  a pointer to os_thread which points to the OSThread structure
- Change Schedule/UnSchedule to set the Dart Thread structure as the TLS of
  the thread when it is inside the Dart world and reset the TLS back to the
  OSThread strcuture when is exits the Dart World.
- Moved the stack_base and few stack size related functions to OSThread from Isolate

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

Review URL: https://codereview.chromium.org/1439483003 .
2015-11-19 13:45:10 -08:00
Srdjan Mitrovic a9961f8f0a Various cleanups
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/1464593002 .
2015-11-19 13:15:01 -08:00
Todd Turnidge b243fa53cf Redo the interface for capture stdio.
Flutter doesn't care to import tons of our include files.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1460863002 .
2015-11-19 09:24:23 -08:00
Florian Schneider f0a35b3260 VM: Add dart_precompiled build target, a standalone VM without the JIT compiler.
This removes most of the compiler-related code from dart_precompiled:
x64 stripped binary size 13M -> 9.1M
ARM stripped binary size 12M -> 8.3M

The precompiled build defines the DART_PRECOMPILED macro. This
stubs out the public interface to the compiler/parser with empty
function bodies.

Use gcc options -ffunction-sections and --gc-sections to make the linker remove
unused functions/symbols.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1459443002 .
2015-11-19 10:13:16 +01:00
Srdjan Mitrovic bad39686a4 Revert "Enable deferred deoptimization always."
This reverts commit 94754bee29.

BUG=

Review URL: https://codereview.chromium.org/1462703002 .
2015-11-18 15:28:34 -08:00
Ryan Macnak df72a27f23 Intrinsify _StringBase._substringMatches to speedup indexOf/startsWith/endsWith under precompilation.
Fix some Smi checks in other intrinsics on MIPS.

Raspberry Pi 2
Before
JIT StarryStrings(RunTime): 1851875.5 us.
noopt StarryStrings(RunTime): 23655235.0 us.

After
JIT StarryStrings(RunTime): 1829766.5 us.
noopt StarryStrings(RunTime): 8660442.0 us. (2.7x)

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1450663002 .
2015-11-18 14:38:39 -08:00
Srdjan Mitrovic 94754bee29 Enable deferred deoptimization always.
Deferred deoptimization being moved ahead of entering field dependencies, attempt to use it for non-background-compilation as well. Previous failures not reproducible on Linux ia32 any longer.

BUG=

Review URL: https://codereview.chromium.org/1450973002 .
2015-11-18 14:30:48 -08:00
Ryan Macnak a6e8abfeb6 Deal with missing deopt_table under precompilation.
E.g., the InlinedFunctionsIterator used to build stacktraces.

Broken by 73b6080a6b.

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

Review URL: https://codereview.chromium.org/1458973002 .
2015-11-18 13:02:23 -08:00