- 13 Sep, 2018 1 commit
-
-
Simon Zünd authored
Drive-by change: Add helper method for reporting naming convention errors and refactor existing call sites. R=tebbi@chromium.org Bug: v8:7793 Change-Id: I7315b935229ffb7557fa55ebcb222fc91124aab7 Reviewed-on: https://chromium-review.googlesource.com/1223831Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Simon Zünd <szuend@google.com> Cr-Commit-Position: refs/heads/master@{#55847}
-
- 12 Sep, 2018 2 commits
-
-
Simon Zünd authored
R=tebbi@chromium.org Bug: v8:7793 Change-Id: I0314f1b45433c3023f803d67a056ffd6dbf83ce9 Reviewed-on: https://chromium-review.googlesource.com/1221212 Commit-Queue: Simon Zünd <szuend@google.com> Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#55832}
-
Simon Zünd authored
R=tebbi@chromium.org Bug: v8:7793 Change-Id: I8db34b56e3dd3ac24ca7e368054829befb13397f Reviewed-on: https://chromium-review.googlesource.com/1221187Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Simon Zünd <szuend@google.com> Cr-Commit-Position: refs/heads/master@{#55824}
-
- 11 Sep, 2018 2 commits
-
-
Simon Zünd authored
This CL adds a contextual variable that tracks lint errors and will cause the Torque compiler to abort if there were any. R=tebbi@chromium.org Bug: v8:7793 Change-Id: Ia7c2b5b6c7cb12d489b12596afa84f933fc3f337 Reviewed-on: https://chromium-review.googlesource.com/1219388Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Simon Zünd <szuend@google.com> Cr-Commit-Position: refs/heads/master@{#55797}
-
Simon Zünd authored
To make the changes in base.tq work, there were 2 changes needed on the C++ side: - calls to "FromConstexpr" are generated by the compiler for implicit conversions. - type switch is desugared and uses "Cast" R=jgruber@chromium.org, tebbi@chromium.org Change-Id: I085f1a393f93e501e6bbcaeacb0d6568259a4714 Reviewed-on: https://chromium-review.googlesource.com/1219629 Commit-Queue: Simon Zünd <szuend@google.com> Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Reviewed-by:
Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#55794}
-
- 10 Sep, 2018 2 commits
-
-
Simon Zünd authored
This CL adds naming convention errors for: - Variable names - Torque Macro/Builtin names - Parameter names R=tebbi@chromium.org Bug: v8:7793 Change-Id: Icfe20e53524234f0b4534f0102aff6b14121dfbc Reviewed-on: https://chromium-review.googlesource.com/1213184 Commit-Queue: Simon Zünd <szuend@google.com> Reviewed-by:
Jakob Gruber <jgruber@chromium.org> Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#55758}
-
Tobias Tebbi authored
This CL makes sure, that logical operators (||, &&) always have return type never. Together with a check that never is never passed as a function argument, this prevents faulty evaluation as in !(x || y). Before, the logical operators had a behavior similar to (bool labels Taken, NotTaken), with a fast exit if the left-hand side allowed shor-circuit evaluation, but returning the right-hand side otherwise. Since we want to allow existing (a || b || c) patterns in the codebase, this requires weakening the restriction that the left- and right-hand side need to have the same type. Now the possibilites are: bool, never never, bool never, never bool, bool constexpr bool, constexpr bool Bug: v8:8137 Change-Id: I9576b337dc4008ac58b4625e77fef4e73bcdd6e3 Reviewed-on: https://chromium-review.googlesource.com/1215162Reviewed-by:
Daniel Clifford <danno@chromium.org> Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#55750}
-
- 06 Sep, 2018 2 commits
-
-
Florian Sattler authored
Bug: v8:8015 Change-Id: Ice0c5994ff5695c06be307c3e37d90daf14c643c Reviewed-on: https://chromium-review.googlesource.com/1209763 Commit-Queue: Florian Sattler <sattlerf@google.com> Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#55691}
-
Florian Sattler authored
Bug: v8:8015 Change-Id: I7f63989a897857c2258ec2bee59aed6100bc689e Reviewed-on: https://chromium-review.googlesource.com/1209346Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Florian Sattler <sattlerf@google.com> Cr-Commit-Position: refs/heads/master@{#55685}
-
- 05 Sep, 2018 1 commit
-
-
Daniel Clifford authored
Change-Id: I9dc6a387ce5c9b97e21d20297b59b910daea3c6d Reviewed-on: https://chromium-review.googlesource.com/1199503Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Daniel Clifford <danno@chromium.org> Cr-Commit-Position: refs/heads/master@{#55633}
-
- 08 Aug, 2018 1 commit
-
-
Tobias Tebbi authored
This adds a typeswitch statement typeswitch (e) case (x1 : Type1) { ... } case (x2 : Type2) { } ... ... case (xn : TypeN) { ... } This checks to which of the given types the result of evaluating e can be cast, in the order in which they are listed. So if an earlier type matches, a value of this type won't reach a later case. The type-checks are performed by calling the cast<T>() macro. The type of the argument passed to the cast macro is dependent on the case and excludes all types checked earlier. For example, in const x : Object = ... typeswitch (x) case (x : Smi) { ... } case (x : HeapNumber) { ... } case (x : HeapObject) { ... } there will be calls to cast<Smi>(Object) and cast<HeapNumber>(HeapObject), because after the Smi check we know that x has to be a HeapObject. With the refactored base.tq definition of cast, this will generate efficient code and avoid repeating the Smi check in the second case. The type system ensures that all cases are reachable and that the type given to the last case is safe without a runtime check (in other words, the union of all checked types covers the type of e). The cases can also be written as case (Type) { ... } , in which case the switched value is not re-bound with the checked type. Bug: v8:7793 Change-Id: Iea4aed7465d62b445e3ae0d33f52921912e095e3 Reviewed-on: https://chromium-review.googlesource.com/1156506 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by:
Daniel Clifford <danno@chromium.org> Cr-Commit-Position: refs/heads/master@{#54958}
-
- 07 Aug, 2018 2 commits
-
-
Tobias Tebbi authored
Previously, we requested instantiation of generics prior to selecting a template overload, which resulted in unused templates being instantiated, possibly triggering unnecessary compile errors. Bug: v8:7793 Change-Id: I45f4bdbf8aa93749ece416c6c7458d64e6e051f5 Reviewed-on: https://chromium-review.googlesource.com/1154977 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by:
Daniel Clifford <danno@chromium.org> Cr-Commit-Position: refs/heads/master@{#54950}
-
Tobias Tebbi authored
In the generated CSA, we called overloaded macros while relying on CSA subtyping of TNodes. This doesn't work well with overloads, because for C++ any TNode subtyping is treated as an implicit conversion, which makes these calls ambiguous for C++. As a solution, we insert implicit_cast conversions for arguments according to the type predicted by Torque. This way, a CSA overload is always called with exactly the signature declared in base.tq. This has the additional benefit that it validates the signatures declared in base.tq, which could previously be too permissive. Also, this triggered a bug in structs, where VisitResult's were carrying the wrong type. Bug: v8:7793 TBR: danno@chromium.org Change-Id: I8ed4bfd04793c8a8805a4a3dd5cf2a85c20ce786 Reviewed-on: https://chromium-review.googlesource.com/1165237 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#54948}
-
- 03 Aug, 2018 1 commit
-
-
Tobias Tebbi authored
Bug: v8:8012 v8:7793 Change-Id: Idc5d685d021fd107974b4415f7b855397004cb53 Reviewed-on: https://chromium-review.googlesource.com/1160841Reviewed-by:
Camillo Bruni <cbruni@chromium.org> Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#54893}
-
- 31 Jul, 2018 1 commit
-
-
Tobias Tebbi authored
Change-Id: I4710d317cf9f5686551a3df6e98619bab79387fa Reviewed-on: https://chromium-review.googlesource.com/1156698 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by:
Michael Stanton <mvstanton@chromium.org> Cr-Commit-Position: refs/heads/master@{#54827}
-
- 27 Jul, 2018 2 commits
-
-
Tobias Tebbi authored
We currently only expose this to desugarings and not in the grammar to keep 'const' and 'let' bindings consistent. A side-effect of this change is that it is now possible to use a shadowed name in the initializer of a const binding. Bug: v8:7793 Change-Id: Ic2ca6af0735acf0e748d394f9039fe6612bd4a06 Reviewed-on: https://chromium-review.googlesource.com/1150534 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by:
Daniel Clifford <danno@chromium.org> Cr-Commit-Position: refs/heads/master@{#54755}
-
Simon Zünd authored
This CL changes the for-loop so all parts are optional, allowing loops like: for (;;) {} for (;; ++i) {} ... R=danno@chromium.org, tebbi@chromium.org Bug: v8:7793 Change-Id: I7bf9ef9e59d55eb9ae9f38904a1c1106ae50df5a Reviewed-on: https://chromium-review.googlesource.com/1152727 Commit-Queue: Simon Zünd <szuend@google.com> Reviewed-by:
Daniel Clifford <danno@chromium.org> Cr-Commit-Position: refs/heads/master@{#54752}
-
- 25 Jul, 2018 1 commit
-
-
Tobias Tebbi authored
I suspect that the non-deterministic order of changed variables in the generated Label constructor calls is what causes non-deterministic builds, since this is the only change I observed locally in the generated .cc files. Drive-by cleanup: follow style-guide by avoiding mutable ref parameter. Bug: chromium:867308 Change-Id: I137af359df570ee11b95cb620ace179bf93481c5 Reviewed-on: https://chromium-review.googlesource.com/1148729Reviewed-by:
Daniel Clifford <danno@chromium.org> Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#54687}
-
- 24 Jul, 2018 3 commits
-
-
Tobias Tebbi authored
Change-Id: I02c117ef66480eb73eb9cc1d4f80bbc64e9d3624 Reviewed-on: https://chromium-review.googlesource.com/1146655 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by:
Jakob Gruber <jgruber@chromium.org> Reviewed-by:
Jaroslav Sevcik <jarin@chromium.org> Cr-Commit-Position: refs/heads/master@{#54649}
-
Tobias Tebbi authored
This also fixes all resulting failures. Bug: v8:7965 Change-Id: I5451cdd3a3ec48c708107a22445808c268efe861 Reviewed-on: https://chromium-review.googlesource.com/1148336 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#54643}
-
Tobias Tebbi authored
Shared library sharing of template-defined global variables is broken on Windows. This prepares contextual variables to export their globals from a DLL. Change-Id: I3092a92db71c4e516218081b97335d451d90bfe2 Reviewed-on: https://chromium-review.googlesource.com/1148049Reviewed-by:
Sigurd Schneider <sigurds@chromium.org> Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#54628}
-
- 23 Jul, 2018 1 commit
-
-
Stephan Herhut authored
This moves the static handle() helper function to handles-inl.h as it ultimately depends on handles-inl.h anyway. To make this possible, also move some other code to -inl.h files and split up some header files into a -inl.h part. Bug: v8:7490 Change-Id: I0f68e0728ba082b87ffa911aaf205d9b1523d2c9 Reviewed-on: https://chromium-review.googlesource.com/1146723Reviewed-by:
Benedikt Meurer <bmeurer@chromium.org> Reviewed-by:
Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Stephan Herhut <herhut@chromium.org> Cr-Commit-Position: refs/heads/master@{#54617}
-
- 20 Jul, 2018 1 commit
-
-
Tobias Tebbi authored
Bug: v8:7793 Change-Id: I208edf856f0283d840358f3c11bab97af0397056 Reviewed-on: https://chromium-review.googlesource.com/1095192Reviewed-by:
Daniel Clifford <danno@chromium.org> Reviewed-by:
Jaroslav Sevcik <jarin@chromium.org> Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#54574}
-
- 19 Jul, 2018 2 commits
-
-
Tobias Tebbi authored
Bug: v8:7929 v8:7793 Change-Id: I7d9cdd0fb3e36ae6e81683cc4c3746f6ea119d15 Reviewed-on: https://chromium-review.googlesource.com/1138077Reviewed-by:
Daniel Clifford <danno@chromium.org> Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#54564}
-
Simon Zünd authored
This CL replaces all std::endl in implementation-visitor since std::endl flushes the stream (which is not necessary). R=tebbi@chromium.org Bug: v8:7754, v8:7793 Change-Id: Ic4b43905280020a99cb405cc90440b2adb679839 Reviewed-on: https://chromium-review.googlesource.com/1142780Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Simon Zünd <szuend@google.com> Cr-Commit-Position: refs/heads/master@{#54546}
-
- 17 Jul, 2018 2 commits
-
-
Daniel Clifford authored
Struct are bundles of value types. They are essentially just shorthand for passing around a group of individually defined values. Struct types are declared like this: struct A { x: Smi; y: int32; } and can be constructed explicitly like this: A{0, 0} Structs can be used wherever other types are used (e.g. variables, parameters, return values) except for parameter/return types of builtins and runtime functions. Struct use field access notation to set/get their values like this: let a: A = A{0, 0}; let b: Smi = a.x; a.y = 0; Change-Id: I9fd36a6514c37882831256a49a50809c5db75b56 Reviewed-on: https://chromium-review.googlesource.com/1122133 Commit-Queue: Daniel Clifford <danno@chromium.org> Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#54501}
-
Simon Zünd authored
This CL adds local const bindings. This means that instead of generating TVARIABLEs for variables, we can generate simple TNodes. Example: macro FooBar(): { const kSomeSmi: Smi = 10; ... } This CL also enforces that variables with a constexpr type are bound using 'const' and not 'let'. R=tebbi@chromium.org Bug: v8:7793 Change-Id: Id20a18149df9fc374ce718bdb1478e3eabb6e6df Reviewed-on: https://chromium-review.googlesource.com/1138316 Commit-Queue: Simon Zünd <szuend@google.com> Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#54479}
-
- 16 Jul, 2018 1 commit
-
-
Simon Zünd authored
This CL renames Constant to ExternConstant (this already happend in the grammar). It also enforces the rule that such extern constants require "constexpr" types. Drive-by-change: Replaced non constexpr extern constants with module constants. R=tebbi@chromium.org Bug: v8:7793 Change-Id: Icb3f75071b15b1fcabbe447941e05dd5a09d4b23 Reviewed-on: https://chromium-review.googlesource.com/1136434Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Simon Zünd <szuend@google.com> Cr-Commit-Position: refs/heads/master@{#54453}
-
- 13 Jul, 2018 1 commit
-
-
Simon Zünd authored
This CL adds constants that can be defined in the module scope: const kConstexprConst: constexpr int31 = 5; const kIntptrConst: intptr = 4; const kSmiConst: Smi = 3; They are implemented by generating "mini-macros" that return the expression on the right-hand side of the assignment. Bug: v8:7793 Change-Id: I0a476cb3111707fad56bf15e9547b377c7adab37 Reviewed-on: https://chromium-review.googlesource.com/1114745 Commit-Queue: Simon Zünd <szuend@google.com> Reviewed-by:
Daniel Clifford <danno@chromium.org> Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#54430}
-
- 05 Jul, 2018 1 commit
-
-
Daniel Clifford authored
Only pass around the unadulterated value identifier in the VisitResult class until the very last moment before code generation, at which point the declaration that was used to originally define the value is used to generate the correct final source code string in the context of a l-value or r-value. Bug: v8:7793 Change-Id: Ifd0c0d245b2eb65c7f3ddb1ad4c87ee235c54a82 Reviewed-on: https://chromium-review.googlesource.com/1125063 Commit-Queue: Daniel Clifford <danno@chromium.org> Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#54229}
-
- 03 Jul, 2018 4 commits
-
-
Tobias Tebbi authored
It turns out we can just remove kReturnVariable from the normal change tracking, since it's always set when jumping to the final label anyway. Bug: v8:7793 Change-Id: I6d0a777016047aa31b0edddd19c661e2631e1078 Reviewed-on: https://chromium-review.googlesource.com/1124471Reviewed-by:
Daniel Clifford <danno@chromium.org> Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#54171}
-
Tobias Tebbi authored
Bug: v8:7793 Change-Id: Ifb03938e15307910ef25b2b95c32fe69bfec1441 Reviewed-on: https://chromium-review.googlesource.com/1124458Reviewed-by:
Daniel Clifford <danno@chromium.org> Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#54169}
-
Tobias Tebbi authored
Variables/return values with constexpr type cannot have multiple assignments. We check this now. For conditionals, it is important to always infer a non-constexpr type. This CL adds the ability to map any type (including union types) to be mapped to their non-constexpr variant. Conditionals infer their type as the non-constexpr version of a combination of the two branch types. In addition, this improves subtyping for constexpr types: If A extends B, then constexpr A extends constexpr B. This makes it necessary to clean up "constexpr String", which has nothing to do with tagged values. Bug: v8:7793 Change-Id: Ia4d3cd5dc98f45b0ec89adf05c5c6111a0e51cc6 Reviewed-on: https://chromium-review.googlesource.com/1122864 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by:
Daniel Clifford <danno@chromium.org> Cr-Commit-Position: refs/heads/master@{#54167}
-
Simon Zünd authored
When calling a builtin via a function pointer, torque tries to find any builtin with the same parameter types for a descriptor. If no such builtin exist, we currently crash. Example: type DoesNotExistFn = builtin(Context, Smi, Smi, Smi) => Smi; macro TestMacro(c: Context, fn: DoesNotExistFn) { let result: Smi = fn(c, 1, 2, 3); } R=tebbi@chromium.org Bug: v8:7793 Change-Id: Ia7436dc6541aca5de2e8dcb6b2a09978a1af9d39 Reviewed-on: https://chromium-review.googlesource.com/1123821Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Simon Zünd <szuend@google.com> Cr-Commit-Position: refs/heads/master@{#54165}
-
- 02 Jul, 2018 1 commit
-
-
Daniel Clifford authored
In the process, create a shared array utility GetLengthProperty that fast-paths accessing the length properties of JSArray. Bug: v8:7793 Change-Id: I6d7f0007c162794773dc0fc3e8bf12b3adf12fa0 Reviewed-on: https://chromium-review.googlesource.com/1116221 Commit-Queue: Daniel Clifford <danno@chromium.org> Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#54133}
-
- 28 Jun, 2018 1 commit
-
-
Théotime Grohens authored
This CL adds the newline character as a valid character in Torque strings. You can now write Print('Hello, World!\n') in Torque and it works! Change-Id: I2a1f87cfef492fedd3d24086e226d3ebaf882115 Reviewed-on: https://chromium-review.googlesource.com/1118229Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Théotime Grohens <theotime@google.com> Cr-Commit-Position: refs/heads/master@{#54089}
-
- 26 Jun, 2018 1 commit
-
-
Daniel Clifford authored
In the process, add a utility functions to automate printing out comma-separated lists. Also make sure that the << operator applies to "const Type&" rather than "const Type*" for consistency elsewhere and generally just good practice. Bug: v8:7793 Change-Id: I488e8383c4a9496552e63601738d6bcca0ca6e80 Reviewed-on: https://chromium-review.googlesource.com/1111854 Commit-Queue: Daniel Clifford <danno@chromium.org> Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#54038}
-
- 22 Jun, 2018 2 commits
-
-
Simon Zünd authored
This CL changes the syntax for external constants to better reflect for what they are actually used. Drive-by change: Ran the format tool on base.tq. R=danno@chromium.org, tebbi@chromium.org Bug: v8:7793 Change-Id: Ie49c28b9c95a05846a2d9801f01b11e5a58d72d9 Reviewed-on: https://chromium-review.googlesource.com/1111706Reviewed-by:
Daniel Clifford <danno@chromium.org> Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Simon Zünd <szuend@google.com> Cr-Commit-Position: refs/heads/master@{#53963}
-
Simon Zünd authored
This CL moves every method definition with >5 LoC from declaration-visitor.h to declaration-visitor.cc. R=tebbi@chromium.org Bug: v8:7793 Change-Id: I61b5672c9662608fd33c3a23af6176cfa9791295 Reviewed-on: https://chromium-review.googlesource.com/1111709Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Simon Zünd <szuend@google.com> Cr-Commit-Position: refs/heads/master@{#53962}
-
- 21 Jun, 2018 1 commit
-
-
Tobias Tebbi authored
This removes error messages about missing _True labels, and instead tries find overloads for the branch protocol and a normal function call at the same time. The branch protocol is only considered if there are _True and _False in the context and the overload returns never. In addition, it prints all macro names of operator overloads if none was matching. Bug: v8:7793 Change-Id: Id81712f5b7f2af6765e23bb1f37438f141a79316 Reviewed-on: https://chromium-review.googlesource.com/1109839Reviewed-by:
Daniel Clifford <danno@chromium.org> Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#53943}
-