Commit Graph

36 Commits

Author SHA1 Message Date
Ben Konyi 07a8496919 [VM] Allow for Dart_SetVMFlags to be called again after Dart_Cleanup
Change-Id: Icf07258cfb05a987e0a439277a59825c06f993b2
Reviewed-on: https://dart-review.googlesource.com/77486
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-10-02 00:33:37 +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
Ryan Macnak 607f4f5769 [vm] Get more helpful errors from Dart_SetVMFlags and Dart_MakeIsolateRunnable.
Bug: https://github.com/flutter/flutter/issues/12939
Change-Id: I76ddf2a6d3bb3775637d2eef87c7875c650de0a4
Reviewed-on: https://dart-review.googlesource.com/29680
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-05-01 20:54:38 +00:00
Vyacheslav Egorov 4fb15fcbf2 [vm/compiler] Consolidate compiler passes and share them between JIT and AOT.
Passes bodies are moved into compiler_pass{.cc,.h}.

Invoking a pass is just INVOKE_PASS(Name) now, instead of putting a bunch of
if-s and calls in compiler.cc or precompiler.cc.

We also consolidate ability to print IL and enable-disable passes under a
single flag --compiler-passes, e.g.

--compiler-passes=-Inlining,-CSE    disable inlining and CSE passes

--compiler-passes=Inlining+         print IL after Inlining pass and all
                                    subsequent passes

Change-Id: I90ff54b04a54f20099f5bf38dd45b16b8e3c4781
Reviewed-on: https://dart-review.googlesource.com/43968
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-03-01 16:43:58 +00: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
Ryan Macnak b09552cd62 Reapply "DWARF and unwind support for AOT assembly output."
This reverts commit 8fcdbb4a7f.

R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2761593002 .
2017-03-20 13:02:41 -07:00
Erik Ernst 8fcdbb4a7f Revert "DWARF and unwind support for AOT assembly output."
Gardening.

This reverts commit ca20aab384.

That commit causes generation of incorrect register names on
vm-noopt-simarm64-mac-be, and it seems to cause a disk full
error later on (making the bot purple).

Review-Url: https://codereview.chromium.org/2754233002 .
2017-03-17 12:57:45 +01:00
Ryan Macnak ca20aab384 DWARF and unwind support for AOT assembly output.
Emit CFI information to teach gdb how to unwind Dart frames. Fixes unwinding for Mac x64 and Linux x64/ARM/ARM64. Unwinding already worked for iOS ARM64. Fixes unwinding on Android 6+ ARM.

Emit DWARF information about function inlining and line number mappings. Works with gdb, addr2line and llvm-symbolizer.

With --dwarf-stack-traces, also remove CodeSourceMaps from snapshots and change stack traces to a non-compliant form resembling Android's debuggerd output, which can be passed to ndk-stack.

Issue #28785

R=fschneider@google.com, johnmccutchan@google.com, vegorov@google.com

Review-Url: https://codereview.chromium.org/2723213002 .
2017-03-16 13:08:54 -07: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
Siva Annamalai aaa0867567 More changes to use #ifndef PRODUCT ... #endif explicitly instead of relying on compiler magic.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2146713004 .
2016-07-14 11:13:13 -07: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
Florian Schneider 843cbca427 VM: Fix product build.
R=asiva@google.com
TBR=asiva@google.com

BUG=

Review URL: https://codereview.chromium.org/1728713002 .
2016-02-23 12:54:33 -08:00
Florian Schneider b870dafa4f VM: Separate precompilation-specific code, make flags const.
Move optimizations for precompilation into separate file.

Remove precompilation-specific code from flow_graph_optimizer.cc.

Add precompilation-flags: They are const in the precompiled runtime. Started moving flags to use the new flag-definition macros.

Add libdart_lib_precompiled target.

Define PRECOMPILED_RUNTIME_MACRO in more places (dart_precompiled_runtime)

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1714743002 .
2016-02-23 08:48:08 -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
Ivan Posva 9c0c6cb5c2 Add product mode:
- Add PRODUCT define and build mode to gyp configurations.
- Add product mode to test harness.
- Start to unify list of flags.
- Allow flags to be constant for particular build configurations.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1663863002 .
2016-02-03 21:10:30 -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
Todd Turnidge 4a3b6fe160 Rework the format of the FlagList response.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1149403007
2015-06-03 10:09:15 -07:00
Todd Turnidge 3d02f21309 Service protocol cleanups.
- ServiceEvent -> Event, protocol only.
- Use camel-case for StepOption
- Hide FlagType but make it camel-case too.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1156803003
2015-05-28 10:24:09 -07:00
turnidge@google.com 52538c5315 Tidy up the service protocol. Begin improving the documentation.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44865 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-02 19:16:35 +00:00
asiva@google.com 58c14696fb Fix a windows build issue
../../dart/runtime/vm/flags.cc:58:26: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
        OS::Print("%s: %"Pu64" (%s)\n", name_, *this->uint64_ptr_, comment_);

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43669 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 21:30:28 +00:00
regis@google.com d50fe1db24 Make instruction counter in simulators 64-bit (issue 22302).
This requires supporting uint64_t flag values.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43660 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 17:41:01 +00:00
regis@google.com f8711f2149 Improve debugger in MIPS simulator.
Validate integer flag values and allow hex flag values.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42139 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-05 18:37:11 +00:00
turnidge@google.com 8db11b79ac Show flags in Observatory.
Add vm support for setting flags through vm service (UI coming soon).
e.g.
  http://127.0.0.1:8181/#/flags/set?name=some_flag&value=100

--

I reworked the Flags class to use a growing array rather than a linked list to store flags.  This means that we don't need to go through the hassle of building an array and sorting every time that we print/printjson.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36712 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 21:27:17 +00:00
hausner@google.com c6101ca4b5 First step towards asynchronous loading of sources. With this change, sources are read asynchronously in dart code (builtin.dart) and when the i/o future completes, a callback in the VM loads and compiles the script or library code.
In a next step, the i/o will be moved to the service isolate so that not all isolates have to import dart:io.

Fallout from this change:
1) Loading has become a tad slower. Will have to investigate why.

2) Errors that happen during loading (file not found, compilation error in an imported library)  are no longer reported at the offending import clause. This can be fixed later if necessary by passing the import clause source location to the library tag handler.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36575 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-23 17:43:14 +00:00
iposva@google.com e4f262142e Fix http://dartbug.com/9137 :
- Use non-normalized name when complaining about unrecognized flags.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21811 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-22 12:59:44 +00:00
whesse@google.com 1c1029bb88 Sort the Dart vm flags before printing them out with the --print-flags option.
BUG=

Review URL: https://chromiumcodereview.appspot.com//10854224

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11031 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-21 11:18:18 +00:00
iposva@google.com a19795688b - Support "no_" as well as "no-" prefix on boolean flags.
Review URL: https://chromiumcodereview.appspot.com//9669016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5270 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-10 00:12:55 +00:00
iposva@google.com 8e5b5a02e2 Fix issue 1950:
- enable-checked-mode forces --enable_type_checks and --enable_asserts.
Review URL: https://chromiumcodereview.appspot.com//9668034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5269 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-09 23:21:09 +00:00
sgjesse@google.com bf67f24098 Move assert.h/assert.cc from runtime/vm to runtime/platform
The purpose of this change is twofold:

1. Source in the bin directory can now use the same assertions as
   source in the vm directory. The ASSERT macro used by the code
   in runtime/bin was just defined to use assert from the standard
   C library.
2. Moving other implementation parts from runtime/vm to
   runtime/platform (e.g. classes Monitor and Mutex) for sharing
   between runtime/bin and runtime/vm will be easier as these
   implementations rely on these assertion macros.

Created two gypi files for the platform directory. One for the
headers and one for the source. The source one is only included
when building the VM library and will be present in libdart.a
when the dart executable is linked.

All the code for asserts is still in the dart namespace.

Also re-arranged the order of includes to be alphabetically in
the files touched.

R=ager@google.com, iposva@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//9189003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3335 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-16 12:28:10 +00:00
srdjan@google.com 17552e9a3c Renaming type classes as discussed:
Type -> AbstractType
ParameterizedType -> Type

TODO: 

TypeArguments -> AbstractTypeArguments
TypeArray -> TypeArguments
Review URL: http://codereview.chromium.org//8761011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1987 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 16:54:52 +00:00
podivilov@google.com c692646f07 Introduce Dart_SetVMFlags API function.
It should be possible to set command line arguments without providing isolate init callback.

Review URL: http://codereview.chromium.org//8713012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1972 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 11:59:35 +00:00
asiva@google.com aaffbd2561 Support command line parameters to specify a url to file name mapping. This is used during snapshot generation so that a URL is mapped to a physical file name.
Review URL: http://codereview.chromium.org//8439061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1550 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-15 21:19:27 +00:00
srdjan@google.com db15f36789 Print also comments with --print_flags
Review URL: http://codereview.chromium.org//8413056

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@955 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-31 16:48:21 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00