Commit Graph

14 Commits

Author SHA1 Message Date
Daniel Clifford
bb065aa900 [torque] Implement transient types and checking
In the process implement TopType to express undefined values and
transient types after they no longer are valid, as well as checks to
make sure that transtioning callables are transitively marked
to express if they or their call chain modify transient types.

Bug: v8:7793
Change-Id: Idb237e878d3a511a4f460b6510ffd4876593951d
Reviewed-on: https://chromium-review.googlesource.com/c/1297963
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57052}
2018-10-29 07:48:20 +00:00
Daniel Clifford
ce00ea8085 Fix formatting of Torque unions
TBR=tebbi@chromium.org
NOTRY=true

Change-Id: I2c5a1fc18efbbef7fd407000fa560bb75e5dc145
Reviewed-on: https://chromium-review.googlesource.com/c/1297324
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56945}
2018-10-24 13:31:53 +00:00
Daniel Clifford
2bb47567ac Fix formatting of Torque union types
Change-Id: Id5e25509cba272083caee62a1ae7420f77f3fa50
Reviewed-on: https://chromium-review.googlesource.com/c/1297949
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56937}
2018-10-24 12:41:14 +00:00
Daniel Clifford
b51053d89e Reland: [builtins] Implement Array.prototype.slice in Torque
In the process:

- add volatile types for FastJSArray and remove the length_fast accessor
  from JSArray with the application of more rigorous typing.
- add micro benchmarks for testing all the interesting slice cases

Also update a few assorted places in .tq code to make them more
idiomatic.

The original version of this patch had an overly agressive assert that has
been loosened.

TBR=jgruber@chromium.org

Change-Id: I56870862f4b124d1b38372daa326182a526c874c
Reviewed-on: https://chromium-review.googlesource.com/c/1291375
Reviewed-by: Daniel Clifford <danno@chromium.org>
Commit-Queue: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56829}
2018-10-19 21:27:19 +00:00
Sigurd Schneider
5bc96c9191 Revert "[builtins] Implement Array.prototype.slice in Torque"
This reverts commit 41ba3d3eb0.

Reason for revert: Speculative revert:
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Fuzzer/27370
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20predictable/19895

Original change's description:
> [builtins] Implement Array.prototype.slice in Torque
> 
> In the process:
> 
> - add volatile types for FastJSArray and remove the length_fast accessor
>   from JSArray with the application of more rigorous typing.
> - add micro benchmarks for testing all the interesting slice cases
> 
> Also update a few assorted places in .tq code to make them more
> idiomatic.
> 
> Change-Id: I76ec2bb25b65a869180af1f7288419dc1f0a9c37
> Reviewed-on: https://chromium-review.googlesource.com/c/1281603
> Commit-Queue: Daniel Clifford <danno@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#56806}

TBR=danno@chromium.org,jgruber@chromium.org,tebbi@chromium.org

Change-Id: I1f2c82b4c3ab0848857f620facacf9604d4fcd11
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/1290973
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56815}
2018-10-19 11:24:34 +00:00
Daniel Clifford
41ba3d3eb0 [builtins] Implement Array.prototype.slice in Torque
In the process:

- add volatile types for FastJSArray and remove the length_fast accessor
  from JSArray with the application of more rigorous typing.
- add micro benchmarks for testing all the interesting slice cases

Also update a few assorted places in .tq code to make them more
idiomatic.

Change-Id: I76ec2bb25b65a869180af1f7288419dc1f0a9c37
Reviewed-on: https://chromium-review.googlesource.com/c/1281603
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56806}
2018-10-19 09:12:21 +00:00
Daniel Clifford
9958694f84 [torque] Implement implicit parameters
The implicit parameter syntax adds a second parameter list
before the explicit parameter list when declaring macros, builtins and
runtime functions:

  extern macro MyMacro(implicit a: Smi)(b: Oddball);

when calling the macro, only the formal parameters can be provided
at the call site. The implicit parameters are implicitly looked-up
by name in the scope of the call and prepended to the explicit parameter
list. The values that are found by name for each implicit parameter must
be castable the corresponding implicit parameter type:

  MyMacro(Null);  // Error, a is not defined
  ...
  const a: Smi = 0;
  MyMacro(Null);  // OK
  ...
  const a: Object = 0;
  MyMacro(Null);  // Error, a has wrong type

For external macros, builtins and runtime functions, the formal
parameter list expected on the C++ side is the concatenation of the
implicit and explicit parameter lists.

As a drive-by: fix the formatting of typeswitch statements in the
the presence of deferred-marked blocks and funky white space.

Bug: v8:7793
Change-Id: I40da8405c706d7cdeca35367c9c954d0b33f6bf4
Reviewed-on: https://chromium-review.googlesource.com/c/1270996
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56555}
2018-10-11 09:49:30 +00:00
Daniel Clifford
274aecdd78 Fix nits in presubmit.py and handling of .tq otherwise formatting
Change-Id: I69a4db1d8be47bad56df74447a29526e9623cb80
Reviewed-on: https://chromium-review.googlesource.com/1243107
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56219}
2018-09-25 15:37:39 +00:00
Daniel Clifford
ea5207f73c [torque]: Require formatting for .tq files in presubmit
Bug: v8:7793
Change-Id: I18bd30b36be3c3f89962a2e9c04d8f159c8cfe2b
Reviewed-on: https://chromium-review.googlesource.com/1240415
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56202}
2018-09-25 11:38:08 +00:00
Daniel Clifford
f088840abf [torque] Improve formatting in format-torque
Issues/problems addressed:

- Fix line-wrapping and indenting for long declarations including strings,
  e.g. generates and constexpr clauses.
- Implement proper formatting for typeswitch statements
- Fix formatting of operator declarations
- Fix formatting of constexpr if-clauses (the constexpr is now included on the
  same line as the if and it doesn't mess up the formatting that
- Fix formatting of label declarations on callables, the "label" keyword now
  always starts a new line with indentation.
- Remove space after identifier name in generic parameter declarations, e.g.
  "<a : T>" is now "<a: T>" which is consistent with type specification
  formatting elsewhere.
- Indent "otherwise" clauses that have been pushed to the next line.

Also ran the formatter over all existing .tq files.

Bug: v8:7793
Change-Id: I5adbb2ffa3d573deed062f9a5c1da57348c8fc71
Reviewed-on: https://chromium-review.googlesource.com/1238580
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56158}
2018-09-24 10:08:00 +00:00
Simon Zünd
534945bab8 [torque] Update vscode extension to reflect recent changes
This CL adds 'typeswitch' and 'case' as a keyword and removes some
unused ones. It also adds 'UncheckedCast', 'Cast', 'Convert' and
'FromConstexpr' as support functions.

Bug: v8:7793
Change-Id: Ia58045a5fb0f599c7c17cbf11d4e60ed55db7334
Reviewed-on: https://chromium-review.googlesource.com/1219389
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Simon Zünd <szuend@google.com>
Cr-Commit-Position: refs/heads/master@{#55850}
2018-09-13 09:05:00 +00:00
Timothy Gu
04a6adfc7e [vim-torque] Add a Torque vim syntax highlighter
The vim counterpart to the existing Visual Studio Code extension.

Change-Id: I7ee59e212a31e81034362eb406f3ffdbb2447acb
Reviewed-on: https://chromium-review.googlesource.com/1180705
Commit-Queue: Timothy Gu <timothygu@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55231}
2018-08-20 18:30:42 +00:00
Daniel Clifford
675c1de5e2 [torque] Remove try/catch (only support try/label)
In the process, also fix the make-torque-parser.py script to work in its new
location.

Bug: v8:7793
Change-Id: I376a5f73ec9f7cc87995928397c6e399b1a490d8
Reviewed-on: https://chromium-review.googlesource.com/1084838
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53504}
2018-06-04 19:55:02 +00:00
Simon Zünd
7975b8cef9 [vscode-torque] Add vscode extension with basic Torque support.
This CL creates the "tools/torque" directory. It moves the existing
two scripts (making the parser and formatting Torque code) into that
director.

The extension lives in "tools/torque/vscode-torque" and currently only
provides basic syntax highlighting support. The easiest way to
install the extension is to simply create a symlink into your local
vscode extension directory (see README.md).

R=jgruber@chromium.org, tebbi@chromium.org

Change-Id: Ifc22b615341ed18f91c9b046090f569fcc083ab6
Reviewed-on: https://chromium-review.googlesource.com/1076548
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53421}
2018-05-29 16:03:38 +00:00