Commit Graph

1132 Commits

Author SHA1 Message Date
Ryan Macnak 7293be3403 Add event for script snapshot reading with the snapshot size and resulting heap size.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1885503005 .
2016-04-14 15:39:36 -07:00
Ivan Posva 5be5d54529 - Refactor Symbol allocation to expect a thread parameter.
- Preallocate all tokens as symbols to avoid repeated lookups.
- Pass thread/zone where useful while doing this change.
- Avoid allocating symbols for error messages.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1870343002 .
2016-04-11 16:28:29 -07:00
Ryan Macnak 260ea83950 Disable string externalization by default.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1875733003 .
2016-04-08 10:56:14 -07:00
Matthias Hausner 425b9a36b9 Use symbols when looking up fields in a class
The slow string comparison is only necessary when looking up
non-symbols or untangled private names.

Compiling all of dart2js seems to be about 1% faster, but it's really in the noise.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1868803002 .
2016-04-07 16:36:35 -07:00
Ryan Macnak 34e4107c0d Add flag to disable string externalization, allowing the compiler to rely on string class checks remaining valid across calls.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1859273002 .
2016-04-07 13:24:44 -07:00
Srdjan Mitrovic 706ea55404 Fix background compilation issues when creating snapshots.
- Stop background compilation early enough
- Restore symbol table after completing snapshot writing.
- Create symbols instead fo strinfs (error caught with --no-use_lib_cache)

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1852393004 .
2016-04-04 16:40:46 -07:00
John McCutchan 6302c1cc41 Add API to set thread name
BUG=
R=chinmaygarde@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1851953002 .
2016-04-04 07:12:57 -07:00
John McCutchan ad0878d1a8 Remove redundant timeline API
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1848683002 .
2016-03-31 09:13:54 -07:00
John McCutchan d8df41c483 Add support for async, metadata, and counter timeline events to be reported by the embedder
Fixes #26142

R=chinmaygarde@google.com

Review URL: https://codereview.chromium.org/1849643002 .
2016-03-30 16:45:46 -07:00
Srdjan Mitrovic 40d8eee81e Remove unnecessary isolate argument from some visitors
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org/1838373002 .
2016-03-29 14:47:51 -07:00
John McCutchan 80967ca4e5 Add API timeline durations for snapshot creation
- Useful for tracing Dartium startup....

R=asiva@google.com

Review URL: https://codereview.chromium.org/1844553003 .
2016-03-29 09:02:15 -07:00
Florian Schneider f3de2377ab Move the VM's typed_data implementation to runtime/lib.
This removes the additional indirection to the VM's implementation
for all the factory constructors.

Additionally, it removes one class per typed data list type, thus reducing
snapshot and generated code size.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1790593002 .
2016-03-21 13:39:49 +01:00
Siva Annamalai f7d2b2e31e - Fix for issue 25950 (add registration of a thread exit callback)
- Moved some of the file and entropy callbacks to class Dart from
  class Isolate as they are not isolate specific.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1807293002 .
2016-03-17 13:40:20 -07:00
John McCutchan c65114b6b4 Timeline API fixes for Flutter
API changes:

- Remove isolate specific Timeline APIs.
- Remove Dart_EmbedderTimelineGetTimeline callback.
- Add Dart_TimelineEvent so that arbitrary trace events can be added.

Internal changes:

- Remove isolate specific streams which were never used or controllable from outside the VM.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1811613002 .
2016-03-16 12:18:46 -07:00
John McCutchan 9bc7398eb8 Ensure embedder timeline callbacks are called for service protocol requests
BUG=
R=chinmaygarde@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1799933002 .
2016-03-15 07:59:04 -07:00
John McCutchan 60de126a68 Fix product build
BUG=

Review URL: https://codereview.chromium.org/1803763003 .
2016-03-14 12:56:24 -07:00
John McCutchan 53cae0aed9 Add ability for embedder to provide private timeline trace data
- Add three new embedder hooks registered with Dart_SetEmbedderTimelineCallbacks
  - Dart_EmbedderTimelineStartRecording
  - Dart_EmbedderTimelineStopRecording
  - Dart_EmbedderTimelineGetTimeline

- Add unit test for record start / stop notification.
- Add unit test for get timeline.

This should allow Flutter to remove their hacked up timeline service RPCs.

R=chinmaygarde@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1783953002 .
2016-03-10 13:32:48 -08:00
Srdjan Mitrovic 60ce67d91f Fix sticky error propagation from thread to isolate
BUG=
R=asiva@google.com, iposva@google.com

Review URL: https://codereview.chromium.org/1769183003 .
2016-03-09 12:40:43 -08:00
Ivan Posva 9535aa6426 - Remove loading of observatory assets from dart_bootstrap.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1766833002 .
2016-03-04 16:05:54 -08:00
Florian Schneider 48b0183926 Make precompiler work with product mode.
For now, change compilation-related flags to be regular
command line options. They won't affect the size of the
precompiled runtime anyway since the compiler is not included
there.

Also introduce a separate switch for precompiled runtime. This can be
 used instead of the macro since it is a compile-time constant in the
 precompiled runtime.

BUG=

Review URL: https://codereview.chromium.org/1759913002 .
2016-03-02 13:59:54 -08:00
Siva Annamalai e83151cc77 - Add assertions in MutexLocker/MonitorLocker to ensure that the code enclosed
in these blocks will not have a safepoint operation
- changed boxed_field_list_monitor_ to boxed_field_list_mutex_ as we only
  need a mutex for guarding access to boxed_field_list_ as changed the
  lock to use SafepointMutexLocker as the list addition code could potentially
  allocate and result in GC (safepoint operation)
- Added a SafepointMonitorLocker as we have a function Isolate::VisitIsolates
  which could potentially have safepoints in the enclosed block.
- Make the lock around MegamorphicCacheTable::Lookup a SafepointMutexLocker
  as the look up code seems to be allocating memory while the lock is held.
- Changed the ThreadPool and MessageHandler code to account for the new
  MonitorLocker usage standard
- Fixed PortMap::PrintPortsForMessageHandler to use SafepointMutexLocker as
  the code it encloses calls into Dart
- Removed profiler_ field in class Profiler as it doesn't seem to be used.

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

Review URL: https://codereview.chromium.org/1748953003 .
2016-03-01 12:33:50 -08:00
Florian Loitsch 55630a5e90 Support 'dart.library.X' env variables in the VM.
BUG= http://dartbug.com/24587
R=iposva@google.com, johnmccutchan@google.com

Committed: https://github.com/dart-lang/sdk/commit/c2a06e22cb83f491fd3accc33d7738c87490c26d
Reverted: https://github.com/dart-lang/sdk/commit/5eb5b429895987519a00daa81b5ab261debbca3f

Review URL: https://codereview.chromium.org/1640853004 .
2016-02-29 20:58:32 +01:00
Srdjan Mitrovic 5a69e3661b In background compilation make a copy of Field in order to freeze its state. Add flag --force_clone_compiler_objects for debugging purpose.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1722733002 .
2016-02-26 09:07:49 -08:00
Ivan Posva 8d18298fed - Remove Isolate::Flags structure and store flags directly in isolate.
- Make enable_asserts, enable_type_checks, error_on_bad_override and
  error_on_bad_type release mode flags only.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1737693003 .
2016-02-25 18:06:56 -08: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
John McCutchan 8266501a72 Remove mirrors in product mode
(stripped) dart_product before: 5307888
(stripped) dart_product after: 5232976

Reduction in size: 74912 bytes.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1712843002 .
2016-02-22 09:55:20 -08:00
John McCutchan fda3a9bc2b Remove more things
(stripped) dart_product before: 5307888
(stripped) dart_product after: 5275088

Reduction in size: 32800 bytes.

Removed entirely:

- debuginfo*
- elfgen*
- gdbjit*
- TraceBuffer
- vtune support

Removed in product:

- Compiler stats
- Code observers

R=asiva@google.com

Review URL: https://codereview.chromium.org/1711163002 .
2016-02-22 08:53:11 -08:00
Ivan Posva c822c34af6 - Add DEBUG_ONLY and NOT_IN_PRODUCT macros.
- Remove user_name_ field from RawClass using macros.
- Consolidate "#ifndef PRODUCT" and "#ifdef DEBUG" code using macros.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1715123003 .
2016-02-19 17:48:08 -08:00
Florian Schneider 1f7458ddf8 VM: Precompiled rodata snapshot.
For now only contains PC descriptors and stack maps and one-byte strings.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1584443002 .
2016-02-15 09:15:26 +01:00
Srdjan Mitrovic 72528aba85 Fix background compilation crashes due to allocation of types in new space. Remove default arguments of InstantiateFrom and others where space argument is being passed, in order to preemptively fix crashes and prevent future problems (always be explicit where the type is allocated, make sure the 'space' argument is propagated).
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org/1691163002 .
2016-02-12 09:05:08 -08:00
Siva Annamalai e4813b0e0a Fix for issue 27094147 (Null pointer deref in IsScriptSnapshot).
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1683243002 .
2016-02-10 11:08:31 -08:00
John McCutchan e2e7af1229 Remove more feature in product mode
- Remove Timeline.
- Remove more vmservice code.
- Remove AST printing.
- Remove IL printing.
- Remove profiler.
- Remove thread interrupter.
- Remove disassembler.
- Remove Library::CheckFunctionFingerprints.

- Update test status files for product mode.

Size of dart_bootstrap before: 5287631
Size of dart_bootstrap after: 5112783

Reduction in size: 174848 bytes.

Total reduction in size (382734 + 174848): 557582 bytes.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1678203002 .
2016-02-09 08:45:32 -08:00
Florian Schneider 117c7b0d3e Initial split of precompilation code from compiler.cc
This removes precompiler code from the regular JIT-mode VM, and allows us to add
more precompilation-specific optimizations without affecting the JIT compiler.

Remove JIT-related code from precompiler pipeline:
No type feedback, no OSR, no deopt, no block reordering, no background compilation

With precompilation, use precompiler pipeline for static initializers and const expressions as well.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1663163003 .
2016-02-09 11:29:13 +01:00
Srdjan Mitrovic 4316d1bd17 Move sticky_error_ from isolate to thread
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1672853002 .
2016-02-05 15:46:55 -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
John McCutchan 9ecf1a5f31 Add Dart_GetMessageNotifyCallback for querying the current message notify callback
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1665253003 .
2016-02-04 14:35:09 -08:00
Florian Loitsch 5eb5b42989 Revert "Support 'dart.library.X' env variables in the VM."
This reverts commit c2a06e22cb.

Review URL: https://codereview.chromium.org/1668253002 .
2016-02-04 22:26:06 +01:00
John McCutchan bb2e633498 Fix some API documentation bugs in new pause on start exit APIs
BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org/1655393004 .
2016-02-04 09:27:06 -08:00
Florian Loitsch c2a06e22cb Support 'dart.library.X' env variables in the VM.
BUG= http://dartbug.com/24587
R=iposva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1640853004 .
2016-02-04 13:04:31 +01:00
John McCutchan 6f76e2af99 Add necessary support functions so that embedders can implemented pause on start and exit
- Add Dart_ShouldPauseOnStart, Dart_SetShouldPauseOnStart, Dart_IsPausedOnStart, Dart_SetPausedOnStart, Dart_ShouldPauseOnExit, Dart_SetShouldPauseOnExit, Dart_IsPausedOnExit, Dart_SetPausedOnExit to query and control pause on start / exit from outside of the default message handler.
- Add Dart_HandleMessages to process all regular messages from outside the default message handler.
- Allow per isolate overriding of pause on start / pause on exit flags.
- Set the resume_request bit when resuming from isolate start / exit.
- Clear the resume_request bit in the default message handler.
- Rename MessageHandler fields and accessors.
- Rename Isolate::Resume to Isolate::SetResumeRequest.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1665773004 .
2016-02-03 15:33:40 -08:00
Ryan Macnak af10c8ceb7 Precompilation: when removing top-level fields and functions, also remove them from the library dictionary.
precompiled dart2js x64 21545468 -> 21521876 (-0.11%)

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1643023003 .
2016-02-03 13:11:49 -08:00
Todd Turnidge 67fb2ac508 Fix build.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1655383003 .
2016-02-03 12:23:38 -08:00
Todd Turnidge 6ed1a58741 Dart_SetReturnValue now accepts and propagates error handles.
The error propagation is delayed until the native function returns.

This should simplify error handling in embedder code and avoid failing
to propagate an error, which is a common failure.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1663613002 .
2016-02-03 11:20:02 -08:00
Florian Schneider 0f48690061 VM: Replace dart --noopt with new binary target dart_noopt.
This allows us to exclude precompiler related code from the standalone
JIT VM, and only have the precompiler included in dart_noopt and dart_no_snapshot
(which is used to generate precompiled snapshots)

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1661703002 .
2016-02-02 17:51:15 -08:00
John McCutchan d77d376124 Replace intptr_t with TokenDescriptor
- Use TokenDescriptor instead of intptr_t for all token positions.
- Use TokenDescriptor in raw_object instead of int32_t.
- TokenDescriptor is a POD with an int32_t (this shrinks the size of AST and IR nodes by 32-bits on 64-bit architectures).

There are some cleanups I plan on doing as a follow up CL:

- Replace TokenDescriptor::value() with TokenDescriptor::TokenPos()

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

Review URL: https://codereview.chromium.org/1644793002 .
2016-02-02 10:15:44 -08:00
Siva Annamalai 36515b8bbb - Add missing transition in Dart_ThrowException and Dart_ReThrowException
- Fixed some typo in other places

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1658783003 .
2016-02-01 16:02:51 -08:00
Siva Annamalai 2a2c34abd7 Fix windows build compilation error.
Review URL: https://codereview.chromium.org/1659553002 .
2016-02-01 11:22:03 -08:00
Siva Annamalai e72c1fb47d Implement safepointing of threads :
- uses thread execution status transition to track when a thread is in a safepoint or needs to block for a safepoint
 - introduces a monitor per Thread object
 - uses a per thread safepoint handshake between the thread requesting a safepoint and the requested thread.

The ThreadRegistry class now contains only the thread list for an isolate and the functionality of scheduling a thread onto an Isolate and unscheduling it from teh isolate. We could fold this functionality into the Isolate class in a different CL.

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

Review URL: https://codereview.chromium.org/1541073002 .
2016-02-01 10:57:34 -08:00