Commit Graph

128 Commits

Author SHA1 Message Date
Vyacheslav Egorov 021f933f69 VM: Make use_osr an Isolate flag, similar to how we made use_field_guards.
In Debug mode we have assertions checking that we don't attempt OSR when
FLAG_use_osr is disabled - however app-jit snapshots are compiled with OSR
enabled and still contain countining and OSR attempting code, which causes
assertions to fail.

Refactor how getters for isolate flags are defined, consolidate all flags into
a single list.

Update test expectations and switch -c dartk configuration to use app-jit snapshot.

BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2728163002 .
2017-03-03 19:02:23 +01:00
Siva Annamalai 3f48197f37 Fix for issue 28606 - Wait for thread that runs the interrupted isolate to exit completely before exiting the main thread, we get into racy cleanup otherwise.
R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2671133002 .
2017-02-06 16:25:57 -08:00
Ben Konyi f2fd150ea0 Added new type of unit test, RAW_UNIT_TEST_CASE, which is used for tests that can be flaky if run while the VM is alive. Tests created using the RAW_UNIT_TEST_CASE macro will run after the VM has shutdown to avoid having any worker threads contaminating the test results.
BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2666133002 .
2017-01-31 15:16:38 -08:00
Lasse Reichstein Holst Nielsen 7957a1c256 Make EfficientLength extend Iterable.
This should help least-upper-bound computations to not think of EfficientLength
as completely separate from Iterable even though they are always used together.

It doesn't solve all problems with the least-upper-bound computation,
but at least some of the more often occuring ones.

R=floitsch@google.com

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

Committed: https://github.com/dart-lang/sdk/commit/b08fb1373f88121bb4056adce9b71849a5bede2a
2016-11-28 08:04:04 +01:00
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
Ryan Macnak 6cf5c3baa3 Revert "Make EfficientLength extend Iterable."
This reverts commit b08fb1373f.

TBR=lrn@google.com

Review URL: https://codereview.chromium.org/2467283003 .
2016-11-02 13:20:41 -07:00
Lasse R.H. Nielsen b08fb1373f Make EfficientLength extend Iterable.
This should help least-upper-bound computations to not think of EfficientLength
as completely separate from Iterable even though they are always used together.

It doesn't solve all problems with the least-upper-bound computation,
but at least some of the more often occuring ones.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2467113003 .
2016-11-02 14:05:35 +01:00
John McCutchan fb468e387d Fix vm/cc/Debug_StepInto test which relied on old defaults
BUG=

Review URL: https://codereview.chromium.org/2364923003 .
2016-09-23 12:25:30 -07:00
Vyacheslav Egorov ee0f608ce4 Dart Byte Code interpreter.
This version is Clang/GCC only and does not support Windows because it uses computed goto's.

Only unoptimized mode is supported.

Architecture is described in constants_dbc.h and stack_frame_dbc.h.

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

Review URL: https://codereview.chromium.org/1858283002 .
2016-04-18 23:02:01 +02:00
Florian Schneider d8677964a3 Move precompilation-related flags to flags list.
They become compile-time constants in the precompiled runtime, and in product mode.

In precompiled product mode, the precompiled value has precedence.

BUG=
R=rmacnak@google.com

Committed: https://github.com/dart-lang/sdk/commit/5c9f18c6c87284395564051a052cc4acc9b6f59a

Review URL: https://codereview.chromium.org/1731743003 .
2016-02-25 07:53:39 -08:00
Ryan Macnak bd85deaf4e Revert "Move precompilation-related flags to flags list."
The default value of print_stop_message was architecture specific.

TBR=fschneider@google.com

Review URL: https://codereview.chromium.org/1739593002 .
2016-02-24 18:08:01 -08:00
Florian Schneider 5c9f18c6c8 Move precompilation-related flags to flags list.
They become compile-time constants in the precompiled runtime, and in product mode.

In precompiled product mode, the precompiled value has precedence.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1731743003 .
2016-02-24 17:31:08 -08:00
Todd Turnidge 991e5b2c7b Add --trace-shutdown flag.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1670623002 .
2016-02-12 11:09:23 -08:00
John McCutchan d295b9c311 Remove many features when building product mode
Move all JSON printing code from object.cc to object_service.cc.

Not compiled in:

- Service protocol
- Debugger
- Debugger API
- JSONStream
- ObjectIdRing
- Profiler service
- Object JSON printing

Size of dart_bootstrap before: 5670365 bytes
Size of dart_bootstrap after: 5287631 bytes

Reduction in size: 382734 bytes.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1660063002 .
2016-02-05 09:55:51 -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
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 354fcb12cf Cleanups. More mutator thread asserts.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1448463004 .
2015-11-16 10:29:01 -08:00
Srdjan Mitrovic cd98aff665 Getting rid of Isolate::current_zone() usage. Pass thread instead of isolate where it makes sense.
BUG=
R=hausner@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1424703004 .
2015-10-26 15:31:50 -07:00
Srdjan Mitrovic 5039117f50 Remove isolate parameter when allocating handles
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1401643002 .
2015-10-12 15:51:06 -07:00
Ryan Macnak 129d7d3cec Ensure the debugger considers parameters to be in scope at the method entry debug step.
Push entry debug step check after parameter capturing and give it the token position of the last parameter.

BUG=http://b/24200673
R=hausner@google.com

Review URL: https://codereview.chromium.org/1393453004 .
2015-10-07 12:33:29 -07:00
Zachary Anderson 7093f2996b VM thread shutdown.
BUG=
R=iposva@google.com, turnidge@google.com

Review URL: https://codereview.chromium.org//1275353005 .
2015-09-15 12:49:52 -07:00
Zachary Anderson d4d89d6f12 Reverts VM thread cleanup
BUG=

Review URL: https://codereview.chromium.org//1275853008 .
2015-08-07 19:10:31 -07:00
Zachary Anderson 55bfb3d54b Clean VM thread shutdown:
Second attempt at: https://codereview.chromium.org/1177153005/

This time with fixed error propagation in the embedder.

R=turnidge@google.com

Review URL: https://codereview.chromium.org//1279733003 .
2015-08-07 18:42:00 -07:00
Zachary Anderson 4ca87e6d88 Revert VM thread cleanup
TBR

BUG=

Review URL: https://codereview.chromium.org//1270323002 .
2015-08-05 01:27:01 -07:00
Zachary Anderson 174d552574 Enables clean VM shutdown.
. Disables isolate spawning during Dart_Cleanup.
. Adds a static call Isolate::KillAllIsolates, which sends the
  OOB Kill message to all isolates when called from
  Dart_Cleanup.
. Modifies thread pool shutdown to block until all threads have
  exited.
. Fixes tests.

BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org//1177153005 .
2015-08-04 23:29:25 -07:00
Ryan Macnak c165fee611 Insert debug step check at the beginning of a function.
BUG=http://dartbug.com/23827
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1237203002 .
2015-07-14 15:27:44 -07:00
John McCutchan bcf6eb7099 Remove dart_debugger_api.h
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1190103003.
2015-06-17 14:56:55 -07:00
Lasse R.H. Nielsen babcd4e9c0 Revert "Make EfficientLength public, as EfficientLengthIterable."
It's still not a good solution for detecting an Iterable with an efficient
length. It's not inherited by, e.g., a DelegatingIterable wrapper or similar
generic Iterable transformers.

Keep this as an internal optimization for quickly detecting the most common
efficient-length Iterable classes (List, Set, Queue, Map.keys/values), but
don't make it public.

A *real* solution would be adding a hasEfficientLength getter to Iterable, or
adding an efficientLength getter that may return null if it's not efficient.
This would something that a wrapper can attach to.

R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1154263003
2015-05-29 12:52:45 +02:00
John McCutchan 51d8bae199 Revert "Hide Isolate pointer from embedder"
This reverts commit 014e694ba7.

Revert "Fix fall out from hide isolate pointer change"

This reverts commit 966aafbc81.

Revert "Fix build"

This reverts commit d7b03ba7b0.

BUG=

Review URL: https://codereview.chromium.org//1140263005
2015-05-19 11:41:42 -07:00
John McCutchan 014e694ba7 Hide Isolate pointer from embedder
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1130753006
2015-05-18 14:06:10 -07:00
lrn@google.com 92c526b2a2 Make EfficientLength public, as EfficientLengthIterable.
R=iposva@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45556 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-06 09:00:45 +00:00
lrn@google.com 0e22f7402f Move implementation from IterableBase to Iterable.
Keep IterableBase around, but just extend Iterable.

There is no good reason to have IterableBase different from Iterable. The only argument is to be consistent with ListBase, but that's also inconsistent with, e.g., Stream.
ListBase only exists because List uses the default List constructor, so it's not a good super-class. As a usability-tradeoff, the ListBase class exists as a super-class.
Iterable doesn't have the same problem, so applying that "trade-off" has no up-side.

(A better long-term solution would be to be able to designate another constructor as the default "super()" constructor to call, so List could be used as a superclass).

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45096 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-13 12:26:15 +00:00
turnidge@google.com 03fbeff0bf Go back to old naming for implicit functions to fix the build.
Investigate offline.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44926 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-06 20:04:45 +00:00
turnidge@google.com fb591fc36a Continue improving the documentation for the vm service protocol.
Clean up the protocol a bit as I go.

---

Addendum:

Clean up inconsistencies between field and function ownership in the protocol.

Change the names of implicit closure functions (!)

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44923 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-06 19:24:47 +00:00
fschneider@google.com 431f96710c Re-enable and adjust skipped VM debugger tests.
They were skipped because of a long-resolved issue. This required changing
the set of reported variables according to the current debugger implementation.

I adjusted the test to check for substring for the expected function names:

Dart_ActivationFrameGetLocation returns Debugger::QualifiedFunctionName nad
and Dart_FunctionName returns Function::UserVisibleName.
Should the two be made consistent instead?

cc/IsolateInterrupt was skipped on x64 for unknown reasons. It seems to pass fine
(tested locally)

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44597 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-20 09:25:46 +00:00
koda@google.com c7e9e048ed Rename Thread -> OSThread.
It's a collection of static utility methods for primitive operations on OS threads.

Make room in the namespace for upcoming class that will represent all the complex state of a VM thread.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42895 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 02:30:07 +00:00
hausner@google.com 9aa128c9f2 Remove deprecated debugger code
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42534 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-20 00:20:03 +00:00
fschneider@google.com a49870e721 VM: Remove use of IterableMixinWorkaround from _List, _ImmutableList and _GrowableList.
_List, _ImmutableList and _GrowableList now extend ListBase which uses ListMixin.

Note that typed data lists are still using IterableMixinWorkaround for now.
They will be changed in a separate CL since it involves a few more changes
to the VM.

BUG=dartbug.com/13647
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42061 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-02 10:38:51 +00:00
jacobr@google.com bb133370ce Add ActivationFrame_GetFramePointer method and test.
BUG=
R=asiva@google.com, hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40171 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 18:17:03 +00:00
iposva@google.com 14ecdbd66a - Separate the thread implementation used in bin/ and vm/
to allow us to make VM specific changes.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39172 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 23:19:53 +00:00
asiva@google.com a8195aeb5c Change the Dart API call Dart_FInalizeLoading to accept an additional argument
which makes completion of deferred library futures optional.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38463 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-22 16:56:14 +00:00
hausner@google.com 7dd12c92f4 Fix test Debug_BreakOnUnhandledException in checked mode
TBR=srdjan

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38317 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-16 22:33:34 +00:00
hausner@google.com d6664499a9 Debugger test to ensure break on exception works
Tests that the debugger is only called on exceptions when the exception is
unhandled or when it wants to be notified on all exceptions.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38316 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-16 22:30:33 +00:00
rmacnak@google.com 0c7531c941 Implement Evaluate without creating temp classes by storing an eval function's script in the function's data field.
This means Evaluate doesn't burn through CIDs, mitigating the problem where class table entries are treated as strong references. More generally the whole tangle of objects created during eval is collectable, and running eval in a loop doesn't lead to heap growth.

http://dartbug.com/18284

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38140 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-10 23:23:01 +00:00
rmacnak@google.com 5afea71262 Setup R10/EDX to be valid Oops before stub calls so when the debug stub saves them to the stack the GC doesn't try to deference out of the heap.
BUG=http://dartbug.com/19331
R=asiva@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37297 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-12 23:50:48 +00:00
zra@google.com ea99b1e6f8 Adds debugger patching to arm64.
Also other small fixes.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36003 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-09 23:20:14 +00:00
hausner@google.com 12c56b29c7 Eliminate unused url mapping parameter in dartutils
Change the LibraryTagHandler used in unit tests to match
the real tag handler better, eliminating special treatment
of url canonicalization. This required changing the library
url of tests so tests don’t get loaded using dart scheme urls,
since builtin.dart doesn’t handle dart: urls.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35987 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-09 18:25:41 +00:00
johnmccutchan@google.com ef666553a1 Add runtime and native entry tags
- Split runtime and native entry tags.
- Set runtime / native entry address as vm tag in stubs.
- Add reverse native entry resolver (pc to name) to public API (breaking change).
- Hookup reverse resolver for standalone VM (io + bootstrap + builtin natives).
- Runtime entries are registered with tags.
- Profiler queries for tag names via the reverse native entry resolver.
- Profiler outputs named entry tags as children under parent tag (runtime or native).

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34941 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-10 20:26:45 +00:00
zra@google.com 2fe51715e5 Begins work on ARM64, first assembler test.
Most new code is in constants_arm64.h and
{assembler,disassembler,simulator}_arm64.{h,cc}

The rest of the CL just #def's out tests, modifies status files,
and adds UNIMPLEMENTED functions, etc.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34654 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-02 17:39:32 +00:00
turnidge@google.com bb6003d9b7 Fix line number table generation for multiline strings with interpolation.
Share the line number table generation code between debugger and vm service.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34606 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-01 18:16:27 +00:00