Commit Graph

1205 Commits

Author SHA1 Message Date
Alexander Gorshenev 0e7b13027e Changed AllocStringInstance to accept data and length. 2016-12-01 19:20:12 +04:00
Alexander Gorshenev d0cd28fe5a Underscore is not needed on Linux for resolution of 'kfun:_start()'. 2016-12-01 19:20:12 +04:00
Alexander Gorshenev 2c89fee837 Simplified launcher to utilize some ready made functionality. 2016-12-01 19:20:12 +04:00
Alexander Gorshenev 62be62e5d6 Added a test for exception handling in 'start'. 2016-12-01 19:20:12 +04:00
Alexander Gorshenev 22d748001d Added "start" function between the C launcher and Kotlin "main" 2016-12-01 19:20:12 +04:00
Alexander Gorshenev 1aa7b23853 For better incrementality, specified :stdlib output file, as it is
non-standard for that kind of gradle task.
2016-12-01 19:20:12 +04:00
Alexander Gorshenev 3f480eb846 Transfer C argv to Kotlin's args. 2016-12-01 19:20:12 +04:00
SvyatoslavScherbina e38ac775ad Calling Kotlin from C++ runtime (#107)
* backend: support exporting Kotlin functions for C++ runtime

* runtime: implement several functions in Kotlin

* Throw{NullPointer,ArrayIndexOutOfBounds,ClassCast}Exception

* runtime: add literal declared in Kotlin as empty string

Also
* add corresponding test
* use empty string literal in strdedup2
  (however keep it disabled)

* fixup! runtime: add literal declared in Kotlin as empty string

* Review feedback: add more TheEmptyString() usages

Also improve string index checks in runtime
2016-12-01 16:10:03 +03:00
Nikolay Igotti f9167ea91e Attempt of listOf() support. (#92) 2016-12-01 16:09:26 +03:00
Nikolay Igotti 85aca55ee5 Add hashCode() for primitives. (#104) 2016-12-01 16:07:06 +03:00
Vasily Levchenko 28918f92f7 kotlin-compiler: 1.1-20161201.112229-281 2016-12-01 15:26:10 +03:00
Nikolay Igotti fbf4db6428 Fix RTTI bugs. (#105) 2016-12-01 15:08:08 +03:00
Svyatoslav Scherbina 71a8886856 backend: add minor code improvements
Including:

* Introduce parameter scope.
* Use more appropriate descriptor types.
* Use words 'parameter' and 'arguments' more correctly.
2016-12-01 13:20:05 +07:00
Svyatoslav Scherbina a65aef0198 backend: rework variables
* use descriptor instead of name to refer to variables
* bind variables to scopes
* begin refactoring mapping between LLVM and IR parameters
2016-12-01 13:20:05 +07:00
Nikolay Igotti e131622ef7 Use memmove() for potentially overlapping ranges. 2016-11-22 13:10:25 +03:00
Nikolay Igotti bb6da99feb Fix ArrayList tests. 2016-11-30 17:39:50 +03:00
Alexander Gorshenev 95433e8a82 Moved a couple more Konan specific annotations to "konan" package 2016-11-30 17:45:07 +04:00
Alexander Gorshenev b2983850b6 Moved Konan specific annotation "@Used" to "konan" package. 2016-11-30 17:45:07 +04:00
Alexander Gorshenev bd5b4b2f52 Annotation used 2016-11-30 17:45:07 +04:00
KonstantinAnisimov 90b6a12a5c Canonical name (#99)
* TEST: enabled testRetainAll

* Method resolution spared of annotations and generics

* TEST: test for canonical names "interface+generic" added

* Methods' canonical names support:

- Recursive iteration of method argument types
- Arguments in question are delivered from topmost overriden ancestor of this method
2016-11-30 16:19:28 +03:00
Nikolay Igotti e9b0ebb95e Ranges support. (#73) 2016-11-30 15:38:47 +03:00
Vasily Levchenko b38a76e910 CODEGEN: AllocArrayInstance and AllocInstance return ArrayHeader * and ObjHeader * respectively 2016-11-30 14:49:23 +03:00
Vasily Levchenko b62536f807 RUNTIME: AllocArrayInstance and AllocInstance return ArrayHeader * and ObjHeader * respectively 2016-11-30 14:49:23 +03:00
Nikolay Igotti d4fda3bfe2 String <-> CharArray conversion, ArrayBuilder by @elizarov (#98) 2016-11-30 13:06:36 +03:00
Svyatoslav Scherbina badecf8210 Interop, backend: remove code avoiding zero-length C arrays 2016-11-30 15:00:55 +07:00
Svyatoslav Scherbina 8dc42bbe35 Interop: support allocating zero bytes 2016-11-30 15:00:55 +07:00
Svyatoslav Scherbina 0e43e0d0d8 backend: add test for empty string literal
also restore removed disabled test
2016-11-30 15:00:55 +07:00
Nikolay Igotti 51d6dfe713 Append all variable allocations to prologue. (#97) 2016-11-29 16:14:29 +03:00
SvyatoslavScherbina 075562f46b Merge pull request #93 from JetBrains/try-catch-finally
Implement throw and try-catch-finally in backend

add corresponding tests
2016-11-29 15:01:23 +07:00
Svyatoslav Scherbina 0c81cfdb24 Review feedback, part 2:
implement return to any target from FinalizingScope
2016-11-29 14:01:07 +07:00
Svyatoslav Scherbina d44b79fa51 Review feedback, part 1 2016-11-29 13:06:02 +07:00
Konstantin Anisimov 5ae4e3372b CODEGEN: support for safe cast type operator added 2016-11-28 21:48:01 +03:00
Konstantin Anisimov 837ae60eaf TEST: tests for safe cast added 2016-11-28 21:48:01 +03:00
Vasily Levchenko c35af302b0 TEST: coercion test enchancement from @olonho 2016-11-28 19:32:37 +03:00
Vasily Levchenko 835ab152f3 CODEGEN: fix evaluateBlock()
- we shouldn't ignore variable name to return
2016-11-28 19:32:37 +03:00
Vasily Levchenko de06d069b1 STDLIB: return original ++ operations 2016-11-28 19:32:37 +03:00
Vasily Levchenko 0887dfabae CODEGEN: coercion fixed
- do not let evaluateWhen ignore case when there're no result expected.
2016-11-28 19:32:37 +03:00
Vasily Levchenko 90d705aae2 kotlin-compiler: 1.1-20161128.112645-274 2016-11-28 19:24:18 +03:00
Alexander Gorshenev 5627688390 A million element byte array segfaults 2016-11-28 20:15:15 +04:00
Svyatoslav Scherbina 9848091186 backend: implement try-catch-finally
also add some hacks to handle unreachable code
2016-11-28 20:47:21 +07:00
Svyatoslav Scherbina e2dbeae85e backend: add tests for try-catch-finally and throwing exceptions
also add some tests for bugs with unreachable code handling and variables
2016-11-28 20:24:27 +07:00
Svyatoslav Scherbina 70fa3ba56a backend/tests: build with C++
because runtime is written in C++
2016-11-28 20:24:27 +07:00
Konstantin Anisimov 725512ad96 CODEGEN: enable interfaces in translator 2016-11-28 16:14:04 +03:00
Konstantin Anisimov bb665ccc70 TEST: enable interface test 2016-11-28 16:14:04 +03:00
Nikolay Igotti e800e8acd6 Use primary constructor in ArrayList. 2016-11-28 15:41:03 +03:00
Nikolay Igotti 3d2166410c TEST: Coercion to Unit and ++/-- tests. (#87) 2016-11-27 11:22:54 +03:00
Nikolay Igotti 29c0eda720 Array list, implementation by @elizarov (#84) 2016-11-26 16:30:15 +03:00
Vasily Levchenko f4529298e4 CODEGEN: more logging and verification 2016-11-26 14:16:47 +03:00
Konstantin Anisimov ce19f73172 RUNTIME: missed operators implemented:
- Kotlin_Int_toChar
- Kotlin_Long_xor_Long
- Kotlin_Long_ushr_Long

(cherry picked from commit 7222a8effe6ae23c7ce9784fc65225282876fde4)
2016-11-25 23:37:49 +03:00
Konstantin Anisimov 87c8a9f895 CODEGEN: fix initialization and workarounds for object initialization with companion objects and etc.
(cherry picked from commit ae9e493ee92a3730a5ad82e072ab7eed32a8cc27)
2016-11-25 23:37:49 +03:00