Commit Graph

585 Commits

Author SHA1 Message Date
Régis Crelier 27127b364a [DBC simulator] Rename class Bytecode to SimulatorBytecode.
This frees the name Bytecode that will become the name of a new VM class.
Class Code will only refer to compiled code and Bytecode will refer to kernel
bytecode.

Change-Id: If64a5d688f0bf75220e67ef2932f4141782e9dc3
Reviewed-on: https://dart-review.googlesource.com/c/82703
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-11-02 20:53:24 +00:00
Ryan Macnak 8b2059946a [vm, service] Make 'evaluate' and 'evaluateInFrame' produce RPC errors instead of crashes when no compilation service is available.
Bug: https://github.com/flutter/flutter/issues/23409
Change-Id: I003b176f28d650fb36e129c69ec5378942417ecd
Reviewed-on: https://dart-review.googlesource.com/c/81339
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-10-25 20:33:04 +00:00
Ryan Macnak 662ff7f112 [vm] Remove TokenStream, TokenValue, CompilerStats.
(CompilerStats timers have been replaced with the timeline events.)

Change-Id: Iddcb752c085de9762eb802371b6d2905fa608a76
Reviewed-on: https://dart-review.googlesource.com/c/79086
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-10-10 21:39:45 +00:00
Ryan Macnak b8760fed67 [vm, compiler] Remove ASTs and AST flow graph builder.
Change-Id: I4d3c6500577d5285ced327954040dab42ba92341
Reviewed-on: https://dart-review.googlesource.com/c/78823
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-10-10 18:00:21 +00:00
Alexander Aprelev a2cf88bee6 [vm] Fix sync-async stack navigation to handle inlined functions.
Bug: http://dartbug.com/34673
Change-Id: I92affde6e9e8e6e2fbf5c2a8ed20bb8a3ad4d028
Reviewed-on: https://dart-review.googlesource.com/c/78580
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-10-09 15:56:07 +00:00
asiva 76470aca47 [VM] use coresnapshot when initializing an Isolate
- use core snapshot when initializing an isolate (CorelibIsolateStartup benchmark moves from 39s to 2s)
- remove use_dart_frontend flag from the isolate specific flags
- the script snapshot API functions now return an error

Change-Id: Ia562e007fdbfd1d3ebd8e1a0c8feee238bada00b
Reviewed-on: https://dart-review.googlesource.com/76709
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-09-27 00:55:07 +00:00
Alexander Markov 3263550e86 [vm] Decouple bytecode reading from compilation
This way requests to compile won't end prematurely after reading
bytecode if interpreter is enabled.

Change-Id: Ic06cae98ea65bc4656ef491fbd306d34b0e1ef4c
Reviewed-on: https://dart-review.googlesource.com/75628
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-20 16:22:33 +00:00
Ryan Macnak c1ea77a3a0 [vm] Extend --trace_deoptimization to cover the lazy deopt causes.
Change-Id: I09843815297fe13ca2f6880e794cc26c76dc6267
Reviewed-on: https://dart-review.googlesource.com/75126
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-17 22:18:12 +00:00
Régis Crelier a2fae0125f [VM interpreter] Mark activation frames as interpreted instead of crashing.
This is a first step in supporting bytecode in the debugger.

Change-Id: Ieb06b8b534fcc7f0291457cd6912d772b8ee247a
Reviewed-on: https://dart-review.googlesource.com/74012
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-09-12 00:33:30 +00:00
Zach Anderson b4004f6476 [vm] Reland: Move the interpreter under a flag.
After this CL, the interpreter is included by default in the
JIT VM under the flag --enable-interpreter.

Reland with fix to NativeArgument setup in simulator_arm.cc

Change-Id: Ib9b4df6eb4d997dfbe361188b8a127828c1d9c6f
Reviewed-on: https://dart-review.googlesource.com/74003
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-07 19:25:31 +00:00
Zach Anderson 21406f576a Revert "[vm] Move the interpreter under a flag."
This reverts commit 715ab7b30b.

Reason for revert: simarm and kernel precomp builds failing

Original change's description:
> [vm] Move the interpreter under a flag.
> 
> After this CL, the interpreter is included by default in the
> JIT VM under the flag --enable-interpreter.
> 
> Change-Id: I06458f20288d67981822788ee6e867c2127ebdd3
> Reviewed-on: https://dart-review.googlesource.com/71800
> Commit-Queue: Zach Anderson <zra@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com,zra@google.com,asiva@google.com,regis@google.com

Change-Id: I3622f4dbe53288d07fc21b34ee5ff68f2682b36d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/74001
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-07 17:14:21 +00:00
Zach Anderson 715ab7b30b [vm] Move the interpreter under a flag.
After this CL, the interpreter is included by default in the
JIT VM under the flag --enable-interpreter.

Change-Id: I06458f20288d67981822788ee6e867c2127ebdd3
Reviewed-on: https://dart-review.googlesource.com/71800
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-09-07 16:46:07 +00:00
Vyacheslav Egorov 7558644bd6 [vm/compiler] Move compiler state (CHA, deopt id) from Thread to a special class
Also move deopt id computation logic into a separate class and add a comment
explaining while deopt ids are incremented by 2.

Change-Id: Ife489be7d10c7198a8e7adf9e97e0c516d78ea55
Reviewed-on: https://dart-review.googlesource.com/72685
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-09-03 16:01:24 +00:00
Martin Kustermann b7790e3147 [VM] Make all of our compilation pipeline use a [FrameLayout] to generate code
This will allow us to have configurable frame layouts during
gen_snapshot/dart_bootstrap.

Issue https://github.com/dart-lang/sdk/issues/33274

Change-Id: I18945189034be1a585c1e2edcf53a4b7537204c2
Reviewed-on: https://dart-review.googlesource.com/59880
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-08-21 10:26:12 +00:00
asiva 54ae4f9172 [VM] - Fix race condition in setting kernel isolate
(was being added to the isolate list before it was marked as a kernel isolate)

Also do not send service events or debug events from the kernel isolate

Change-Id: I82a1dac3c8a845344dd26ce8a2a9077eb93f8447
Reviewed-on: https://dart-review.googlesource.com/65881
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-08-16 22:01:42 +00:00
Jens Johansen 2580bf87ae Fix invalid assert that slipped by in ac8fdb5a
Change-Id: Iae23403b9bb7c57617c374034060cb1804e52bbd
Reviewed-on: https://dart-review.googlesource.com/68020
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-08-02 08:08:37 +00:00
Alexander Aprelev 5d98fe159a Fix ExtractTokenPositionFromAsyncClosure on kernel
Previously (e71bd048e5) it was assumed that kernels
`script.yield_positions` was for the single function, not for the entire
script. That's not the case.
This resulted in the wrong stack-trace sometimes being produced.

This is technically tested in a service test, though that test also
tests other things and fails before getting to test this.

This CL adds a test that tests only this and fixes the problem.

Cloned from https://dart-review.googlesource.com/c/sdk/+/63741 to
untangle it from two other changes.

Bug: https://github.com/flutter/flutter/issues/17838
Change-Id: I4c24342d63865cb7cbd25c42ba686007bdbde1b1
Reviewed-on: https://dart-review.googlesource.com/66800
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-07-25 21:11:35 +00:00
Ben Konyi 6bddb6c112 [ VM / Debugger ] Use existing Function object to set breakpoints instead of finding "best fit" when possible.
Change-Id: I8bad37129f907d500a024acc8e17ad265b8b04b1
Reviewed-on: https://dart-review.googlesource.com/65793
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-07-20 21:15:49 +00:00
Ryan Macnak 9b5a931b06 [vm] Replace most runtime/vm uses of OS::Print with OS::PrintErr.
Leave --print-snapshot-sizes on stdout because it is parsed by Flutter benchmarks.

Replace all runtime/bin uses of OS::Print with Log::Print.

Bug: https://github.com/dart-lang/sdk/issues/32134
Change-Id: I74aacfb410cdfa9270d06e7f6ab0534520c7c7ba
Reviewed-on: https://dart-review.googlesource.com/60021
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-06-13 19:51:40 +00:00
Martin Kustermann 0a8b236159 [VM] Make the encoding of variable descriptors use variable indices
This decouples the scope building from knowing about frame layout.

Issue https://github.com/dart-lang/sdk/issues/33274

Change-Id: I9058b242fb24f859f54d6e3660a5972df86d39e6
Reviewed-on: https://dart-review.googlesource.com/59093
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-06-11 09:55:54 +00:00
Alexander Aprelev a5e41681e5 Add support for expression compilation via service.
If there is registered expression compiler, VM debugger uses it to compile expressions. Otherwise, it will fallback to use kernel service compiler.
This is needed to support Flutter use case where compiler is running on developer's host machine, not on the device where VM is running.

Bug: dartbug.com/31981
Change-Id: I8bdfc8ab45a57c306169abe189f1e24e1b0bcf40
Reviewed-on: https://dart-review.googlesource.com/57520
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-06-05 04:16:39 +00:00
Régis Crelier 57dc25c6f6 [VM interpreter] Initial version of stack walking of interpreted frames.
Various improvements and bug fixes.

Change-Id: Ice0ce0ba8db8c9f78b9fad89f951218c90c831b7
Reviewed-on: https://dart-review.googlesource.com/57443
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-06-04 18:37:30 +00:00
Martin Kustermann 35b17f3730 [VM] Consistently use ValidationPolicy in frame iteration APIs
Previously there were places in the code where an API accepted a
`bool validate_frames` and call sites passed an enum value (which
implicitly got converted to a bool).

By changing the APIs to require an enum, the compiler will tell us if a
caller doesn't pass one.

Change-Id: I29fcd0b018e6cdd7e00b5bb03e83b9636d1345d4
Reviewed-on: https://dart-review.googlesource.com/57823
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-06-04 14:46:26 +00:00
Alexander Aprelev e71bd048e5 [vm, kernel] Fix async stack code traversal in dart2.
With this change debugger requests yield(await) positions from kernel builder so it can confirm which frame handles what exceptions.
This also renames ':completer' to ':async_completer' in constructed kernel, so it is compliant with what VM expects to see(and updates test expectations accordingly).
Further it fixes async stack navigation for sync-async that became default in dart vm since first version went for the review((uses `future` getter, rather than property).
It also makes `future` getter non-debuggable to allow stepping-out of async methods.

Make Handle zone-scoped. Clean up frame counter var name.

Bug: https://github.com/dart-lang/sdk/issues/29056

Change-Id: Ia71f3c851a6b313655b57dad28c296f5dd081eda
Reviewed-on: https://dart-review.googlesource.com/54640
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-05-22 00:27:01 +00:00
Samir Jindel 23c8c4d101 [vm/kernel] Pass type variables through ActivationFrame for expression compilation.
Fixes https://github.com/dart-lang/sdk/issues/32376.

Change-Id: I37bbda2dbc6052925aa840865c62a170604c6cdd
Reviewed-on: https://dart-review.googlesource.com/44784
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2018-05-17 13:59:57 +00:00
Ryan Macnak 3db2338283 [vm] Remove old --break_at_isolate_spawn.
This has long been replaced with --pause_isolates_on_start.

Change-Id: Ibf5850473b0d2090ec8ff244897a214149fb250c
Reviewed-on: https://dart-review.googlesource.com/48882
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-03-30 22:52:02 +00:00
Jens Johansen 4e162c5318 [kernel] Fix vm crash when trying to break on default constructor
Writing "break Foo" in observatory with a file including
```
class Foo { }
```

would crash them VM.

This CL introduces a test that reproduces it and fixes the issue.

Bug:
Change-Id: I24780d9204117ade19a0cb590c45aa31b7c04f7e
Reviewed-on: https://dart-review.googlesource.com/30445
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-20 13:02:12 +00:00
Alexander Markov f6d6766920 [VM] Restore disassembler in flutter/profile (dart/release) mode
This CL restores disassembler in precompiled mode after it was removed
in 8cb752f73b.
Without disassembler observatory is not able to show assembly code
in 'flutter run --profile' mode.

This CL also pulls BufferFormatter out of il_printer.h/.cc as it is also
used in disassembler.

Change-Id: I098ddb8d8f5a2426028c1f467d58e5c2d6a82d21
Reviewed-on: https://dart-review.googlesource.com/7486
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-21 16:07:02 +00:00
Vyacheslav Egorov 8a179fb953 [VM, Compiler] Move compiler to a separate folder.
New folder structure (nested under vm/):

- compiler/
-   jit/         - JIT specific code
-   aot/         - AOT specific code
-   backend/     - all middle-end and back-end code (IL, flow graph)
-   assembler/   - assemblers and disassemblers
-   frontend/    - front ends (AST -> IL, Kernel -> IL)

compiler/README.md would be the documentation root for the compiler
pipeline

Bug: https://github.com/dart-lang/sdk/issues/30575
Change-Id: I2dfd9688793bff737f7632ddc77fca766875ce36
Reviewed-on: https://dart-review.googlesource.com/2940
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-09-04 15:15:18 +00:00
Aske Simon Christensen 8cb752f73b Revised "Eliminate dependencies on assemblers and code stubs in precompiled runtime."
Explicitly clear unbox_numeric_fields flag in PRODUCT builds. Fixes code bloat introduced by previous CL. New changes in Patch Set 2.

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

Review-Url: https://codereview.chromium.org/3006923002 .
2017-09-04 13:13:26 +02:00
Beeravolu Siva Chandra Reddy 245be6c74c Rename the class "KernelReader" to "KernelLoader".
There already exists a class named "Reader" in the "kernel" namespace
which reads bytes from a kernel binary. The class KernelLoader
(KernelReader before this change) creates VM heap objects and populates
them.

R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/3010543002 .
2017-08-29 10:59:18 +02:00
Ryan Macnak 9ce7fb5929 Revert "Reapply "Eliminate dependencies on assemblers and code stubs in precompiled runtime.""
This reverts commit 8ee4436355.

This change caused a 63% increase in AOT snapshot size of Flutter Gallery.

Issue #30472

Review-Url: https://codereview.chromium.org/2997993002 .
2017-08-17 13:33:37 -07:00
Beeravolu Siva Chandra Reddy ab6d7bba53 Fix stepping in when paused in async functions.
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2994983002 .
2017-08-15 14:14:11 +02:00
Aske Simon Christensen 8ee4436355 Reapply "Eliminate dependencies on assemblers and code stubs in precompiled runtime."
Also exclude references to disassembler in precompiled mode.

New edits are in patch set #2.

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

Review-Url: https://codereview.chromium.org/2994863002 .
2017-08-12 02:15:23 +02:00
Siva Annamalai 73d30074b1 - Convert all isolate flags to a bit field.
- Add a new isolate specific flag to cause the isolate to run in kernel mode.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2995723002 .
2017-08-11 12:38:25 -07:00
Ryan Macnak 3afd223f90 [gardening] Revert "Eliminate dependencies on assemblers and code stubs in precompiled runtime."
This reverts commit 46c53882cc.

This changes introduced link errors on Windows.

Review-Url: https://codereview.chromium.org/3001463002 .
2017-08-09 15:49:51 -07:00
Aske Simon Christensen 46c53882cc Eliminate dependencies on assemblers and code stubs in precompiled runtime.
Guard all excluded code behind conditional compilation.

Removed precompiled runtime flag. Only preprocessor flag remains.

BUG= https://github.com/dart-lang/sdk/issues/30045
R=rmacnak@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2976723003 .
2017-08-09 22:21:34 +02:00
Siva Chandra cf07adc873 Allow setting breakpoints in function literal field initializers under --dfe.
The change 3b9cf7351b fixed #29581 for the
case when --dfe is not used. This change fixes the issue for the --dfe
configuration as well.

Tests which now pass have been taken out of the status files.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2979163002 .
2017-07-19 13:17:25 -07:00
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Siva Chandra f0ef900fd3 Fix setting breakpoints in parts of a library.
This fixes the regression caused by
1eaa3dd84b and reported in #29988.

When picking a class to set a breakpoint, instead of rejecting classes
not defined in the script, we now reject classes which do not belong to
the library to which the script belongs.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2965673004 .
2017-07-10 17:20:26 -07:00
Aske Simon Christensen cec963f028 The current growth strategy for growable arrays allocates a backing array of size 2 at (empty) creation and doubles the size whenever the capacity is insufficient while adding elements.
I collected statistics for the sizes and capacities of growable arrays which are promoted to old-space or survive an old-space gc when running dart2js and Fasta. For these applications, the vast majority of arrays stay empty. More than half of the total object size of promoted backing arrays is backing for empty growable arrays.

Furthermore, since the overhead for an array is 3 words (header, type parameters and length), and object sizes are rounded up to an even number of words, we waste one word for all even-sized arrays.

This CL changes the growth strategy so that empty growable arrays are created with a shared, zero-sized array as backing, avoiding the allocation of a backing array if no elements are added. When the array needs to grow, it starts out at 3 and grows to double size plus one each time: 7, 15, 31, ...

A few places in the VM code need to handle these shared, zero-sized arrays specially. In particular, the Array::MakeArray function needs to allocate a new, empty array if its result is to be returned to Dart code.

Benchmarks suggest that the change improves memory usage by a few percent overall and does not significantly affect run time.

BUG=
R=erikcorry@google.com

Review-Url: https://codereview.chromium.org/2949803002 .
2017-06-22 10:51:54 +02:00
Ryan Macnak 2109cc53bf Remember deopt-id -> context-level mappings in var descriptors.
- Add deopt ids to DebugStepInstr and StrictCompareInstr since the debugger can stop there.
 - Add missing pc descriptor in DBC's StringInterpolateInstr.

Re-enable async_debugger, which had been crashing flakily from context mismatches.

R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2903993002 .
2017-06-01 12:33:33 -07:00
Siva Chandra ffeaa4a46d Hit breakpoints in single line closures.
Before this change, breakpoints on lines like the following were not hit:

var singleLineClosure = (int a, int b) => return a + b;

The reason was that breakpoints were only resolved if their start token
was contained within a function. Since that is not true for closure vars
like in the above example, the breakpoints were never getting resolved.
This change avoids such a problem by resolving breakpoints if the token
range of the breakpoint overlaps the token range of a function.

Fixes #29736

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2912763005 .
2017-06-01 11:26:06 -07:00
Siva Chandra 3b9cf7351b Allow setting breakpoints in literal function initializers of fields.
Fixes #29581 when the VM parser is used.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2904793002 .
2017-05-26 13:43:34 -07:00
Siva Chandra 1eaa3dd84b Cleanup how a best fit function is found when setting a breakpoint.
1. Look for functions/closures only in the script where the breakpoint
is being set.
2. If an inner most closure is found, return that as the best fit.
3. When going over a class' functions, return immediately when a fit is
found as going over the other class functions will not yield a narrower
fit.

BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2898153006 .
2017-05-25 12:57:40 -07:00
Ryan Macnak 03a2c24edf vm-service: Add optional 'scope' parameter to 'evaluate' and 'evaluateInFrame'.
Closes #29535

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2872503004 .
2017-05-18 18:02:49 -07:00
Alexander Aprelev 5f9ec0abe8 Use latent breakpoints list when looking up or removing breakpoints.
BUG=https://github.com/dart-lang/sdk/issues/29566
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2869573002 .
2017-05-09 05:58:37 -07:00
Martin Kustermann ac8d2056a3 Fix asserts in StackFrameIterator which were effectively disabled
The assertions which tried to assert that we only use
StackFrameIterator to walk frames of the current thread was incorrect.
We already have cases where other threads will walk the stack of the
mutator thread, see below for an example where this can happen.

Thread::VisitObjectPointers was incorrectly passing Thread::Current() to
the StackFrameIterator instead of 'this'.  (Code in thread_registry.cc will
loop over a number of threads and calls VisitObjectPointers on them)

  Mutator thread:

    0  pthread_cond_wait@@GLIBC_2.3.2
    1  dart::Monitor::WaitMicros
    2  dart::Monitor::Wait
    3  dart::MonitorLocker::Wait
    4  dart::ThreadBarrier::Sync
    5  dart::GCMarker::MarkObjects
    6  dart::PageSpace::MarkSweep
    7  dart::Heap::CollectOldSpaceGarbage
    8  dart::Heap::CollectNewSpaceGarbage
    9  dart::Heap::CollectGarbage
    10 dart::DN_HelperObject_<native>
    11 dart::BootstrapNatives::<native>
    <dart frames>

  MarkTask thread:

    1  dart::EntryFrame::VisitObjectPointers
    2  dart::Thread::VisitObjectPointers          <---- Walks mutator thread stack
    3  dart::ThreadRegistry::VisitObjectPointers  <---- Iterates over a number of threads
    4  dart::Isolate::VisitStackPointers
    5  dart::Isolate::VisitObjectPointers
    6  dart::GCMarker::IterateRoots
    7  dart::MarkTask::Run
    8  dart::ThreadPool::Worker::Loop
    9  dart::ThreadPool::Worker::Main
    10 dart::ThreadStart

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2845053003 .
2017-05-03 10:27:01 +02:00
Erik Corry aa6353b6da Dart SDK Spelling b, c, and d.
R=kmillikin@google.com
BUG=

Review-Url: https://codereview.chromium.org/2850783002 .
2017-05-01 08:28:10 +02:00
Erik Corry 6617737ff5 Replace 'the the' with 'the'
R=kmillikin@google.com
BUG=

Review-Url: https://codereview.chromium.org/2830353002 .
2017-04-24 08:50:37 +02:00