Commit Graph

42 Commits

Author SHA1 Message Date
Srdjan Mitrovic 420843a75f Clone both descriptor and data array when compiling in background. Eliminates crashes when ic_data array invocation counter is changed while compiling (e.g., NumberOfUsedChecks can change on the fly).
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1700463002 .
2016-02-12 14:54: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 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
Todd Turnidge 26af34a1b3 Add SourceReport, a class for generating Dart source-level reports.
These reports provide information tied to token positions in the
Dart source program.

SourceReport can generate multiple kinds of reports.  Right now it
implements code coverage and call site reports.  In the future it
could provide, for example, valid breakpoint sites or source-level
profiles.

Scripts are refered to by index within the report and a script table
is tacked on the end.  This avoids a bit of duplication.

In a future cl I will expose this reporting through the vm service.
After that, we can remove our older coverage/callsite code.

----------
Very simple, sample coverage report:

{
  "type": "SourceReport",
  "ranges": [
    {
      "scriptIndex": 0,
      "startPos": 0,
      "endPos": 4,
      "compiled": true,
      "coverage": {
        "hits": [],
        "misses": []
      }
    },
    {
      "scriptIndex": 0,
      "startPos": 6,
      "endPos": 10,
      "compiled": false
    },
    {
      "scriptIndex": 0,
      "startPos": 12,
      "endPos": 39,
      "compiled": true,
      "coverage": {
        "hits": [ 23 ],
        "misses": [ 32 ]
      }
    }
  ],
  "scripts": [
    {
      "type": "@Script",
      "fixedId": true,
      "id": "libraries\/15\/scripts\/test-lib",
      "uri": "test-lib",
      "_kind": "script"
    }
  ]
}

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1533653003 .
2016-01-04 10:56:52 -08:00
Matthias Hausner 648e52baa8 Collect closure functions in isolate
Instead of collecting closures functions in each class object, maintain one list per isolate. This is a step towards getting rid of top-level classes.

I'd appreciate if John could take a look at the service isolate and coverage related change.

I'd appreciate if Ryan could take a look at the precompilation related change.

When compiling all of corelib, the list of closures in the isolate is about 600 entries long. If this linear list should become a bottleneck, I'll deal with it later. (Sadly, some code relies on the fact that a closure can be identified with a list index, so making it a hash table instead of an array does not work.)

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1436243005 .
2015-11-17 15:40:27 -08:00
Srdjan Mitrovic 44ccbb5e29 Copy ICData descriptors when starting background compilation, so that they do not change while compiling
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1414933006 .
2015-10-28 10:19:35 -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
Srdjan Mitrovic 8c7a94e9f4 Preparation for moving reusable handles to thread and more cleanups: isolate -> thread based handle allocation.
BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org/1384403002 .
2015-10-06 10:17:12 -07:00
Zachary Anderson 16393ee9c6 Uses SNPRINT macro where possible. Otherwise uses #define for format.
I was able to convert 49 SNPrint(NULL, 0, ...) patterns to use the
macro. I had to use a #define for the format string 5 times due to
uses that didn't fit the macro.

2 occurences of SNPrint(NULL, 0, ...) had >=2 possibilities for the
format string based on runtime values, and I didn't try to convert
them.

Fixed ~10 format strings.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1331623002 .
2015-09-11 00:18:14 -07:00
Todd Turnidge e3516459b7 Do less work while computing call site info.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1310083003 .
2015-09-04 15:03:58 -07:00
Todd Turnidge 8d68f91055 Do not emit coverage/callsite info for implicit closure functions.
They are all forwarding functions now, and this was causing some
oddities in the observatory UI where some functions had coverage info
on their first line and some didn't.  The coverage info always
reflected merely whether or not the closure had been invoked yet,
which was confusing.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1330703002 .
2015-09-04 14:48:34 -07:00
Ivan Posva 6446cc5096 - Do not access the first character in zero-length strings.
- Make sure to print all 64-bits of the Dart_Port if necessary.

R=ricow@google.com

Review URL: https://codereview.chromium.org//1326853003 .
2015-09-02 23:22:16 -07:00
Ivan Posva 4bd7cdc75c - Ensure that HandleScope is initialized with a thread. (Remove
deprecated isolate based API.)
- Update all code impacted by this change. E.g. DARTSCOPE
- TEST_CASE now passes the current thread as a parameter to the   unit test.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1310463005 .
2015-09-01 17:18:55 -07:00
Daniel Andersson c089a152ac Migrate most uses of Isolate::current_zone to Thread::zone.
After https://codereview.chromium.org/1204303003/ is submitted, the last remaining uses can go.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1220193009 .
2015-07-08 09:59:32 -07:00
iposva@google.com a1854d45ac Fix http://dartbug.com/23290
- Ensure that we do have unoptimized code available when generating
  coverage information.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45419 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-24 23:31:15 +00:00
rmacnak@google.com 3b8bed46a8 Display ICData entries at call sites, with links to the targets and guarded classes. Implement service response for call site data for the same targets as coverage. Fix JSONifying ICData for super calls.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44564 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-18 20:28:26 +00:00
koda@google.com 9c181ec6d5 Thread/Isolate refactoring: new(Isolate*) -> new(Zone*)
Refactor all remaning cases where the current zone is used through new(Isolate*) and remove this interface.

Removing this interface is needed to move towards multiple threads per isolate, and also makes the caller more aware of the scope of the zone used, reducing the risk of use-after-free.

Make the current thread and the stack zone created around native/runtime entries directly available in their body, saving an indirection (and optimized away if unused).

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44541 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-17 19:24:26 +00:00
turnidge@google.com e65e6fab9d Begin migrating the vm service from a rest-style interface to a json-rpc style interface.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43370 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-02 23:15:40 +00:00
srdjan@google.com 154eb30f58 ONe more iteration of PcDesacriptor iterator imporvement: do not copy record but access individual values when needed.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38408 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-18 20:11:29 +00:00
srdjan@google.com 1259bda234 Fix PcDescriptor iterator to never return a pointer to a memory location since the PcDescriptor can move with the GC.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38338 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-17 18:30:38 +00:00
mlippautz@google.com a97bafab93 vm/observatory: Clean up script access
Addresses issues from https://codereview.chromium.org/346003003/

BUG=
R=hausner@google.com, johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38264 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-15 22:55:19 +00:00
srdjan@google.com 9c8a395f6f More PcDescriptor cleanups, compress recors if no try index is needed (frequent).
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38242 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-15 17:07:03 +00:00
mlippautz@google.com e0d40e8d3b BUG=
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38165 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-11 18:39:09 +00:00
srdjan@google.com 4c69c06f27 Specify descriptor kind to iterate on.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38128 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-10 19:44:49 +00:00
srdjan@google.com 2bb77cd8d5 Iterate over PcDescriptors only via iterators, not via an index. (preparation for more compression of PcDescriptors).
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38032 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-07 18:25:45 +00:00
mlippautz@google.com f2db35a741 Coverage API supports proper filtering
(Partly) addressing concerns of https://codereview.chromium.org/346003003/

BUG=
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37793 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-27 17:51:52 +00:00
mlippautz@google.com 85ce6bffb9 Coverage data for single entities can be obtained by querying:
* script: isolate/id/script/name/coverage
 * class: isolate/id/class/id/coverage
 * library: isolate/id/library/id/coverage

Some numbers (curl on vm service):
 * old base line (full coverage of dart:core + script computing faculty): ~1.2s
 * generation for just the script file: ~12ms
 * generation of dart:core (after executing fac script): ~150ms
 * generation of dart:core-patch/array.dart: ~12ms

BUG=
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37676 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-25 00:06:53 +00:00
mlippautz@google.com bcd02501f8 coverage: Improve generation, see below.
* Ignore non-valid PC descriptors, i.e., descriptors where tokens are not
   within range of the actual function.
 * Merge line data where it would be consecutively emitted.

BUG=
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37662 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-24 16:41:36 +00:00
srdjan@google.com 58fd318f4c Cleanup: use a ZoneGrowableArray instead of Array for ICData map.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37400 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-17 15:52:05 +00:00
srdjan@google.com e3a00fa4e5 Add SetLength to GrowableArray and use it in code coverage.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37215 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-10 23:43:54 +00:00
srdjan@google.com 112ab3aef2 Significantly improve performance of code coverage tool by precomputing a map token_pos->line number.
R=asiva@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37203 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-10 21:37:52 +00:00
iposva@google.com b4b4889406 - Refined https://codereview.chromium.org/293963008/
Make compilation VM more fine grained

- Use the isolate where appropriate.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36451 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-21 21:04:03 +00:00
turnidge@google.com 9243ffc4ff Always use the same json for null in the vm service.
PrintToJSONStream -> PrintJSON.

ALSO:

Fix <em> tags in the Observatory.

BUG=
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35532 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-29 18:10:02 +00:00
johnmccutchan@google.com 6edd276df8 Switch Observatory to use only ServiceObject instances.
All fetched objects are upgraded to a ServiceObject.
ServiceObjectCache.
Uniform updating / refreshing.
Fix UTF8 string escaping in TextBuffer (should fix invalid character bug https://code.google.com/p/dart/issues/detail?id=16590)

R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33541 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-11 17:48:09 +00:00
johnmccutchan@google.com a6399981e6 Code coverage in Observatory
R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31970 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-22 00:46:30 +00:00
iposva@google.com 3423572926 - Harden coverage generation, by not attempting to compile
un-compilable functions.
- Only register closure functions in the class when they
  have been properly setup.
- Make sure to compile closure functions when calling CompileAll.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28282 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-04 20:50:16 +00:00
iposva@google.com fbec69dca1 - Fix typos and add comments.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28180 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-02 20:52:15 +00:00
mlippautz@google.com 1941e151ea Improve code coverage generation.
- Remove function name from output.
- Remove column from output (side effect: We can use fast version of
  GetTokenLocation())
- Insert HANDLESCOPES
- Fold source file entries where easily possible, i.e., fold consecutive entries
  created by functions in the same source file.
- Change format to

  [{
     "source": "...",
     "hits": [<line>,<hitcount>, ...]
   }, ... ]

BUG=
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28030 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-27 23:22:49 +00:00
iposva@google.com 9b8358c505 - Fix C++11 string literal requirements.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27727 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-20 23:12:47 +00:00
iposva@google.com d0b681f354 - Write the coverage data to a file instead of printing to stdout.
- Explicitly include lines with zero hits.

R=asiva@google.com, mlippautz@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27726 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-20 21:37:48 +00:00
iposva@google.com 52a736ee38 - Disallow copy constructors.
Review URL: https://codereview.chromium.org//23903034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27346 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-10 17:47:55 +00:00
iposva@google.com 74b2a34d5b - Base JSON stream printing on stack objects.
- Simplify creation of a JSONStream.

- Add experimental coverage output to the VM.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27344 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-10 17:21:59 +00:00