Commit Graph

38 Commits

Author SHA1 Message Date
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
Jens Johansen 9837563cd1 Kernel debugging; service tests
- Offsets on more stuff
- Status file for kernel
 -> Testing with (before fasta)
    ```
    python tools/test.py -mrelease -cdartk --no-tree-shake --no-dfe service
    ```
    now shows everything as passing.
    Reload stuff, and evaluation stuff (e.g.) has been disabled though.
- Lots of new service tests that tests what positions we stop at when
  saying next.

As fasta has now landed debugging does not currently work, but this is still needed in order to both test better and allow for proper kernel debugging support.

R=hausner@google.com, kmillikin@google.com

Review-Url: https://codereview.chromium.org/2680303002 .
2017-03-07 09:43:59 +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
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
Matthias Hausner ebec1d19f9 Fix build
BUG=

Review URL: https://codereview.chromium.org/1971893003 .
2016-05-11 14:33:25 -07:00
Matthias Hausner 68a6060794 Eliminate GrowableTokenStream
Eliminate building an intermediate array of tokens in the scanner. Build
the compressed TokenStream directly instead.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1969563002 .
2016-05-11 14:09:45 -07:00
Matthias Hausner 444665465c Small fix in Scanner
Use intptr_t instead of TokenPosition to denote the index of
a token in the token stream.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1968143002 .
2016-05-11 10:49:40 -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
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
John McCutchan 77101d63e3 Source positions for constructors and lots of async machinery
- Rework token position address space.
- Use ClassifyingTokenPositions::kMethodExtractor for the token position of a method extractor.
- Plumb token positions through all of Ast Transformer.
- Plumb token positions for temporary expressions, etc in Flow Graph Builder.
- Add token positions for parts of the await machinery.
- Move ClassifyingTokenPositions into token.h.
- Remove default token position of Scanner::kNoSourcePos for many IR instructions.
- A couple of unit tests.
- Use synthetic token positions for synthetic AstNodes.
- Fix SLEB128 encoding / decoding + test
- s/Scanner::kNoSourcePos/Token::kNoSourcePos.
- Remove >= 0 and < 0 checks against token positions and use helpers instead.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1589643002 .
2016-01-19 15:01:08 -08:00
John McCutchan cb8b641cc9 Make Scanner::kNoSourcePos be a true sentinel value
- It is possible to write a Dart program with a function token_pos of 0.
- Switch Scanner::kNoSourcePos from 0 to -1.

R=hausner@google.com

Review URL: https://codereview.chromium.org/1564493002 .
2016-01-06 09:06:28 -08: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
rmacnak@google.com cefb21b6a3 Narrow String::CharAt from int32_t to uint16_t.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40178 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 20:55:36 +00:00
srdjan@google.com c2d30c3c0b Scanner cleanups: use isolates to allocate handles and zone objects; remove C-heap allocation of structs.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37053 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-05 22:04:17 +00:00
srdjan@google.com 5f80480eea Improve scanner performance by remembering string's CharAt function as the string type does not change during scanner's lifetime.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37052 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-05 21:06:24 +00:00
ajohnsen@google.com ed29c2b81f Speed up identifying keywords in scanner, by using extra table.
The table maps the first character of a identifier, to the first keyword
intry in the sorted token-list. If no keyword exists that starts with a
given character, we don't enter the loop at all.

BUG=
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36934 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-03 20:14:24 +00:00
hausner@google.com a64a32382b Small cleanup: move all library private key code to Library class
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32522 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-10 22:28:07 +00:00
hausner@google.com 0c434b3073 Rename kDummyTokenIndex to kNoSourcePos
Addresses comment to previous change list.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31969 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-21 23:46:26 +00:00
hausner@google.com 5e90c211c7 Add Dart keyword symbols to the VM isolate
Remove the keyword symbol table from object store, and remove
keyword table initialization from Scanner constructor.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30285 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-14 19:14:16 +00:00
iposva@google.com d369b7a0c9 - Ensure that the token stream from generated source matches the
original token stream in the presence of combinations of
  multiline string and string interpolation. If not this will
  cause mismatches when accessing code snippets, e.g when
  reporting parser errors or assertions.
- Ensure that ScanAll and ScanTo are in sync when adding or
  counting tokens.
- Added unit test for multiline strings and interpolation.
- Expanded GenerateSource unit test to iterate through all
  loaded libraries.
- Do not report columns for compilation errors in snapshotted
  code.
- Do not report columns from exceptions and errors when dealing
  with snapshotted code.
- Remove length field from TokenDescriptor. It was unused.
- Remove TokenStream::ComputeTokenPosition. It was unused.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29110 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-23 19:08:36 +00:00
hausner@google.com 7eaea8b300 Discard first line of multiline string if only whitespace
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27895 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-25 17:26:55 +00:00
mlippautz@google.com 728c46ca4f Make Script::GetTokenLocation() and Script::TokenRangeAtLine() use token streams
where possible.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27786 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-23 23:24:59 +00:00
mlippautz@google.com 4fa46b7148 Introduce newline tokens into the token stream.
CL only introduces the tokens into the compressed token stream. We do not
use the newline tokens (yet).

Overhead:
snapshot: 6.4% (860k/808k)
compressed token stream (gen_snapshot): 21% (314312/259907)

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27677 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-19 21:46:50 +00:00
rmacnak@google.com ed4fbd6255 Removed dead code: ConsumeIdentChar
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24377 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-24 23:47:00 +00:00
hausner@google.com 89346f3e3a Remove legacy syntax support for library import
Remove legacy syntax for #import, #library and #source
Update test programs
Recalc fingerprints of inlined functions that were apparently
affected by the change of library name from "dart:io" to dart.io.
Review URL: https://codereview.chromium.org//12880023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20466 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-25 18:11:08 +00:00
cshapiro@google.com 979571d3ee Use a signed 32-bit integer for representing code points.
Review URL: https://codereview.chromium.org//11419086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15188 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-21 00:30:27 +00:00
erikcorry@google.com 84da84c22d Revert "Add some support for the code-point code-unit distinction."
This reverts commit r15150

R=karlklose@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15152 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-20 15:23:41 +00:00
erikcorry@google.com 547cbf9da6 Add some support for the code-point code-unit distinction.
Adds String.fromCodeUnits and String.codeUnitAt, and modifies
String.fromCodePoints and String.codePointAt to actually use code points.
Fixes String.charCodes to use code points and adds String.codeUnits.
Reenables some tests, and adds new ones for non-BMP characters.
Fixes issues 6418, 6501 and 1357.

R=floitsch@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15150 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-20 14:51:25 +00:00
iposva@google.com 7ae807a19c - Move MathNatives from dart:core to dart:math.
- Split out double and integer parsing from MathNatives.
Review URL: https://codereview.chromium.org//11316031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15032 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-16 19:42:02 +00:00
hausner@google.com 3aedbb74e8 Better breakpoint placement
Instead of using token distance to find the first possible breakpoint
position in a line, use generated code address, so the debugger
breaks before the first call on a source line.

Fix issue 3653 
http://code.google.com/p/dart/issues/detail?id=3318
Review URL: https://chromiumcodereview.appspot.com//10686003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9176 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-27 16:13:49 +00:00
cshapiro@google.com 36f57531ec Reject high- and low-surrogates in escaped code points.
BUG=3097

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7725 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-17 22:57:00 +00:00
asiva@google.com 33d2e2fe26 Changes to shrink the token stream representation from two words to one word.
On standalone dartium which has about 50000 tokens in the libraries (core, coreimpl, builtin, io etc.) this reduces the heap size by about 180kb. The size of the standalone snapshot buffer reduces by about 72kb.

Also moved the keyword symbol table to the object store so that it does not have to repopulated on every script compilation. Should benefit regular user script load times.
Review URL: https://chromiumcodereview.appspot.com//9462003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4734 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-29 02:46:29 +00:00
regis@google.com 2edb4ae9c7 Add token index position to classes and types for more accurate error reporting.
Review URL: https://chromiumcodereview.appspot.com//9325047

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3965 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-06 19:52:02 +00:00
srdjan@google.com 9e77768c91 Fix for bug 1229: Unary operator plus is not allowed ... except for literals.
Add tests for incorrect literals, e.g. "+ 5".

Added a temporary token kTIGHTADD that represents an ADD not terminated by a whitespace. It is temporary and eliminated in the parser (code generator ot AST do not see it). It is used to recognize correct literals.
Review URL: https://chromiumcodereview.appspot.com//9264051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3745 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-31 20:05:24 +00:00
hausner@google.com 3ebdf081ca Set breakpoint at url, line number
Add debugger functionality to set breakpoint at given url and line number.
Review URL: https://chromiumcodereview.appspot.com//9240014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3420 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 23:15:56 +00:00
asiva@google.com ce606eda7b Library prefix should be an identifier
(we don't yet check that it is not a reserved keyword, that can be done only
after we are able to store the keyword table as a singleton in the vm isolate)
Review URL: http://codereview.chromium.org//8500006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1720 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-21 22:17:41 +00:00
hausner@google.com 8a6a9e645d Better error handling when scanning library tags
Fixes Issue 516 
http://code.google.com/p/dart/issues/detail?id=516

#!/dart_bin
##library("foo");

void main() {
  print("goodbye");
}


Errors encountered while loading script: '/private/tmp/t.dart': Error: line 2 pos 2: Unrecognized library tag
##library("foo");
 ^
Review URL: http://codereview.chromium.org//8586052

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1664 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-18 17:50:32 +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