- 05 Nov, 2018 1 commit
-
-
Tobias Tebbi authored
- Name lookup in module scopes has namespace semantics now: All overloads from all parent modules are combined before overload resolution. - Allow overloads of different callables: runtime-functions, macros, builtins, and generics. - The duplication between the DeclarationVisitor and the ImplementationVisitor is removed: The DeclarationVisitor creates declarables for everything except for implicit generic specializations. The ImplementationVisitor iterates over declarables. The DeclarationVisitor only looks at the header of declarations, not at the body. - Modules become Declarable's, which will enable them to be nested. - Modules replace the existing Scope chain mechanism, which will make it easier to inline macros. - The DeclarationVisitor and Declarations become stateless. All state is moved to contextual variables and the GlobalContext. - Implicit specializations are created directly from the ImplementationVisitor. This will enable template parameter inference. - As a consequence, the list of all builtins is only available after the ImplementationVisitor has run. Thus GenerateBuiltinDefinitions has to move to the ImplementationVisitor. Also, this makes it necessary to resolve the link from function pointer types to example builtins only at this point. Bug: v8:7793 Change-Id: I61cef2fd3e954ab148c252974344a6e38ee2d01d Reviewed-on: https://chromium-review.googlesource.com/c/1304294 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Daniel Clifford <danno@chromium.org> Cr-Commit-Position: refs/heads/master@{#57231}
-
- 04 Oct, 2018 1 commit
-
-
Tobias Tebbi authored
Bug: v8:7793 Change-Id: I5261122faf422987968ee1e405966f878ff910a1 Reviewed-on: https://chromium-review.googlesource.com/c/1245766 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Daniel Clifford <danno@chromium.org> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Cr-Commit-Position: refs/heads/master@{#56391}
-
- 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}
-
- 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}
-
- 03 Jul, 2018 1 commit
-
-
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}
-
- 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}
-
- 15 Jun, 2018 1 commit
-
-
Daniel Clifford authored
In the process: - Make it possible to add 'otherwise' labels to operators - operators can be defined by non-external macros Bug: v8:7793 Change-Id: Ia16ae7c95a4719703c80a927dee44c74b65c170b Reviewed-on: https://chromium-review.googlesource.com/1100826 Commit-Queue: Daniel Clifford <danno@chromium.org> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#53754}
-
- 12 Jun, 2018 1 commit
-
-
Daniel Clifford authored
In the process: - Add strict ordering of Types so that name mangling is consistent and build time. Previously, the UnionType stored the union's types in a std::set<const Type*>, which did not have a consistent ordering of the types in the set. - Add a int31 type to enable consistency and correctness of handling of 'constexpr int31' values on the C++ side. - By removing the "implicit" keyword for operators, there is now one less difference between operators and calls, another incremental step in unifying operators and calls. - Enable external (i.e. C++-defined) generic specializations - Add CSA support for checking double ElementsKinds, including tests. - Clean up some constexpr/non-constexpr handling of ElementsKinds. Bug: v8:7793 Change-Id: I27699aba70b98ebf5466e5b62b045d7b1dad62c8 Reviewed-on: https://chromium-review.googlesource.com/1091155 Commit-Queue: Daniel Clifford <danno@chromium.org> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#53664}
-
- 06 Jun, 2018 1 commit
-
-
Daniel Clifford authored
This allows redifinitions of generics with the same name but differing parameter type lists, e.g. macro coerce<Dest: type>(from: HeapObject): Dest; coerce<int32>(from: HeapObject): int32 {...} macro coerce<Dest: type>(from: Smi): Dest; coerce<int32>(from: Smi): int32 {...} In order to allow multiple overloads of generic macros with the same name, a more nuanced lookup of calls has been implemented using the ParameterDifference utility class. There is still work to be done to unify when ParameterDifference is used for lookup (e.g. removing it from operator lookup when operators become simple aliases for macro names), but that work will be done in a separate CL. As part of this CL, the custom handling of "cast<>" operator in the .g4 grammar has been removed and replaced by a handful of equivalent overloads of a generic "cast" macro. Bug: v8:7793 Change-Id: Ibb2cdd3d58632b7f7f7ba683499f9688ae07f4f8 Reviewed-on: https://chromium-review.googlesource.com/1087873 Commit-Queue: Daniel Clifford <danno@chromium.org> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#53562}
-
- 30 May, 2018 1 commit
-
-
Tobias Tebbi authored
In Torque, we have several global singleton classes. Using the contextual variable pattern instead of passing around pointers in random places makes the code more readable. This CL does this for TypeOracle, we plan to do it for more classes in the future. Bug: v8:7754 Change-Id: Ib744b476ce51a4932c52274b2210149515f1663d Reviewed-on: https://chromium-review.googlesource.com/1078729 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Michael Stanton <mvstanton@chromium.org> Cr-Commit-Position: refs/heads/master@{#53444}
-
- 22 May, 2018 1 commit
-
-
Tobias Tebbi authored
Change-Id: Ie61c8fa51c7c13ab74c4c97ed6803be7f879a549 Reviewed-on: https://chromium-review.googlesource.com/1069088 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Cr-Commit-Position: refs/heads/master@{#53293}
-
- 18 May, 2018 2 commits
-
-
Daniel Clifford authored
Fixes known issue that specialization doesn't rigorously checked to verify that specialization signature precisely matches generic declaration. Change-Id: I884f7f16a467ab716d2b0c553485f4b1c55ed806 Reviewed-on: https://chromium-review.googlesource.com/1063613Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Daniel Clifford <danno@chromium.org> Cr-Commit-Position: refs/heads/master@{#53252}
-
Théotime Grohens authored
Change-Id: I79e4ad1cf41ea8888bf6288690203d746a7b7864 Reviewed-on: https://chromium-review.googlesource.com/1065811Reviewed-by: Daniel Clifford <danno@chromium.org> Commit-Queue: Théotime Grohens <theotime@google.com> Cr-Commit-Position: refs/heads/master@{#53245}
-
- 16 May, 2018 3 commits
-
-
Tobias Tebbi authored
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng Change-Id: I20e30f0c19c887b1e093b02e39c7bd3d53d15182 Reviewed-on: https://chromium-review.googlesource.com/1054073 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Daniel Clifford <danno@chromium.org> Cr-Commit-Position: refs/heads/master@{#53221}
-
Tobias Tebbi authored
This CL adds the new type expression builtin(Context, ArgType1, ...) => ReturnType and allows to use Torque-defined builtins as values of this type, as well as calling values of this type. The new function pointer types are subtypes of Code. Change-Id: Ib7ba3ce6ef7a8591a4c79230dd189fd25698d5b9 Reviewed-on: https://chromium-review.googlesource.com/1060056 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Daniel Clifford <danno@chromium.org> Cr-Commit-Position: refs/heads/master@{#53217}
-
Daniel Clifford authored
Including specialization, e.g.: // Declare parameterized generic macro GenericMacroTest<T: type>(param: T): Object { return Undefined; } // Declare specialization of generic GenericMacroTest<Object>(param: Object): Object { return param; } ... assert(GenericMacroTest<Smi>(0) == Undefined); assert(GenericMacroTest<Smi>(1) == Undefined); assert(GenericMacroTest<Object>(Null) == Null); assert(GenericMacroTest<Object>(False) == False); ... Known issue: specialization doesn't rigorously checked to verify that specialization signature precisely matches generic declaration. Change-Id: I9d9d96da4c5c8c9a76550844680e9e133a5edaed Reviewed-on: https://chromium-review.googlesource.com/1043986 Commit-Queue: Daniel Clifford <danno@chromium.org> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#53203}
-
- 07 May, 2018 1 commit
-
-
Daniel Clifford authored
In the process, rename Boolean constants (i.e. JavaScript constants), to 'True' and 'False'. This uncovered a bug in the internal handling of True/False labels was fixed (they shouldn't be Values and Torque shouldn't conflate Labels with other Declarables, throwing exceptions when they're improperly used in the wrong context). Furthermore, the internal labels used for True and False for if statements have been renamed so that they can't be aliased from user Torque code. Change-Id: I09dbd2241d2bc2f1daff53862dee1b601810060c Reviewed-on: https://chromium-review.googlesource.com/1044370Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#53026}
-
- 03 May, 2018 1 commit
-
-
Daniel Clifford authored
This is a preparatory step for implementing generics. Along the way, clean up and encapsulate a bunch of code, including: * Fully encapsulate Scope by adding the new class ScopeChain that provide an abstraction for creating and activating scopes. * Untangle Modules and Scopes. * Unify scope activation so that it is always associated with an AST node and triggered by a RAII helper class. * Unify (somewhat) how builtins and macros are created, fixing a few inconsistencies with when and how parameters and their types are declared. * Create a new Declarations class that brokers between the visitor classes and the ScopeChain. This moves handling of declaration-related errors out of the visitors but also makes it possible to do so without polluting Scope and ScopeChain with details about resolving SourcePositions in error cases. Change-Id: I180017d4cf39ccf5ef1d20b84f53284c252f8d87 Reviewed-on: https://chromium-review.googlesource.com/1038504 Commit-Queue: Daniel Clifford <danno@chromium.org> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#52947}
-
- 24 Apr, 2018 1 commit
-
-
Daniel Clifford authored
Bug: v8:7666 Change-Id: Ida9b6f964261bad75a4eb5d567ad37ec82569bcc Reviewed-on: https://chromium-review.googlesource.com/1023061 Commit-Queue: Daniel Clifford <danno@chromium.org> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#52751}
-
- 16 Apr, 2018 1 commit
-
-
Daniel Clifford authored
An overview of motivation behind Torque and some of its principles can be found here: https://bit.ly/2qAI5Ep Note that there is quite a bit of work left to do in order to get Torque production-ready for any non-trivial amount of code, but landing the prototype as-is will allow for much faster iteration. Bugs will be filed for all of the big-ticket items that are not landing blockers but called out in this patch as important to fix. Cq-Include-Trybots: luci.v8.try:v8_linux_nosnap_rel;luci.v8.try:v8_linux_noi18n_rel_ng Change-Id: Ib07af70966d5133dc57344928885478b9c6b8b73 Reviewed-on: https://chromium-review.googlesource.com/845682 Commit-Queue: Daniel Clifford <danno@chromium.org> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Cr-Commit-Position: refs/heads/master@{#52618}
-