Commit Graph

23830 Commits

Author SHA1 Message Date
Dmitry Petrov 7e4688da93 psi2ir: add test for reference to var with non-accessible setter 2019-03-20 11:57:57 +03:00
Dmitry Petrov 21dbe2e7e7 IR: symbolName mangling for IrTypeParameter
(original author: Alexander Gorshenev)
2019-03-20 11:57:57 +03:00
Roman Artemev 206e5d30d9 Regenerate protobuf 2019-03-20 11:57:57 +03:00
Dmitry Petrov c86ef5da53 psi2ir: update testData for property references 2019-03-20 11:57:57 +03:00
romanart 5b5f3a7468 [IR] Fix classes TypeParameter [de]serialization 2019-03-20 11:57:57 +03:00
Dmitry Petrov 9f48695dde psi2ir: no unbound field symbols in delegated property references
#KT-30323 Fixed
2019-03-20 11:57:57 +03:00
Dmitry Petrov 15918fc475 IR: deprecations 2019-03-20 11:57:57 +03:00
Dmitry Petrov bd9c5645cd IR: fix property reference symbol binding for generic properties 2019-03-20 11:57:57 +03:00
Dmitry Petrov 8b4dab7c25 JS_IR: fix property name generation 2019-03-20 11:57:57 +03:00
Dmitry Petrov 04fad012a0 IR: IrPropertySymbol introduced, some code cleaned up
#KT-30304
2019-03-20 11:57:57 +03:00
Ting-Yuan Huang f6cf434650 when: emit switch for String if possible
Effectively, the following when structure:

  when (s) {
    s1, s2 -> e1,
    s3 -> e2,
    s4 -> e3,
    ...
    else -> e
  }

is implemented as:

  when (s.hashCode()) {
    h1 -> {
      if (s == s1)
        e1
      else if (s == s2)
        e1
      else if (s == s3)
        e2
      else
        e
    }
    h2 -> if (s == s3) e2 else e,
    ...
    else -> e
  }

where s1.hashCode() == s2.hashCode() == s3.hashCode() == h1,
      s4.hashCode() == h2.

A tableswitch or lookupswitch is used for the hash code lookup.

Change-Id: I087bf623dbb4a41d3cc64399a1b42342a50757a6
2019-03-20 09:13:51 +01:00
Roman Artemev 2ed29d8869 [IR BE] Use pure IrType instead of KotlinType
* clean up code
2019-03-19 20:09:07 +03:00
pyos 39adfcced1 Add more comments to PropertyReferenceLowering 2019-03-19 12:00:29 +01:00
pyos ed298c48b7 Unmute a test fixed by a combination of PR #2151 and #2184 2019-03-19 12:00:29 +01:00
pyos 6c68474489 JVM_IR: use correct signatures for local delegated property references
Which is `<v#N>` where N is the index of that property in the containing
class.
2019-03-19 12:00:29 +01:00
pyos 8c55376f0c Unmute almost all JVM_IR tests that use property references 2019-03-19 12:00:29 +01:00
pyos 330c4648cb Implement property references in JVM_IR 2019-03-19 12:00:29 +01:00
Mikhail Glukhikh a07502374e Rename (style): russian "С" to english "C" 2019-03-19 12:23:47 +03:00
pyos 82ccf81da8 Fix this remapping in inner class constructors
Inner class constructors should use the argument instead of reading
outer `this` from a field because if such an access happens before a
delegating constructor call, e.g. when evaluating an argument, a JVM
bytecode validation error will be thrown. (The only operation on `this`
allowed before a delegating constructor call is SETFIELD, and only if
the field in question is declared in the same class.)
2019-03-19 09:20:41 +01:00
pyos 7e8db4cc4a Refactor InnerClassesLowering 2019-03-19 09:20:41 +01:00
Dmitriy Novozhilov d01b6ef900 Revert "[NI] Support @OnlyInputTypes annotation. #KT-29307 fixed"
This reverts commit 90628112
With that annotation there is complex bug that breaks build of Kotlin compiler
2019-03-18 18:53:38 +03:00
Mikhail Glukhikh 16f9eecb29 Fix "/ by zero" in FirResolveBench & switch progress OFF in smoke tests 2019-03-18 17:12:02 +03:00
Mikhail Glukhikh 741bdccca5 Enhance progress logging in FIR total resolve tests 2019-03-18 14:49:11 +03:00
Svyatoslav Kuzmich 1d6cd90043 [JS IR BE] Clean up compiler driver api
This is a preparation step for JS-IR CLI:
- CompiledModule was overused. Split it into KlibModuleRef and TranslationResult
- Deserialize klib dependencies from klibs itself
2019-03-18 14:13:28 +03:00
Svyatoslav Kuzmich e302f63d9a [JS IR BE] Remove generateModuleInGlobalScope for code generator
This method used to be a workaround for test speedup.
Now we use proper close world module with runtime+stdlib module
as pre-serialized klib.
2019-03-18 14:13:28 +03:00
Ilmir Usmanov d154cf9a59 Fix test data 2019-03-18 14:04:04 +03:00
Ilmir Usmanov c68413b953 Do not generate StateMachineChecker if CHECK_STATE_MACHINE directive is
not present.
Otherwise, since it uses suspend functions, it breaks IR tests.
2019-03-18 14:04:03 +03:00
Ilmir Usmanov 7956ef18b2 Generate RETURN instead of ARETURN if (cross)inline suspend lambda returns Unit
#KT-30073 Fixed
2019-03-18 14:04:02 +03:00
Ilmir Usmanov cc9a0041e0 Check number of suspensions in crossinline tests 2019-03-18 14:04:01 +03:00
Ilmir Usmanov df52c5217d Add facility to check number of suspensions in coroutine tests 2019-03-18 14:04:01 +03:00
Nikolay Krasko b0156bc5db Minor: cleanup KotlinTypeCheckerTest.java 2019-03-18 11:56:20 +03:00
victor.petukhov 9a2178d96b Split 'nothingTypedSuspendFunction' test into two separate tests (for old and new coroutines) 2019-03-16 21:39:44 +03:00
victor.petukhov 29493a4977 Fix 'nothingTypedSuspendFunction' test after 70c35f4186 2019-03-16 14:15:08 +03:00
Alexander Gorshenev 51e862e793 Fix file descriptor unlimited growth. 2019-03-16 13:45:45 +03:00
victor.petukhov 5fc0d85b3c Regenerate FIR tests (include tests for implicit nothing as type parameter) 2019-03-16 00:41:58 +03:00
Alexander Udalov 2539873492 Remove CommonBackendContext.getClass
This function is unused in backend.common (and actually throws exception
in Native), therefore it makes sense to move it down to subtypes
2019-03-15 19:27:48 +01:00
Alexander Udalov e13b8eb039 Remove CommonBackendContext.getInternalFunctions
Similarly to getInternalClass, move to subclasses
2019-03-15 19:27:48 +01:00
Alexander Udalov bd694105e9 Remove CommonBackendContext.getInternalClass
Move to subclasses: getJvmInternalClass, getJsInternalClass and
getKonanInternalClass (in Kotlin/Native). The advantage of this is that
this API need not be shared between backends any longer, which makes
sense because implementation details differ across platforms
2019-03-15 19:27:48 +01:00
Alexander Udalov 4ab1916ebf Cleanup Symbols and JvmIr.JvmSymbols 2019-03-15 19:27:47 +01:00
Alexander Udalov e9c2bc81aa Remove lateinitIsInitializedPropertyGetter, introduce static check function
This will be helpful in JVM IR tests without stdlib where it's not
necessary to have 'isInitialized' in dependencies
2019-03-15 19:27:47 +01:00
Alexander Udalov c730de13df Minor, add missing copyright to compiler modules 2019-03-15 19:27:46 +01:00
Alexander Udalov 9ca7719d1f Minor, inline obsolete and deprecated createFunctionSymbol
Also undeprecate 'createSymbolForScopeOwner' and make it private
2019-03-15 19:07:16 +01:00
Alexander Udalov 0c8e58936c Remove DeepCopyIrTree and most "Creates unbound symbol" deprecated members 2019-03-15 19:05:19 +01:00
victor.petukhov 70c35f4186 Introduce warning about implicitly inferred Nothing as a type parameter
^KT-20849 Fixed
2019-03-15 19:28:38 +03:00
Roman Artemev 1f98eaa27b [JS IR BE] Fix Callable reference with vararg
* Update tests
2019-03-15 19:21:38 +03:00
Roman Artemev a2d65e8a60 [IR] Code clean up 2019-03-15 19:21:38 +03:00
Roman Artemev 95821313e3 [IR BE] Get rid of usages of descriptor-based IrType utils 2019-03-15 19:21:38 +03:00
Roman Artemev 238f1b2b06 [IR] * Implement isSubtypeOfClass and commonSuperclass based on pure Ir
* Implement type strict equality check
     * Move type checkers into Ir
     * Implement strict Fqn-based classifier equality checker
2019-03-15 19:21:38 +03:00
Simon Ogorodnik e056882aa6 Add DiagnosticsTest testData based smoke test for FIR #KT-29962 Fixed
Yet seven of these tests fail with an exception in RawFirBuilder
2019-03-15 18:31:55 +03:00
Mikhail Glukhikh 0d976a4870 FIR: forbid supertype resolve in local classes 2019-03-15 18:31:49 +03:00