Commit Graph

322 Commits

Author SHA1 Message Date
Ilya Matveev 45992a2b75 unit-tests: Simple support for test classes 2017-09-25 11:31:22 +03:00
Vasily Levchenko f26e5b5f02 unit-tests: Create a simple test runner implementation 2017-09-25 11:31:22 +03:00
Ilya Matveev ea667ebc5c stdlib: Add exitProcess function 2017-09-07 18:48:10 +03:00
Svyatoslav Scherbina 4e285a5ef4 Implement equals, hashCode and toString for Objective-C objects 2017-09-06 23:57:19 +03:00
Igor Chevdar 136c62a62c Added test on workers with invalid transfer attempt 2017-08-29 16:39:49 +03:00
Nikolay Igotti 109f84f9af Immutable data prototype. (#799) 2017-08-22 16:21:10 +03:00
Svyatoslav Scherbina 99dd7227dc Support Boolean in interop varargs and function pointers invocation 2017-08-18 17:45:41 +03:00
Svyatoslav Scherbina 5586d29764 Add basic support for calling C function pointers
Fix #739
2017-08-18 17:45:41 +03:00
Svyatoslav Scherbina 5c3e8d63d4 Support bit fields in interop
Fix #728
2017-08-16 15:03:58 +03:00
Svyatoslav Scherbina d3185e3e19 Implement very basic Objective-C interop
Also refactor StubGenerator
2017-08-16 10:04:23 +03:00
Alexander Gorshenev c7d5d6851d Classified the rest of the wasm32 expected failures. 2017-08-09 17:34:26 +03:00
Alexander Gorshenev 77cbd39907 Global initializers for wasm32. 2017-08-09 17:34:26 +03:00
Alexander Gorshenev 26d383c8be Support grow() operation for wasm32 memory. 2017-08-09 17:23:40 +03:00
Igor Chevdar 56e08e40e8 Added some corner tests on escape analysis 2017-08-07 16:45:51 +03:00
Alexander Gorshenev 21ad2d97e6 Fix broken build.
The fix for d8 readline() broke hello1 and hello2 tests.
2017-08-04 15:50:27 +03:00
Alexander Gorshenev b4660d03a1 Initial .wasm file generation for the wasm32 target.
Some basic launcher.js and runtime.
2017-08-03 17:51:48 +03:00
Ilya Matveev effe54d470 stdlib: Add also function 2017-08-02 20:20:09 +07:00
Ilya Matveev 0e67fbb7ad tests: Add assert tests 2017-07-27 11:49:54 +07:00
Ilya Matveev 42c4391654 backend: Process 'until MIN_VALUE' in for loops
This patch takes into account a corner case available for loops
over a progression (see backend.native/tests/external/codegen/box/
ranges/forInUntil/forInUntilMinint.kt test):

for (i in 0 until Int.MIN_VALUE) { ... }

Here we cannot use subtraction to obtain a right bound of the loop
due to an overflow. Instead we consider any loop with MIN_VALUE in
it's right bound as empty loop. Such behaviour is similar to the one
of 'until' method.

So now the empty check for a loops with 'until' call:

for (i in first until bound) { ... }

is as follows:

val last = getProgressionLast(first, bound, step) // Only if step==1
if (first <= last && bound > <Int|Long|Char>.MIN_VALUE) {
    do { ... } while(i != last)
}

Further improvements: We can generate a simpler IR for some simple
frequent cases (e.g. for until calls without steps) and eliminate
loops if we can prove that they are empty.
2017-07-25 22:26:17 +07:00
Ilya Matveev 0ddc002b8d backend: Use IrComposite instead of IrBlock in headers of 'for' loops 2017-07-20 10:35:40 +07:00
Ilya Matveev d6e0f67d4e tests: Add test for nested 'for' loops 2017-07-18 17:05:58 +07:00
Ilya Matveev 6ea341be06 tests: Move 'for' loop lowering tests into 'controlflow' directory 2017-07-18 17:05:58 +07:00
Ilya Matveev 745fc711f8 backend: Add caching for unary and binary operation symbols 2017-07-18 17:05:58 +07:00
Ilya Matveev 01f0540fac backend: Don't cast step in 'for' loop lowering 2017-07-18 17:05:58 +07:00
Ilya Matveev a97a310987 tests: Add tests for empty ranges in 'for' loops 2017-07-18 17:05:58 +07:00
Ilya Matveev d474f207e3 backend: Don't create a Progression objects in 'for' loops
This patch optimizes the following pattern:

for (i in first..last step st) { ... }

In this case we need to create a Progression object and then call its
iterator() method causing at least 2 allocation per loop. This change
replaces such loops with the following constuction:

var inductionVar = first
checkProgressionStep(step)  // check if step > 0
last = getProgressionLastElement(first, last, step)
if (first <= last) {
    do {
        i = inductionVar
        inductionVar += step
        ...
    } while(i != last)
}
2017-07-18 17:05:58 +07:00
Nikolay Igotti 1ad50bc33f Workers draft (#655) 2017-06-21 11:26:09 +03:00
alexander-gorshenev d3c24bb387 Different extensions (and KonanTarget communalization). (#665) 2017-06-19 12:45:57 +03:00
Ilya Matveev 07c8404a5e backend: Fix enum constructor default parameters
The problem was observed in the follwing code:

enum class A(one: Int, val two: Int = one) ...

The problem is in the `two` default value. Here the enum constructor
lowering used an old (not lowered) symbol for `one`. Also the lowering
didn't copy the default expression for DEFAULT class.
The patch fixes both problems.
2017-06-14 19:42:29 +07:00
Ilya Matveev e64a5f42f0 stdlib: Improve character API.
The patch adds methods for surrogate characters processing and Unicode
category support needed for regular expression library.
2017-06-14 10:33:45 +07:00
Ilya Matveev a18e9dbe0d backend: Don't process FAKE_OVERRIDE properties in lateinit lowering 2017-06-09 19:13:52 +07:00
Alexander Podkhalyuzin 9e8ca0fa8d Fixed tests. 2017-06-08 17:21:04 +03:00
Alexander Podkhalyuzin bc941269f0 Fixed samples for the latest changes in Gradle plugin.
- Smaller gradle scripts.
- More structure in sample projects.
- Simplified build/run.
- Added gradle to the rest two samples.
- Almost removed all sh scripts.
- Gradle now works only inside of build directory.
- Fixed READMEs according to the new changes.
2017-06-08 17:21:04 +03:00
Ilya Matveev 6ff43d690f stdlib: Add BitSet implementation. 2017-06-07 11:11:36 +07:00
Alexander Gorshenev 5192bd1313 Entry point selection.
$ kotlinc -entry foo.bar.qux ...

selects `qux(args: Array<String>):Unit` in the package `foo.bar` as an entry point.

The short flag is `-e`.
2017-06-05 20:56:10 +03:00
Nikolay Igotti a5fe494ae3 Fix Windows tests (#622) 2017-06-01 11:46:14 +03:00
Nikolay Igotti 74ffc479bb Add Windows i18n support (#617) 2017-05-31 10:01:49 +03:00
Igor Chevdar 111a5b0e34 Fixed some tests 2017-05-30 14:50:15 +03:00
Svyatoslav Scherbina d6b8b4fb0f Add basic support for Windows with mingw-w64 2017-05-29 19:13:55 +03:00
igotti-google 7ba6b6d2cc Revert "Interop test fix"
This reverts commit 09eee739f0.
2017-05-27 11:26:56 +03:00
Nikolay Igotti 09eee739f0 Interop test fix 2017-05-26 16:49:58 +03:00
Igor Chevdar 6116f24abc Added test on callable reference to property 2017-05-24 13:56:08 +03:00
Alexander Gorshenev 85ecce2a9e Don't use a golden value for a test that don;t run. 2017-05-19 13:52:35 +03:00
Alexander Gorshenev 2283a941b7 Simple sanity check of cross compilation build and compiler execution. 2017-05-19 13:52:35 +03:00
Alexander Gorshenev 2a246a9a3a Some tests for inline members. 2017-05-17 22:04:32 +03:00
Igor Chevdar 8a789a9ac4 Added test on function overriding return type with Unit 2017-05-16 16:30:29 +03:00
Igor Chevdar 39d1b8956d Test on abstract bridge 2017-05-10 15:44:22 +03:00
Igor Chevdar e600c93dfa Enabled tests with finally blocks on coroutines + added tests 2017-05-04 20:44:36 +05:00
Ilya Matveev 74bd3256f0 runtime: Correct Float.MIN_VALUE 2017-05-03 16:59:59 +07:00
Svyatoslav Scherbina c222eb8f04 Fix conversion between P1.(...)->R and (P1, ...)->R when inlining 2017-05-02 22:18:18 +03:00