Commit Graph

121 Commits

Author SHA1 Message Date
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
Ilya Chernikov 2ed8fa7624 Convert main task creating helper to lazy API, refactor accordingly 2019-08-21 20:20:08 +02:00
Alexey Tsvetkov 3366ac4b18 Save incremental data with KLIB compiler 2019-08-15 15:11:52 +03:00
Alexey Tsvetkov fc49510049 Add tests for IC with JS IR BE 2019-08-15 15:11:52 +03:00
Alexander Udalov b970a57adb Generate version requirement on inline functions since API version 1.4
The old compiler will crash if it tries to inline a function that's
passing a lambda parameter into the new parameter null check method
`Intrinsics.checkNotNullParameter` because that usage is not considered as
inlinable by the old compiler (it only knows about
`Intrinsics.checkParameterIsNotNull`). Therefore we require that these
functions can only be read by compilers of version 1.3.50 or greater.

 #KT-22275 Fixed
2019-08-12 16:09:23 +02:00
Igor Chevdar 226013353d [IrSerializer] Removed hacks with functional interfaces 2019-08-12 17:07:43 +03:00
Igor Chevdar 00dc335559 [IrSerializer] Preparations for functional interfaces handling 2019-08-12 17:07:43 +03:00
Dmitry Petrov f590d4da9e IR: IrTypeAlias: serialize/deserialize new IR objects
Add uniqId for typealias declarations.
Implement WrappedTypeAliasDescriptor.
2019-08-06 12:42:43 +03:00
Roman Artemev d7cb3e05ef [JS IR BE] Replace 32bit default String.hashcode with 64bit cityhash for UniqID
Split uniqID space into two part 63 bit each.
2019-07-04 12:49:30 +03:00
Igor Chevdar dff0ac8866 [Serializer] UniqId clashes handling 2019-06-27 19:04:00 +03:00