Commit Graph

15 Commits

Author SHA1 Message Date
Roman Artemev
540b3cfec3 [JS IR] Fix test to make them able to run with JS 2019-12-24 19:26:05 +03:00
Mark Punzalan
9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +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
Svyatoslav Kuzmich
aa811dcfb3 [JS IR BE] Add KJS_WITH_FULL_RUNTIME directive to compiler tests 2019-01-24 16:14:40 +03:00
Anton Bannykh
2e709a81fa [JS IR BE] Arrays, varargs 2018-09-18 14:36:20 +03:00
Pavel Punegov
2ff6047845 Update ignore tag for Native backend 2018-08-28 13:48:43 +03:00
Roman Artemev
c62e4b4fcf [JS IR BE] Support coroutines
* Move FinallyBlockLowering to common part
* Fix catching of dynamic exception
* Fix bridges for suspend functions
* Disable explicit cast to Unit
* Run lowering per module
* Update some test data
2018-08-08 18:33:39 +03:00
Dmitry Petrov
c312fddb45 Ignore some 'when' subject variable tests in JS_IR be 2018-06-20 14:06:34 +03:00
Dmitry Petrov
34b76a3718 Support subject variable in specialized code generators for 'when' 2018-06-20 14:06:34 +03:00
Anton Bannykh
96355e2732 JS IR: mute codegen box tests automatically 2018-06-09 19:15:38 +03:00
Alexey Andreev
678b4c67c1 JS: translate when to JsSwitch when possible
See KT-21160
2017-11-17 11:07:38 +03:00
Igor Chevdar
d7e4350d42 Ignored/fixed some tests for Kotlin/Native 2017-06-28 12:54:32 +03:00
Alexey Andreev
b5358122e2 JS: unmute shared box tests 2016-11-16 19:50:10 +03:00
Zalim Bashorov
596f3364c6 Automatically mute failed tests 2016-11-09 21:41:12 +03:00
Alexander Udalov
06a67e6602 Merge boxWithStdlib testData into box, delete BoxWithStdlib test 2016-03-09 10:25:38 +03:00