Commit Graph

421 Commits

Author SHA1 Message Date
Ilya Matveev 4c3016d21b unit-tests: Minor fixes before review 2017-09-25 11:31:22 +03:00
Ilya Matveev 2d757c4150 unit-tests: Add assertion and annotation tests 2017-09-25 11:31:22 +03:00
Ilya Matveev 345e3570cc unit-tests: Support tests in objects 2017-09-25 11:31:22 +03:00
Ilya Matveev f1c59707dd unit-tests: Top level test support 2017-09-25 11:31:22 +03:00
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
Svyatoslav Scherbina 79455c5161 Support interop modularity
* Add list of included headers into the manifest
* Implement importing "foreign" type declarations
* Implement forward declarations more natively in the compiler
* Represent Objective-C categories as Kotlin extension methods and
  properties

Also:
* Do some refactoring in stub generation
* Call bridges directly in stubs for Objective-C properties
2017-09-14 16:47:26 +03:00
Ilya Matveev c32b84efd1 stdlib: Move exit function to porting layer 2017-09-07 18:48:10 +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
Igor Chevdar eabe2435bf Rewrote escape analysis 2017-08-02 18:44:04 +03:00
Ilya Matveev effe54d470 stdlib: Add also function 2017-08-02 20:20:09 +07:00
Vasily Levchenko f07273d55f [debug][test] build fix 2017-07-28 17:52:58 +03: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
Ilya Matveev c994573a77 regex: Fix warnings and TODOs 2017-06-20 02:53:54 +07:00
Ilya Matveev bfcc0fc0d0 regex: Refactor predefined character classes. 2017-06-20 02:53:54 +07:00
Ilya Matveev 1bf9b23108 regex: Initial regex implementation
regex: All tests are passed.
2017-06-20 02:53:54 +07:00
Ilya Matveev 4f251003ef tests: Add Harmony regex tests 2017-06-20 02:53:54 +07: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
Igor Chevdar 242e1da191 Removed redundant main from tests 2017-06-07 12:29:22 +03:00
Ilya Matveev a70f170e80 [SQUASHME] bitset: fix logical operations. 2017-06-07 11:11:36 +07: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