Commit graph

11 commits

Author SHA1 Message Date
Zichang Guo 4ec72c1eb1 [VM-Runtime]Fix source report coverage to not include field without function initializer
Fix issue created by 89173. Also rename HasInitializer to HasInitializerFunction to distinguish from has_initializer.

Bug= https://github.com/flutter/flutter/issues/28542

Change-Id: Id9f898937c2f4f350a6d619019dc12611505801f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95680
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-03-07 02:04:41 +00:00
Zichang Guo 970390a36e Add field evaluation to source report generation
Change-Id: I62808852a35ef53c05ac1ea715d4559db46bb3d5
Reviewed-on: https://dart-review.googlesource.com/c/89173
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-01-18 19:15:44 +00:00
Jens Johansen db4271378f Allow SourceReport to have duplicate URL entries if the VM scripts does
When using a concatenated dill file, several scripts with the same URL
can exist. They are not the same though, and should not be treated as
such.

Bug: #34841
Change-Id: Icd46357ffcf72ed35251b2a2793e1f83c02c4a8e
Reviewed-on: https://dart-review.googlesource.com/c/80821
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-10-29 09:21:59 +00: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
Zachary Anderson 103881d01c Make header include guards great again
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER

This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.

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

Review URL: https://codereview.chromium.org/2450713004 .
2016-10-26 00:26:03 -07:00
Todd Turnidge 424ca27a15 Fix various nefarious problems with the script table used in source reports.
Before we could get duplicate or spurious script table entries.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2038203002 .
2016-06-06 11:22:46 -07:00
John McCutchan ffbd0b763a Add profile data to getSourceReport
- Add new getSourceReport kind 'Profile'.
- Add "profileTicks" to source ranges that have profile data.
- "profileTicks" is organized as three arrays: positions, inclusive ticks, and exclusive ticks. These arrays are indexed together.
- Keep source positions in profile sorted by token position value.
- Misc improvements to debug printing in profiler.
- Add unit test for profile getSourceReport.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1779333004 .
2016-03-14 07:04:23 -07: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 539ac23fb4 Add PossibleBreakpoints source reporting.
This allows tools developers to discover which token positions
correspond to possible breakpoints in the code.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1586253002 .
2016-01-15 09:02:38 -08:00
Todd Turnidge 61d9752c7e Expose the new _getSourceReport api in the service protocol.
Allow multiple reports to be requested simultaneously.

I'm not exposing this publicly yet -- still nailing down the format a bit.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1566793002 .
2016-01-06 13:01:33 -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