Commit Graph

434 Commits

Author SHA1 Message Date
Igor Chevdar df3e114f31 Added phase RETURNS_INSERTION
Moved explicit insertion of return statement from code generator to a lowering
2017-10-04 13:31:30 +03:00
Alexander Gorshenev 606f98f9d3 Added minimal posix.def for windows. 2017-09-28 12:32:09 +03:00
Sergey Bogolepov 0fb788d580 Renamed targets. Added linux_ prefix
mips32   -> linux_mips32
mipsel32 -> linux_mipsel32
2017-09-26 16:18:33 +03:00
Sergey Bogolepov b7978c3a1f Renamed targets.
mips -> mips32
mipsel -> mipsel32
2017-09-26 16:18:33 +03:00
Sergey Bogolepov 46eed4efbb Enabled disabled targets 2017-09-26 16:18:33 +03:00
Sergey Bogolepov ca567ac35c Added support for mipsel 2017-09-26 16:18:33 +03:00
Sergey Bogolepov 9187022721 Initial support for MIPS 2017-09-26 16:18:33 +03:00
SvyatoslavScherbina 786374ef86 Add basic support for class references
Also use class name for `Any.toString` and `Throwable.toString`.
2017-09-26 10:59:45 +03:00
Svyatoslav Scherbina a6ca64871f Implement explicit and implicit object pinning for interop
This allows passing Kotlin primitive arrays directly to native
2017-09-26 09:50:42 +03:00
Vasily Levchenko 197f77f8e3 [tests] string builder appendln tests 2017-09-25 17:51:33 +03:00
Ilya Matveev 412d0485e4 box-tests: Remove duplicating assertions from testUtils.kt
The testUtils.kt contains some assertions which are now implemented
in stdlib. This patch removes them from testUtils.kt
2017-09-25 13:45:11 +03:00
Alexander Gorshenev f1c3e866b4 A couple of tests for default libraries. 2017-09-25 12:49:22 +03:00
Ilya Matveev 6db5bbb4f0 unit-tests: Disable tests for unit tests support on wasm32 2017-09-25 11:31:22 +03:00
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