Commit Graph

80 Commits

Author SHA1 Message Date
Svyatoslav Kuzmich 31c84e9ac4 [JS IR] Build stdlib using compiler from repo
Previously JS IR versions of stdlib and kotlin-test were build
by default using compiler previously built on a buildserver.

It had some issues:
 - This required us to advance bootstrap every time we made any
   incompatible IR changes. This happens often since IR ABI is
   not quite stable yet.

 - We never tested the exact combination of compiler and stdlib we publish

   We tested:
    - new compiler with new stdlib build by new compiler (in box tests)
    - old compiler with new stdlib build by old compiler (in stdlib tests)

   We published:
    - new compiler with new stdlib build by old compiler

After this change JS IR compiler tests, builds and publishes
single configuration:

    new compiler with new stdlib build by new compiler

JS IR stdlib and kotlin-test are now built using JavaExec of CLI instead
of Gradle plugin to avoid troubles of loading a freshly built plugin.

This also allows to have a granular dependencies: we don't rebuild klib
if we changed a lowering in a compiler backend, but we do rebuild it if
we changed IR serialization algorithm.
2019-12-25 13:44:57 +03:00
Alexander Udalov 0cb48999ff JVM IR: retain optional annotations as package private classes
Similarly to how it's done in the old backend (see
PackageCodegenImpl.generateClassesAndObjectsInFile and
AnnotationCodegen.genAnnotation)
2019-12-18 20:25:11 +01:00
Alexander Gorshenev ffa368e0a7 Reconciled -Xklib-mpp with commonizer 2019-12-18 19:29:56 +03:00
Alexander Gorshenev dc8240c24e Expect/actual support in klibs under -Xklib-mpp 2019-12-18 19:29:56 +03:00
Roman Artemev 0f71460833 Add missed comment 2019-12-17 18:04:52 +03:00
Roman Artemev cad3cb1bbe [KLIB] Fix references to type made from TypeParameter in KotlinMangler
- promote ABI version
2019-12-17 17:56:07 +03:00
Svyatoslav Kuzmich 3df8393ede [JS IR] Properly report compiler errors
Report compiler errors using message collector
Instead of crashing with stack trace
2019-12-17 15:33:43 +03:00
Dmitriy Dolovov 18117ed1f3 [Commonizer] Serialize commonized metadata for KLIB writer
- introduce EmptyDescriptorTable
- wipe out unused BindingContext from KlibMetadataSerializer
2019-12-12 14:52:02 +03:00
Roman Artemev ca0bff75cd [KLIB] Keep order of constant properties depending on backend
- Fix K/N performance regression
2019-12-03 16:20:52 +03:00
Alexander Gorshenev b0f077ff4b Plumbing KlibMetadataVersion and KlibIrVersion values to klib manifest 2019-11-30 18:37:38 +03:00
Georgy Bronnikov 1ed23d7c54 IR: reorganize IrProvider handling
Make DeclarationStubGenerator a subclass of IrProvider,
anticipating deserialization of IR structures for JVM_IR backend.
2019-11-27 20:02:27 +03:00
Leonid Startsev ed786c4daf Enable compiler plugins in JS IR backend (and WASM too, since they use same loadIr function) 2019-11-26 19:34:48 +03:00
Leonid Startsev 3e18350a1f Rewrite IR plugin infrastructure (and serialization plugin) so it won't emit LazyIR.
LazyIR was emitted because plugin was not able to declare symbols, only to reference them.
Moreover, declarations added by frontend plugin were also unbound symbols produced by psi2ir,
and declaration stub generator was stubbing them with LazyIR – therefore access to global symbol table is not enough for plugins. IrProvider won't help here, because some functions produced by plugin have circular dependencies.

By moving compiler plugins step between psi2ir and declaration stub generator, both problems are resolved
– unbound symbols produced by psi2ir and compiler plugins are declared where they would be declared if this was a user code,
and only unbound symbols left are external dependencies, which is a correct input for lazy ir.
2019-11-26 15:26:28 +03:00
Georgy Bronnikov 1647279a8c IR: move UniqId to ir.tree module 2019-11-13 20:07:57 +03:00
Georgy Bronnikov 76016b1a3c IR: move KotlnMangler to ir.tree module 2019-11-13 20:07:57 +03:00
Roman Artemev a343a57207 [IR] Refactor ir infrastructure
- Remove range-based uniq id indexes using to link built ins
 - Limit KotlinType usages, replace them with corresponding IrType
2019-11-12 20:45:11 +03:00
Sergey Bogolepov 608885d118 [Linker] Extend KotlinIrLinker infrastructure to support libraries that
doesn't contain IR. Also bump ABI version because of addition of `ir_provider` property
2019-11-11 15:55:36 +07:00
Roman Artemev 72c4be785d [JS IR] Add proper extension point in FE to customize incremental data loading
- fix IC klib
2019-11-08 14:14:57 +03:00
Roman Artemev 1bced5d2a2 [KLIB IC] Fix file index allocation, make them stable between recompilations 2019-11-08 14:14:57 +03:00
Anton Bannykh a1569dfbf0 JS IR: fix circular dependencies in Gradle tasks 2019-10-23 13:17:29 +03:00
Alexander Gorshenev f18a3f7fa9 Several more librry resolver tweaks.
Made library builder a member function.
Moved resolverByName() back to Native for now
2019-10-11 17:02:06 +03:00
Alexander Gorshenev 55805ddeb8 JS search path resolver with attributes.
Warn on inclusion of klibs with the same name in manifest
2019-10-11 17:02:06 +03:00
Roman Artemev 6f2768e774 [JS SCRIPT] Use new dependency resolver in script/js subsytem 2019-10-10 12:52:06 +03:00
Vitaliy.Tikhonov d79279d8a5 [JS SCRIPTING] create CoreCompiler for scripting 2019-10-10 12:52:05 +03:00
Roman Artemev d5176cbf5d [IR SERIALIZATION] Get rid of UniqId proto message
- encode locality flag in major bit of uniqid (1 - global, 0 - local)
2019-10-09 13:23:18 +03:00
Alexander Gorshenev c2c88a9ee6 Use MessageCollector.NONE as a dummy logger collector for js library resolver 2019-10-08 16:56:29 +03:00
Alexander Gorshenev 71eb413350 Attached library resolver to messge collector 2019-10-08 16:56:29 +03:00
Alexander Gorshenev 47fba2ee4b A couple of fixes for js library resolver 2019-10-08 16:56:29 +03:00
Alexander Gorshenev e5dbec4523 Commonized FileRegistry with SourceFileMap for klib metadata 2019-10-08 16:56:29 +03:00
Alexander Gorshenev c227c13799 Commonizing klib metadata between native and js 2019-10-01 17:38:57 +03:00
Svyatoslav Kuzmich 7592048437 [JS] Support typeOf 2019-09-25 18:12:55 +03:00
romanart acd1cc5a57 [KLIB] Normalize path string to keep file order on Windows OS 2019-09-24 12:41:48 +03:00
Roman Artemev 0040298eac Fix master
- improve assertion message
 - compare correct file paths
 - fix C JS BE testData
2019-09-04 14:37:14 +03:00
Roman Artemev 21c7c89dbc [JS KLIB IC] Support incremental klib generation for JS IR
Note: the following test do not work yet because of IrField FO issue
testSecondaryConstructorAdded
testCompanionObjectInheritedMemberChanged
2019-09-03 14:21:32 +03:00
Roman Artemev 2e0ab8ba3f [IR SERIALIZATION] Fix ONLY_DECLARATION_HEADERS mode 2019-09-03 14:21:31 +03:00
Roman Artemev 0c7454c918 [IR SERIALIZATION] Fix forward Declarations in deserializaer 2019-09-03 14:21:31 +03:00
Roman Artemev 125982841a [IR SERIALIZATION] Fix clashes 2019-09-03 14:21:30 +03:00
Roman Artemev 55f06ecff5 [IR SERIALIZATION] Fix rebase 2019-09-03 14:21:30 +03:00
Roman Artemev f6339bcf93 [IR SERIALIZATION] Handle UniqId clashes 2019-09-03 14:21:30 +03:00
Roman Artemev 5e14b94a88 [IR SERIALIZATION] Do not track non-metadata descriptors in descriptor table 2019-09-03 14:21:30 +03:00
Roman Artemev df5f6a2a12 [IR SERIALIZATION] Refactored uniqId allocation
- split DeclarationTable into local and global one
 - minimize usages of kotlin mangler
 - clean up interfaces
2019-09-03 14:21:30 +03:00
Roman Artemev d50eb5ce52 [IR SERIALIZATION] Make [de]serialization processes incremental
- Use local uniqID local indexation file-local
 - Rethink the way declaration is looked for
 - Store in public file index only publicly accessible symbols
 - refactor API
 - code clean up
2019-09-03 14:21:29 +03:00
Roman Artemev 96a2cc1f17 [JS IR] Clean up Declaration Table code 2019-09-03 14:21:29 +03:00
Roman Artemev f14107bf65 [IR] Sort dependencies a bit early 2019-09-03 14:21:29 +03:00
Roman Artemev 1465121266 [IR] Split declaration & descriptor tables 2019-09-03 14:21:29 +03:00
Roman Artemev a7714a5589 [JS IR BE] Split IrModule/IrFile serializers 2019-09-03 14:21:29 +03:00
Roman Artemev 94a03c9cb4 [IC KLIB] Serialization infrastructure refactoring
- remove IrModule header
 - put IrDeclaration and its body into separate files
 - use only one type of IrData index
 - separate deserialization of declarations and its bodies
 - introduce FqName message
2019-09-03 14:21:29 +03:00
Steven Schäfer a90ac2438d Set correct field visibility in psi2ir 2019-08-28 19:41:11 +02:00
Svyatoslav Kuzmich 6e6ffa12a6 [WASM] Initial infrastructure
- New module ":compiler:backend.wasm"
    - Initial compiler infra (driver, phaser, context)
    - Subset of Wasm AST
    - Skeleton of IR -> Wasm AST
    - Wasm AST -> WAT transformer

- Testing infra

- SpiderMonkey jsshell tool
2019-08-22 15:59:54 +03:00
Svyatoslav Kuzmich 812083ee05 [WASM] Initial runtime library
Add directory libraries/stdlib/wasm as a placeholder for WASM runtime library
Copy built-ins from core/builtins
Add ExcludeFromCodegen annotation for internal needs
2019-08-22 15:59:49 +03:00