Fri, 11 Jan 2013 16:47:23 -0800
8005820: Shark: enable JSR292 support
Reviewed-by: twisti
Contributed-by: Roman Kennke <rkennke@redhat.com>
twisti@2047 | 1 | /* |
stefank@2314 | 2 | * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. |
twisti@2047 | 3 | * Copyright 2008, 2009, 2010 Red Hat, Inc. |
twisti@2047 | 4 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
twisti@2047 | 5 | * |
twisti@2047 | 6 | * This code is free software; you can redistribute it and/or modify it |
twisti@2047 | 7 | * under the terms of the GNU General Public License version 2 only, as |
twisti@2047 | 8 | * published by the Free Software Foundation. |
twisti@2047 | 9 | * |
twisti@2047 | 10 | * This code is distributed in the hope that it will be useful, but WITHOUT |
twisti@2047 | 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
twisti@2047 | 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
twisti@2047 | 13 | * version 2 for more details (a copy is included in the LICENSE file that |
twisti@2047 | 14 | * accompanied this code). |
twisti@2047 | 15 | * |
twisti@2047 | 16 | * You should have received a copy of the GNU General Public License version |
twisti@2047 | 17 | * 2 along with this work; if not, write to the Free Software Foundation, |
twisti@2047 | 18 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
twisti@2047 | 19 | * |
twisti@2047 | 20 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
twisti@2047 | 21 | * or visit www.oracle.com if you need additional information or have any |
twisti@2047 | 22 | * questions. |
twisti@2047 | 23 | * |
twisti@2047 | 24 | */ |
twisti@2047 | 25 | |
stefank@2314 | 26 | #include "precompiled.hpp" |
stefank@2314 | 27 | #include "interpreter/bytecodes.hpp" |
stefank@2314 | 28 | #include "shark/llvmHeaders.hpp" |
stefank@2314 | 29 | #include "shark/llvmValue.hpp" |
stefank@2314 | 30 | #include "shark/sharkBlock.hpp" |
stefank@2314 | 31 | #include "shark/sharkBuilder.hpp" |
stefank@2314 | 32 | #include "shark/sharkConstant.hpp" |
stefank@2314 | 33 | #include "shark/sharkState.hpp" |
stefank@2314 | 34 | #include "shark/sharkValue.hpp" |
stefank@2314 | 35 | #include "shark/shark_globals.hpp" |
stefank@2314 | 36 | #include "utilities/debug.hpp" |
twisti@2047 | 37 | |
twisti@2047 | 38 | using namespace llvm; |
twisti@2047 | 39 | |
twisti@2047 | 40 | void SharkBlock::parse_bytecode(int start, int limit) { |
twisti@2047 | 41 | SharkValue *a, *b, *c, *d; |
twisti@2047 | 42 | int i; |
twisti@2047 | 43 | |
twisti@2047 | 44 | // Ensure the current state is initialized before we emit any code, |
twisti@2047 | 45 | // so that any setup code for the state is at the start of the block |
twisti@2047 | 46 | current_state(); |
twisti@2047 | 47 | |
twisti@2047 | 48 | // Parse the bytecodes |
twisti@2047 | 49 | iter()->reset_to_bci(start); |
twisti@2047 | 50 | while (iter()->next_bci() < limit) { |
twisti@2047 | 51 | NOT_PRODUCT(a = b = c = d = NULL); |
twisti@2047 | 52 | iter()->next(); |
twisti@2047 | 53 | |
twisti@2047 | 54 | if (SharkTraceBytecodes) |
twisti@2047 | 55 | tty->print_cr("%4d: %s", bci(), Bytecodes::name(bc())); |
twisti@2047 | 56 | |
twisti@2047 | 57 | if (has_trap() && trap_bci() == bci()) { |
twisti@2047 | 58 | do_trap(trap_request()); |
twisti@2047 | 59 | return; |
twisti@2047 | 60 | } |
twisti@2047 | 61 | |
twisti@2047 | 62 | if (UseLoopSafepoints) { |
twisti@2047 | 63 | // XXX if a lcmp is followed by an if_?? then C2 maybe-inserts |
twisti@2047 | 64 | // the safepoint before the lcmp rather than before the if. |
twisti@2047 | 65 | // Maybe we should do this too. See parse2.cpp for details. |
twisti@2047 | 66 | switch (bc()) { |
twisti@2047 | 67 | case Bytecodes::_goto: |
twisti@2047 | 68 | case Bytecodes::_ifnull: |
twisti@2047 | 69 | case Bytecodes::_ifnonnull: |
twisti@2047 | 70 | case Bytecodes::_if_acmpeq: |
twisti@2047 | 71 | case Bytecodes::_if_acmpne: |
twisti@2047 | 72 | case Bytecodes::_ifeq: |
twisti@2047 | 73 | case Bytecodes::_ifne: |
twisti@2047 | 74 | case Bytecodes::_iflt: |
twisti@2047 | 75 | case Bytecodes::_ifle: |
twisti@2047 | 76 | case Bytecodes::_ifgt: |
twisti@2047 | 77 | case Bytecodes::_ifge: |
twisti@2047 | 78 | case Bytecodes::_if_icmpeq: |
twisti@2047 | 79 | case Bytecodes::_if_icmpne: |
twisti@2047 | 80 | case Bytecodes::_if_icmplt: |
twisti@2047 | 81 | case Bytecodes::_if_icmple: |
twisti@2047 | 82 | case Bytecodes::_if_icmpgt: |
twisti@2047 | 83 | case Bytecodes::_if_icmpge: |
twisti@2047 | 84 | if (iter()->get_dest() <= bci()) |
twisti@2047 | 85 | maybe_add_backedge_safepoint(); |
twisti@2047 | 86 | break; |
twisti@2047 | 87 | |
twisti@2047 | 88 | case Bytecodes::_goto_w: |
twisti@2047 | 89 | if (iter()->get_far_dest() <= bci()) |
twisti@2047 | 90 | maybe_add_backedge_safepoint(); |
twisti@2047 | 91 | break; |
twisti@2047 | 92 | |
twisti@2047 | 93 | case Bytecodes::_tableswitch: |
twisti@2047 | 94 | case Bytecodes::_lookupswitch: |
twisti@2047 | 95 | if (switch_default_dest() <= bci()) { |
twisti@2047 | 96 | maybe_add_backedge_safepoint(); |
twisti@2047 | 97 | break; |
twisti@2047 | 98 | } |
twisti@2047 | 99 | int len = switch_table_length(); |
twisti@2047 | 100 | for (int i = 0; i < len; i++) { |
twisti@2047 | 101 | if (switch_dest(i) <= bci()) { |
twisti@2047 | 102 | maybe_add_backedge_safepoint(); |
twisti@2047 | 103 | break; |
twisti@2047 | 104 | } |
twisti@2047 | 105 | } |
twisti@2047 | 106 | break; |
twisti@2047 | 107 | } |
twisti@2047 | 108 | } |
twisti@2047 | 109 | |
twisti@2047 | 110 | switch (bc()) { |
twisti@2047 | 111 | case Bytecodes::_nop: |
twisti@2047 | 112 | break; |
twisti@2047 | 113 | |
twisti@2047 | 114 | case Bytecodes::_aconst_null: |
twisti@2047 | 115 | push(SharkValue::null()); |
twisti@2047 | 116 | break; |
twisti@2047 | 117 | |
twisti@2047 | 118 | case Bytecodes::_iconst_m1: |
twisti@2047 | 119 | push(SharkValue::jint_constant(-1)); |
twisti@2047 | 120 | break; |
twisti@2047 | 121 | case Bytecodes::_iconst_0: |
twisti@2047 | 122 | push(SharkValue::jint_constant(0)); |
twisti@2047 | 123 | break; |
twisti@2047 | 124 | case Bytecodes::_iconst_1: |
twisti@2047 | 125 | push(SharkValue::jint_constant(1)); |
twisti@2047 | 126 | break; |
twisti@2047 | 127 | case Bytecodes::_iconst_2: |
twisti@2047 | 128 | push(SharkValue::jint_constant(2)); |
twisti@2047 | 129 | break; |
twisti@2047 | 130 | case Bytecodes::_iconst_3: |
twisti@2047 | 131 | push(SharkValue::jint_constant(3)); |
twisti@2047 | 132 | break; |
twisti@2047 | 133 | case Bytecodes::_iconst_4: |
twisti@2047 | 134 | push(SharkValue::jint_constant(4)); |
twisti@2047 | 135 | break; |
twisti@2047 | 136 | case Bytecodes::_iconst_5: |
twisti@2047 | 137 | push(SharkValue::jint_constant(5)); |
twisti@2047 | 138 | break; |
twisti@2047 | 139 | |
twisti@2047 | 140 | case Bytecodes::_lconst_0: |
twisti@2047 | 141 | push(SharkValue::jlong_constant(0)); |
twisti@2047 | 142 | break; |
twisti@2047 | 143 | case Bytecodes::_lconst_1: |
twisti@2047 | 144 | push(SharkValue::jlong_constant(1)); |
twisti@2047 | 145 | break; |
twisti@2047 | 146 | |
twisti@2047 | 147 | case Bytecodes::_fconst_0: |
twisti@2047 | 148 | push(SharkValue::jfloat_constant(0)); |
twisti@2047 | 149 | break; |
twisti@2047 | 150 | case Bytecodes::_fconst_1: |
twisti@2047 | 151 | push(SharkValue::jfloat_constant(1)); |
twisti@2047 | 152 | break; |
twisti@2047 | 153 | case Bytecodes::_fconst_2: |
twisti@2047 | 154 | push(SharkValue::jfloat_constant(2)); |
twisti@2047 | 155 | break; |
twisti@2047 | 156 | |
twisti@2047 | 157 | case Bytecodes::_dconst_0: |
twisti@2047 | 158 | push(SharkValue::jdouble_constant(0)); |
twisti@2047 | 159 | break; |
twisti@2047 | 160 | case Bytecodes::_dconst_1: |
twisti@2047 | 161 | push(SharkValue::jdouble_constant(1)); |
twisti@2047 | 162 | break; |
twisti@2047 | 163 | |
twisti@2047 | 164 | case Bytecodes::_bipush: |
twisti@2047 | 165 | push(SharkValue::jint_constant(iter()->get_constant_u1())); |
twisti@2047 | 166 | break; |
twisti@2047 | 167 | case Bytecodes::_sipush: |
twisti@2047 | 168 | push(SharkValue::jint_constant(iter()->get_constant_u2())); |
twisti@2047 | 169 | break; |
twisti@2047 | 170 | |
twisti@2047 | 171 | case Bytecodes::_ldc: |
twisti@2047 | 172 | case Bytecodes::_ldc_w: |
twisti@4314 | 173 | case Bytecodes::_ldc2_w: { |
twisti@4314 | 174 | SharkConstant* constant = SharkConstant::for_ldc(iter()); |
twisti@4314 | 175 | assert(constant->is_loaded(), "trap should handle unloaded classes"); |
twisti@4314 | 176 | push(constant->value(builder())); |
twisti@2047 | 177 | break; |
twisti@4314 | 178 | } |
twisti@2047 | 179 | case Bytecodes::_iload_0: |
twisti@2047 | 180 | case Bytecodes::_lload_0: |
twisti@2047 | 181 | case Bytecodes::_fload_0: |
twisti@2047 | 182 | case Bytecodes::_dload_0: |
twisti@2047 | 183 | case Bytecodes::_aload_0: |
twisti@2047 | 184 | push(local(0)); |
twisti@2047 | 185 | break; |
twisti@2047 | 186 | case Bytecodes::_iload_1: |
twisti@2047 | 187 | case Bytecodes::_lload_1: |
twisti@2047 | 188 | case Bytecodes::_fload_1: |
twisti@2047 | 189 | case Bytecodes::_dload_1: |
twisti@2047 | 190 | case Bytecodes::_aload_1: |
twisti@2047 | 191 | push(local(1)); |
twisti@2047 | 192 | break; |
twisti@2047 | 193 | case Bytecodes::_iload_2: |
twisti@2047 | 194 | case Bytecodes::_lload_2: |
twisti@2047 | 195 | case Bytecodes::_fload_2: |
twisti@2047 | 196 | case Bytecodes::_dload_2: |
twisti@2047 | 197 | case Bytecodes::_aload_2: |
twisti@2047 | 198 | push(local(2)); |
twisti@2047 | 199 | break; |
twisti@2047 | 200 | case Bytecodes::_iload_3: |
twisti@2047 | 201 | case Bytecodes::_lload_3: |
twisti@2047 | 202 | case Bytecodes::_fload_3: |
twisti@2047 | 203 | case Bytecodes::_dload_3: |
twisti@2047 | 204 | case Bytecodes::_aload_3: |
twisti@2047 | 205 | push(local(3)); |
twisti@2047 | 206 | break; |
twisti@2047 | 207 | case Bytecodes::_iload: |
twisti@2047 | 208 | case Bytecodes::_lload: |
twisti@2047 | 209 | case Bytecodes::_fload: |
twisti@2047 | 210 | case Bytecodes::_dload: |
twisti@2047 | 211 | case Bytecodes::_aload: |
twisti@2047 | 212 | push(local(iter()->get_index())); |
twisti@2047 | 213 | break; |
twisti@2047 | 214 | |
twisti@2047 | 215 | case Bytecodes::_baload: |
twisti@2047 | 216 | do_aload(T_BYTE); |
twisti@2047 | 217 | break; |
twisti@2047 | 218 | case Bytecodes::_caload: |
twisti@2047 | 219 | do_aload(T_CHAR); |
twisti@2047 | 220 | break; |
twisti@2047 | 221 | case Bytecodes::_saload: |
twisti@2047 | 222 | do_aload(T_SHORT); |
twisti@2047 | 223 | break; |
twisti@2047 | 224 | case Bytecodes::_iaload: |
twisti@2047 | 225 | do_aload(T_INT); |
twisti@2047 | 226 | break; |
twisti@2047 | 227 | case Bytecodes::_laload: |
twisti@2047 | 228 | do_aload(T_LONG); |
twisti@2047 | 229 | break; |
twisti@2047 | 230 | case Bytecodes::_faload: |
twisti@2047 | 231 | do_aload(T_FLOAT); |
twisti@2047 | 232 | break; |
twisti@2047 | 233 | case Bytecodes::_daload: |
twisti@2047 | 234 | do_aload(T_DOUBLE); |
twisti@2047 | 235 | break; |
twisti@2047 | 236 | case Bytecodes::_aaload: |
twisti@2047 | 237 | do_aload(T_OBJECT); |
twisti@2047 | 238 | break; |
twisti@2047 | 239 | |
twisti@2047 | 240 | case Bytecodes::_istore_0: |
twisti@2047 | 241 | case Bytecodes::_lstore_0: |
twisti@2047 | 242 | case Bytecodes::_fstore_0: |
twisti@2047 | 243 | case Bytecodes::_dstore_0: |
twisti@2047 | 244 | case Bytecodes::_astore_0: |
twisti@2047 | 245 | set_local(0, pop()); |
twisti@2047 | 246 | break; |
twisti@2047 | 247 | case Bytecodes::_istore_1: |
twisti@2047 | 248 | case Bytecodes::_lstore_1: |
twisti@2047 | 249 | case Bytecodes::_fstore_1: |
twisti@2047 | 250 | case Bytecodes::_dstore_1: |
twisti@2047 | 251 | case Bytecodes::_astore_1: |
twisti@2047 | 252 | set_local(1, pop()); |
twisti@2047 | 253 | break; |
twisti@2047 | 254 | case Bytecodes::_istore_2: |
twisti@2047 | 255 | case Bytecodes::_lstore_2: |
twisti@2047 | 256 | case Bytecodes::_fstore_2: |
twisti@2047 | 257 | case Bytecodes::_dstore_2: |
twisti@2047 | 258 | case Bytecodes::_astore_2: |
twisti@2047 | 259 | set_local(2, pop()); |
twisti@2047 | 260 | break; |
twisti@2047 | 261 | case Bytecodes::_istore_3: |
twisti@2047 | 262 | case Bytecodes::_lstore_3: |
twisti@2047 | 263 | case Bytecodes::_fstore_3: |
twisti@2047 | 264 | case Bytecodes::_dstore_3: |
twisti@2047 | 265 | case Bytecodes::_astore_3: |
twisti@2047 | 266 | set_local(3, pop()); |
twisti@2047 | 267 | break; |
twisti@2047 | 268 | case Bytecodes::_istore: |
twisti@2047 | 269 | case Bytecodes::_lstore: |
twisti@2047 | 270 | case Bytecodes::_fstore: |
twisti@2047 | 271 | case Bytecodes::_dstore: |
twisti@2047 | 272 | case Bytecodes::_astore: |
twisti@2047 | 273 | set_local(iter()->get_index(), pop()); |
twisti@2047 | 274 | break; |
twisti@2047 | 275 | |
twisti@2047 | 276 | case Bytecodes::_bastore: |
twisti@2047 | 277 | do_astore(T_BYTE); |
twisti@2047 | 278 | break; |
twisti@2047 | 279 | case Bytecodes::_castore: |
twisti@2047 | 280 | do_astore(T_CHAR); |
twisti@2047 | 281 | break; |
twisti@2047 | 282 | case Bytecodes::_sastore: |
twisti@2047 | 283 | do_astore(T_SHORT); |
twisti@2047 | 284 | break; |
twisti@2047 | 285 | case Bytecodes::_iastore: |
twisti@2047 | 286 | do_astore(T_INT); |
twisti@2047 | 287 | break; |
twisti@2047 | 288 | case Bytecodes::_lastore: |
twisti@2047 | 289 | do_astore(T_LONG); |
twisti@2047 | 290 | break; |
twisti@2047 | 291 | case Bytecodes::_fastore: |
twisti@2047 | 292 | do_astore(T_FLOAT); |
twisti@2047 | 293 | break; |
twisti@2047 | 294 | case Bytecodes::_dastore: |
twisti@2047 | 295 | do_astore(T_DOUBLE); |
twisti@2047 | 296 | break; |
twisti@2047 | 297 | case Bytecodes::_aastore: |
twisti@2047 | 298 | do_astore(T_OBJECT); |
twisti@2047 | 299 | break; |
twisti@2047 | 300 | |
twisti@2047 | 301 | case Bytecodes::_pop: |
twisti@2047 | 302 | xpop(); |
twisti@2047 | 303 | break; |
twisti@2047 | 304 | case Bytecodes::_pop2: |
twisti@2047 | 305 | xpop(); |
twisti@2047 | 306 | xpop(); |
twisti@2047 | 307 | break; |
twisti@2047 | 308 | case Bytecodes::_swap: |
twisti@2047 | 309 | a = xpop(); |
twisti@2047 | 310 | b = xpop(); |
twisti@2047 | 311 | xpush(a); |
twisti@2047 | 312 | xpush(b); |
twisti@2047 | 313 | break; |
twisti@2047 | 314 | case Bytecodes::_dup: |
twisti@2047 | 315 | a = xpop(); |
twisti@2047 | 316 | xpush(a); |
twisti@2047 | 317 | xpush(a); |
twisti@2047 | 318 | break; |
twisti@2047 | 319 | case Bytecodes::_dup_x1: |
twisti@2047 | 320 | a = xpop(); |
twisti@2047 | 321 | b = xpop(); |
twisti@2047 | 322 | xpush(a); |
twisti@2047 | 323 | xpush(b); |
twisti@2047 | 324 | xpush(a); |
twisti@2047 | 325 | break; |
twisti@2047 | 326 | case Bytecodes::_dup_x2: |
twisti@2047 | 327 | a = xpop(); |
twisti@2047 | 328 | b = xpop(); |
twisti@2047 | 329 | c = xpop(); |
twisti@2047 | 330 | xpush(a); |
twisti@2047 | 331 | xpush(c); |
twisti@2047 | 332 | xpush(b); |
twisti@2047 | 333 | xpush(a); |
twisti@2047 | 334 | break; |
twisti@2047 | 335 | case Bytecodes::_dup2: |
twisti@2047 | 336 | a = xpop(); |
twisti@2047 | 337 | b = xpop(); |
twisti@2047 | 338 | xpush(b); |
twisti@2047 | 339 | xpush(a); |
twisti@2047 | 340 | xpush(b); |
twisti@2047 | 341 | xpush(a); |
twisti@2047 | 342 | break; |
twisti@2047 | 343 | case Bytecodes::_dup2_x1: |
twisti@2047 | 344 | a = xpop(); |
twisti@2047 | 345 | b = xpop(); |
twisti@2047 | 346 | c = xpop(); |
twisti@2047 | 347 | xpush(b); |
twisti@2047 | 348 | xpush(a); |
twisti@2047 | 349 | xpush(c); |
twisti@2047 | 350 | xpush(b); |
twisti@2047 | 351 | xpush(a); |
twisti@2047 | 352 | break; |
twisti@2047 | 353 | case Bytecodes::_dup2_x2: |
twisti@2047 | 354 | a = xpop(); |
twisti@2047 | 355 | b = xpop(); |
twisti@2047 | 356 | c = xpop(); |
twisti@2047 | 357 | d = xpop(); |
twisti@2047 | 358 | xpush(b); |
twisti@2047 | 359 | xpush(a); |
twisti@2047 | 360 | xpush(d); |
twisti@2047 | 361 | xpush(c); |
twisti@2047 | 362 | xpush(b); |
twisti@2047 | 363 | xpush(a); |
twisti@2047 | 364 | break; |
twisti@2047 | 365 | |
twisti@2047 | 366 | case Bytecodes::_arraylength: |
twisti@2047 | 367 | do_arraylength(); |
twisti@2047 | 368 | break; |
twisti@2047 | 369 | |
twisti@2047 | 370 | case Bytecodes::_getfield: |
twisti@2047 | 371 | do_getfield(); |
twisti@2047 | 372 | break; |
twisti@2047 | 373 | case Bytecodes::_getstatic: |
twisti@2047 | 374 | do_getstatic(); |
twisti@2047 | 375 | break; |
twisti@2047 | 376 | case Bytecodes::_putfield: |
twisti@2047 | 377 | do_putfield(); |
twisti@2047 | 378 | break; |
twisti@2047 | 379 | case Bytecodes::_putstatic: |
twisti@2047 | 380 | do_putstatic(); |
twisti@2047 | 381 | break; |
twisti@2047 | 382 | |
twisti@2047 | 383 | case Bytecodes::_iadd: |
twisti@2047 | 384 | b = pop(); |
twisti@2047 | 385 | a = pop(); |
twisti@2047 | 386 | push(SharkValue::create_jint( |
twisti@2047 | 387 | builder()->CreateAdd(a->jint_value(), b->jint_value()), false)); |
twisti@2047 | 388 | break; |
twisti@2047 | 389 | case Bytecodes::_isub: |
twisti@2047 | 390 | b = pop(); |
twisti@2047 | 391 | a = pop(); |
twisti@2047 | 392 | push(SharkValue::create_jint( |
twisti@2047 | 393 | builder()->CreateSub(a->jint_value(), b->jint_value()), false)); |
twisti@2047 | 394 | break; |
twisti@2047 | 395 | case Bytecodes::_imul: |
twisti@2047 | 396 | b = pop(); |
twisti@2047 | 397 | a = pop(); |
twisti@2047 | 398 | push(SharkValue::create_jint( |
twisti@2047 | 399 | builder()->CreateMul(a->jint_value(), b->jint_value()), false)); |
twisti@2047 | 400 | break; |
twisti@2047 | 401 | case Bytecodes::_idiv: |
twisti@2047 | 402 | do_idiv(); |
twisti@2047 | 403 | break; |
twisti@2047 | 404 | case Bytecodes::_irem: |
twisti@2047 | 405 | do_irem(); |
twisti@2047 | 406 | break; |
twisti@2047 | 407 | case Bytecodes::_ineg: |
twisti@2047 | 408 | a = pop(); |
twisti@2047 | 409 | push(SharkValue::create_jint( |
twisti@2047 | 410 | builder()->CreateNeg(a->jint_value()), a->zero_checked())); |
twisti@2047 | 411 | break; |
twisti@2047 | 412 | case Bytecodes::_ishl: |
twisti@2047 | 413 | b = pop(); |
twisti@2047 | 414 | a = pop(); |
twisti@2047 | 415 | push(SharkValue::create_jint( |
twisti@2047 | 416 | builder()->CreateShl( |
twisti@2047 | 417 | a->jint_value(), |
twisti@2047 | 418 | builder()->CreateAnd( |
twisti@2047 | 419 | b->jint_value(), LLVMValue::jint_constant(0x1f))), false)); |
twisti@2047 | 420 | break; |
twisti@2047 | 421 | case Bytecodes::_ishr: |
twisti@2047 | 422 | b = pop(); |
twisti@2047 | 423 | a = pop(); |
twisti@2047 | 424 | push(SharkValue::create_jint( |
twisti@2047 | 425 | builder()->CreateAShr( |
twisti@2047 | 426 | a->jint_value(), |
twisti@2047 | 427 | builder()->CreateAnd( |
twisti@2047 | 428 | b->jint_value(), LLVMValue::jint_constant(0x1f))), false)); |
twisti@2047 | 429 | break; |
twisti@2047 | 430 | case Bytecodes::_iushr: |
twisti@2047 | 431 | b = pop(); |
twisti@2047 | 432 | a = pop(); |
twisti@2047 | 433 | push(SharkValue::create_jint( |
twisti@2047 | 434 | builder()->CreateLShr( |
twisti@2047 | 435 | a->jint_value(), |
twisti@2047 | 436 | builder()->CreateAnd( |
twisti@2047 | 437 | b->jint_value(), LLVMValue::jint_constant(0x1f))), false)); |
twisti@2047 | 438 | break; |
twisti@2047 | 439 | case Bytecodes::_iand: |
twisti@2047 | 440 | b = pop(); |
twisti@2047 | 441 | a = pop(); |
twisti@2047 | 442 | push(SharkValue::create_jint( |
twisti@2047 | 443 | builder()->CreateAnd(a->jint_value(), b->jint_value()), false)); |
twisti@2047 | 444 | break; |
twisti@2047 | 445 | case Bytecodes::_ior: |
twisti@2047 | 446 | b = pop(); |
twisti@2047 | 447 | a = pop(); |
twisti@2047 | 448 | push(SharkValue::create_jint( |
twisti@2047 | 449 | builder()->CreateOr(a->jint_value(), b->jint_value()), |
twisti@2047 | 450 | a->zero_checked() && b->zero_checked())); |
twisti@2047 | 451 | break; |
twisti@2047 | 452 | case Bytecodes::_ixor: |
twisti@2047 | 453 | b = pop(); |
twisti@2047 | 454 | a = pop(); |
twisti@2047 | 455 | push(SharkValue::create_jint( |
twisti@2047 | 456 | builder()->CreateXor(a->jint_value(), b->jint_value()), false)); |
twisti@2047 | 457 | break; |
twisti@2047 | 458 | |
twisti@2047 | 459 | case Bytecodes::_ladd: |
twisti@2047 | 460 | b = pop(); |
twisti@2047 | 461 | a = pop(); |
twisti@2047 | 462 | push(SharkValue::create_jlong( |
twisti@2047 | 463 | builder()->CreateAdd(a->jlong_value(), b->jlong_value()), false)); |
twisti@2047 | 464 | break; |
twisti@2047 | 465 | case Bytecodes::_lsub: |
twisti@2047 | 466 | b = pop(); |
twisti@2047 | 467 | a = pop(); |
twisti@2047 | 468 | push(SharkValue::create_jlong( |
twisti@2047 | 469 | builder()->CreateSub(a->jlong_value(), b->jlong_value()), false)); |
twisti@2047 | 470 | break; |
twisti@2047 | 471 | case Bytecodes::_lmul: |
twisti@2047 | 472 | b = pop(); |
twisti@2047 | 473 | a = pop(); |
twisti@2047 | 474 | push(SharkValue::create_jlong( |
twisti@2047 | 475 | builder()->CreateMul(a->jlong_value(), b->jlong_value()), false)); |
twisti@2047 | 476 | break; |
twisti@2047 | 477 | case Bytecodes::_ldiv: |
twisti@2047 | 478 | do_ldiv(); |
twisti@2047 | 479 | break; |
twisti@2047 | 480 | case Bytecodes::_lrem: |
twisti@2047 | 481 | do_lrem(); |
twisti@2047 | 482 | break; |
twisti@2047 | 483 | case Bytecodes::_lneg: |
twisti@2047 | 484 | a = pop(); |
twisti@2047 | 485 | push(SharkValue::create_jlong( |
twisti@2047 | 486 | builder()->CreateNeg(a->jlong_value()), a->zero_checked())); |
twisti@2047 | 487 | break; |
twisti@2047 | 488 | case Bytecodes::_lshl: |
twisti@2047 | 489 | b = pop(); |
twisti@2047 | 490 | a = pop(); |
twisti@2047 | 491 | push(SharkValue::create_jlong( |
twisti@2047 | 492 | builder()->CreateShl( |
twisti@2047 | 493 | a->jlong_value(), |
twisti@2047 | 494 | builder()->CreateIntCast( |
twisti@2047 | 495 | builder()->CreateAnd( |
twisti@2047 | 496 | b->jint_value(), LLVMValue::jint_constant(0x3f)), |
twisti@2047 | 497 | SharkType::jlong_type(), true)), false)); |
twisti@2047 | 498 | break; |
twisti@2047 | 499 | case Bytecodes::_lshr: |
twisti@2047 | 500 | b = pop(); |
twisti@2047 | 501 | a = pop(); |
twisti@2047 | 502 | push(SharkValue::create_jlong( |
twisti@2047 | 503 | builder()->CreateAShr( |
twisti@2047 | 504 | a->jlong_value(), |
twisti@2047 | 505 | builder()->CreateIntCast( |
twisti@2047 | 506 | builder()->CreateAnd( |
twisti@2047 | 507 | b->jint_value(), LLVMValue::jint_constant(0x3f)), |
twisti@2047 | 508 | SharkType::jlong_type(), true)), false)); |
twisti@2047 | 509 | break; |
twisti@2047 | 510 | case Bytecodes::_lushr: |
twisti@2047 | 511 | b = pop(); |
twisti@2047 | 512 | a = pop(); |
twisti@2047 | 513 | push(SharkValue::create_jlong( |
twisti@2047 | 514 | builder()->CreateLShr( |
twisti@2047 | 515 | a->jlong_value(), |
twisti@2047 | 516 | builder()->CreateIntCast( |
twisti@2047 | 517 | builder()->CreateAnd( |
twisti@2047 | 518 | b->jint_value(), LLVMValue::jint_constant(0x3f)), |
twisti@2047 | 519 | SharkType::jlong_type(), true)), false)); |
twisti@2047 | 520 | break; |
twisti@2047 | 521 | case Bytecodes::_land: |
twisti@2047 | 522 | b = pop(); |
twisti@2047 | 523 | a = pop(); |
twisti@2047 | 524 | push(SharkValue::create_jlong( |
twisti@2047 | 525 | builder()->CreateAnd(a->jlong_value(), b->jlong_value()), false)); |
twisti@2047 | 526 | break; |
twisti@2047 | 527 | case Bytecodes::_lor: |
twisti@2047 | 528 | b = pop(); |
twisti@2047 | 529 | a = pop(); |
twisti@2047 | 530 | push(SharkValue::create_jlong( |
twisti@2047 | 531 | builder()->CreateOr(a->jlong_value(), b->jlong_value()), |
twisti@2047 | 532 | a->zero_checked() && b->zero_checked())); |
twisti@2047 | 533 | break; |
twisti@2047 | 534 | case Bytecodes::_lxor: |
twisti@2047 | 535 | b = pop(); |
twisti@2047 | 536 | a = pop(); |
twisti@2047 | 537 | push(SharkValue::create_jlong( |
twisti@2047 | 538 | builder()->CreateXor(a->jlong_value(), b->jlong_value()), false)); |
twisti@2047 | 539 | break; |
twisti@2047 | 540 | |
twisti@2047 | 541 | case Bytecodes::_fadd: |
twisti@2047 | 542 | b = pop(); |
twisti@2047 | 543 | a = pop(); |
twisti@2047 | 544 | push(SharkValue::create_jfloat( |
twisti@2047 | 545 | builder()->CreateFAdd(a->jfloat_value(), b->jfloat_value()))); |
twisti@2047 | 546 | break; |
twisti@2047 | 547 | case Bytecodes::_fsub: |
twisti@2047 | 548 | b = pop(); |
twisti@2047 | 549 | a = pop(); |
twisti@2047 | 550 | push(SharkValue::create_jfloat( |
twisti@2047 | 551 | builder()->CreateFSub(a->jfloat_value(), b->jfloat_value()))); |
twisti@2047 | 552 | break; |
twisti@2047 | 553 | case Bytecodes::_fmul: |
twisti@2047 | 554 | b = pop(); |
twisti@2047 | 555 | a = pop(); |
twisti@2047 | 556 | push(SharkValue::create_jfloat( |
twisti@2047 | 557 | builder()->CreateFMul(a->jfloat_value(), b->jfloat_value()))); |
twisti@2047 | 558 | break; |
twisti@2047 | 559 | case Bytecodes::_fdiv: |
twisti@2047 | 560 | b = pop(); |
twisti@2047 | 561 | a = pop(); |
twisti@2047 | 562 | push(SharkValue::create_jfloat( |
twisti@2047 | 563 | builder()->CreateFDiv(a->jfloat_value(), b->jfloat_value()))); |
twisti@2047 | 564 | break; |
twisti@2047 | 565 | case Bytecodes::_frem: |
twisti@2047 | 566 | b = pop(); |
twisti@2047 | 567 | a = pop(); |
twisti@2047 | 568 | push(SharkValue::create_jfloat( |
twisti@2047 | 569 | builder()->CreateFRem(a->jfloat_value(), b->jfloat_value()))); |
twisti@2047 | 570 | break; |
twisti@2047 | 571 | case Bytecodes::_fneg: |
twisti@2047 | 572 | a = pop(); |
twisti@2047 | 573 | push(SharkValue::create_jfloat( |
twisti@2047 | 574 | builder()->CreateFNeg(a->jfloat_value()))); |
twisti@2047 | 575 | break; |
twisti@2047 | 576 | |
twisti@2047 | 577 | case Bytecodes::_dadd: |
twisti@2047 | 578 | b = pop(); |
twisti@2047 | 579 | a = pop(); |
twisti@2047 | 580 | push(SharkValue::create_jdouble( |
twisti@2047 | 581 | builder()->CreateFAdd(a->jdouble_value(), b->jdouble_value()))); |
twisti@2047 | 582 | break; |
twisti@2047 | 583 | case Bytecodes::_dsub: |
twisti@2047 | 584 | b = pop(); |
twisti@2047 | 585 | a = pop(); |
twisti@2047 | 586 | push(SharkValue::create_jdouble( |
twisti@2047 | 587 | builder()->CreateFSub(a->jdouble_value(), b->jdouble_value()))); |
twisti@2047 | 588 | break; |
twisti@2047 | 589 | case Bytecodes::_dmul: |
twisti@2047 | 590 | b = pop(); |
twisti@2047 | 591 | a = pop(); |
twisti@2047 | 592 | push(SharkValue::create_jdouble( |
twisti@2047 | 593 | builder()->CreateFMul(a->jdouble_value(), b->jdouble_value()))); |
twisti@2047 | 594 | break; |
twisti@2047 | 595 | case Bytecodes::_ddiv: |
twisti@2047 | 596 | b = pop(); |
twisti@2047 | 597 | a = pop(); |
twisti@2047 | 598 | push(SharkValue::create_jdouble( |
twisti@2047 | 599 | builder()->CreateFDiv(a->jdouble_value(), b->jdouble_value()))); |
twisti@2047 | 600 | break; |
twisti@2047 | 601 | case Bytecodes::_drem: |
twisti@2047 | 602 | b = pop(); |
twisti@2047 | 603 | a = pop(); |
twisti@2047 | 604 | push(SharkValue::create_jdouble( |
twisti@2047 | 605 | builder()->CreateFRem(a->jdouble_value(), b->jdouble_value()))); |
twisti@2047 | 606 | break; |
twisti@2047 | 607 | case Bytecodes::_dneg: |
twisti@2047 | 608 | a = pop(); |
twisti@2047 | 609 | push(SharkValue::create_jdouble( |
twisti@2047 | 610 | builder()->CreateFNeg(a->jdouble_value()))); |
twisti@2047 | 611 | break; |
twisti@2047 | 612 | |
twisti@2047 | 613 | case Bytecodes::_iinc: |
twisti@2047 | 614 | i = iter()->get_index(); |
twisti@2047 | 615 | set_local( |
twisti@2047 | 616 | i, |
twisti@2047 | 617 | SharkValue::create_jint( |
twisti@2047 | 618 | builder()->CreateAdd( |
twisti@2047 | 619 | LLVMValue::jint_constant(iter()->get_iinc_con()), |
twisti@2047 | 620 | local(i)->jint_value()), false)); |
twisti@2047 | 621 | break; |
twisti@2047 | 622 | |
twisti@2047 | 623 | case Bytecodes::_lcmp: |
twisti@2047 | 624 | do_lcmp(); |
twisti@2047 | 625 | break; |
twisti@2047 | 626 | |
twisti@2047 | 627 | case Bytecodes::_fcmpl: |
twisti@2047 | 628 | do_fcmp(false, false); |
twisti@2047 | 629 | break; |
twisti@2047 | 630 | case Bytecodes::_fcmpg: |
twisti@2047 | 631 | do_fcmp(false, true); |
twisti@2047 | 632 | break; |
twisti@2047 | 633 | case Bytecodes::_dcmpl: |
twisti@2047 | 634 | do_fcmp(true, false); |
twisti@2047 | 635 | break; |
twisti@2047 | 636 | case Bytecodes::_dcmpg: |
twisti@2047 | 637 | do_fcmp(true, true); |
twisti@2047 | 638 | break; |
twisti@2047 | 639 | |
twisti@2047 | 640 | case Bytecodes::_i2l: |
twisti@2047 | 641 | a = pop(); |
twisti@2047 | 642 | push(SharkValue::create_jlong( |
twisti@2047 | 643 | builder()->CreateIntCast( |
twisti@2047 | 644 | a->jint_value(), SharkType::jlong_type(), true), a->zero_checked())); |
twisti@2047 | 645 | break; |
twisti@2047 | 646 | case Bytecodes::_i2f: |
twisti@2047 | 647 | push(SharkValue::create_jfloat( |
twisti@2047 | 648 | builder()->CreateSIToFP( |
twisti@2047 | 649 | pop()->jint_value(), SharkType::jfloat_type()))); |
twisti@2047 | 650 | break; |
twisti@2047 | 651 | case Bytecodes::_i2d: |
twisti@2047 | 652 | push(SharkValue::create_jdouble( |
twisti@2047 | 653 | builder()->CreateSIToFP( |
twisti@2047 | 654 | pop()->jint_value(), SharkType::jdouble_type()))); |
twisti@2047 | 655 | break; |
twisti@2047 | 656 | |
twisti@2047 | 657 | case Bytecodes::_l2i: |
twisti@2047 | 658 | push(SharkValue::create_jint( |
twisti@2047 | 659 | builder()->CreateIntCast( |
twisti@2047 | 660 | pop()->jlong_value(), SharkType::jint_type(), true), false)); |
twisti@2047 | 661 | break; |
twisti@2047 | 662 | case Bytecodes::_l2f: |
twisti@2047 | 663 | push(SharkValue::create_jfloat( |
twisti@2047 | 664 | builder()->CreateSIToFP( |
twisti@2047 | 665 | pop()->jlong_value(), SharkType::jfloat_type()))); |
twisti@2047 | 666 | break; |
twisti@2047 | 667 | case Bytecodes::_l2d: |
twisti@2047 | 668 | push(SharkValue::create_jdouble( |
twisti@2047 | 669 | builder()->CreateSIToFP( |
twisti@2047 | 670 | pop()->jlong_value(), SharkType::jdouble_type()))); |
twisti@2047 | 671 | break; |
twisti@2047 | 672 | |
twisti@2047 | 673 | case Bytecodes::_f2i: |
twisti@2047 | 674 | push(SharkValue::create_jint( |
twisti@2047 | 675 | builder()->CreateCall( |
twisti@2047 | 676 | builder()->f2i(), pop()->jfloat_value()), false)); |
twisti@2047 | 677 | break; |
twisti@2047 | 678 | case Bytecodes::_f2l: |
twisti@2047 | 679 | push(SharkValue::create_jlong( |
twisti@2047 | 680 | builder()->CreateCall( |
twisti@2047 | 681 | builder()->f2l(), pop()->jfloat_value()), false)); |
twisti@2047 | 682 | break; |
twisti@2047 | 683 | case Bytecodes::_f2d: |
twisti@2047 | 684 | push(SharkValue::create_jdouble( |
twisti@2047 | 685 | builder()->CreateFPExt( |
twisti@2047 | 686 | pop()->jfloat_value(), SharkType::jdouble_type()))); |
twisti@2047 | 687 | break; |
twisti@2047 | 688 | |
twisti@2047 | 689 | case Bytecodes::_d2i: |
twisti@2047 | 690 | push(SharkValue::create_jint( |
twisti@2047 | 691 | builder()->CreateCall( |
twisti@2047 | 692 | builder()->d2i(), pop()->jdouble_value()), false)); |
twisti@2047 | 693 | break; |
twisti@2047 | 694 | case Bytecodes::_d2l: |
twisti@2047 | 695 | push(SharkValue::create_jlong( |
twisti@2047 | 696 | builder()->CreateCall( |
twisti@2047 | 697 | builder()->d2l(), pop()->jdouble_value()), false)); |
twisti@2047 | 698 | break; |
twisti@2047 | 699 | case Bytecodes::_d2f: |
twisti@2047 | 700 | push(SharkValue::create_jfloat( |
twisti@2047 | 701 | builder()->CreateFPTrunc( |
twisti@2047 | 702 | pop()->jdouble_value(), SharkType::jfloat_type()))); |
twisti@2047 | 703 | break; |
twisti@2047 | 704 | |
twisti@2047 | 705 | case Bytecodes::_i2b: |
twisti@2047 | 706 | push(SharkValue::create_jint( |
twisti@2047 | 707 | builder()->CreateAShr( |
twisti@2047 | 708 | builder()->CreateShl( |
twisti@2047 | 709 | pop()->jint_value(), |
twisti@2047 | 710 | LLVMValue::jint_constant(24)), |
twisti@2047 | 711 | LLVMValue::jint_constant(24)), false)); |
twisti@2047 | 712 | break; |
twisti@2047 | 713 | case Bytecodes::_i2c: |
twisti@2047 | 714 | push(SharkValue::create_jint( |
twisti@2047 | 715 | builder()->CreateAnd( |
twisti@2047 | 716 | pop()->jint_value(), |
twisti@2047 | 717 | LLVMValue::jint_constant(0xffff)), false)); |
twisti@2047 | 718 | break; |
twisti@2047 | 719 | case Bytecodes::_i2s: |
twisti@2047 | 720 | push(SharkValue::create_jint( |
twisti@2047 | 721 | builder()->CreateAShr( |
twisti@2047 | 722 | builder()->CreateShl( |
twisti@2047 | 723 | pop()->jint_value(), |
twisti@2047 | 724 | LLVMValue::jint_constant(16)), |
twisti@2047 | 725 | LLVMValue::jint_constant(16)), false)); |
twisti@2047 | 726 | break; |
twisti@2047 | 727 | |
twisti@2047 | 728 | case Bytecodes::_return: |
twisti@2047 | 729 | do_return(T_VOID); |
twisti@2047 | 730 | break; |
twisti@2047 | 731 | case Bytecodes::_ireturn: |
twisti@2047 | 732 | do_return(T_INT); |
twisti@2047 | 733 | break; |
twisti@2047 | 734 | case Bytecodes::_lreturn: |
twisti@2047 | 735 | do_return(T_LONG); |
twisti@2047 | 736 | break; |
twisti@2047 | 737 | case Bytecodes::_freturn: |
twisti@2047 | 738 | do_return(T_FLOAT); |
twisti@2047 | 739 | break; |
twisti@2047 | 740 | case Bytecodes::_dreturn: |
twisti@2047 | 741 | do_return(T_DOUBLE); |
twisti@2047 | 742 | break; |
twisti@2047 | 743 | case Bytecodes::_areturn: |
twisti@2047 | 744 | do_return(T_OBJECT); |
twisti@2047 | 745 | break; |
twisti@2047 | 746 | |
twisti@2047 | 747 | case Bytecodes::_athrow: |
twisti@2047 | 748 | do_athrow(); |
twisti@2047 | 749 | break; |
twisti@2047 | 750 | |
twisti@2047 | 751 | case Bytecodes::_goto: |
twisti@2047 | 752 | case Bytecodes::_goto_w: |
twisti@2047 | 753 | do_goto(); |
twisti@2047 | 754 | break; |
twisti@2047 | 755 | |
twisti@2047 | 756 | case Bytecodes::_jsr: |
twisti@2047 | 757 | case Bytecodes::_jsr_w: |
twisti@2047 | 758 | do_jsr(); |
twisti@2047 | 759 | break; |
twisti@2047 | 760 | |
twisti@2047 | 761 | case Bytecodes::_ret: |
twisti@2047 | 762 | do_ret(); |
twisti@2047 | 763 | break; |
twisti@2047 | 764 | |
twisti@2047 | 765 | case Bytecodes::_ifnull: |
twisti@2047 | 766 | do_if(ICmpInst::ICMP_EQ, SharkValue::null(), pop()); |
twisti@2047 | 767 | break; |
twisti@2047 | 768 | case Bytecodes::_ifnonnull: |
twisti@2047 | 769 | do_if(ICmpInst::ICMP_NE, SharkValue::null(), pop()); |
twisti@2047 | 770 | break; |
twisti@2047 | 771 | case Bytecodes::_if_acmpeq: |
twisti@2047 | 772 | b = pop(); |
twisti@2047 | 773 | a = pop(); |
twisti@2047 | 774 | do_if(ICmpInst::ICMP_EQ, b, a); |
twisti@2047 | 775 | break; |
twisti@2047 | 776 | case Bytecodes::_if_acmpne: |
twisti@2047 | 777 | b = pop(); |
twisti@2047 | 778 | a = pop(); |
twisti@2047 | 779 | do_if(ICmpInst::ICMP_NE, b, a); |
twisti@2047 | 780 | break; |
twisti@2047 | 781 | case Bytecodes::_ifeq: |
twisti@2047 | 782 | do_if(ICmpInst::ICMP_EQ, SharkValue::jint_constant(0), pop()); |
twisti@2047 | 783 | break; |
twisti@2047 | 784 | case Bytecodes::_ifne: |
twisti@2047 | 785 | do_if(ICmpInst::ICMP_NE, SharkValue::jint_constant(0), pop()); |
twisti@2047 | 786 | break; |
twisti@2047 | 787 | case Bytecodes::_iflt: |
twisti@2047 | 788 | do_if(ICmpInst::ICMP_SLT, SharkValue::jint_constant(0), pop()); |
twisti@2047 | 789 | break; |
twisti@2047 | 790 | case Bytecodes::_ifle: |
twisti@2047 | 791 | do_if(ICmpInst::ICMP_SLE, SharkValue::jint_constant(0), pop()); |
twisti@2047 | 792 | break; |
twisti@2047 | 793 | case Bytecodes::_ifgt: |
twisti@2047 | 794 | do_if(ICmpInst::ICMP_SGT, SharkValue::jint_constant(0), pop()); |
twisti@2047 | 795 | break; |
twisti@2047 | 796 | case Bytecodes::_ifge: |
twisti@2047 | 797 | do_if(ICmpInst::ICMP_SGE, SharkValue::jint_constant(0), pop()); |
twisti@2047 | 798 | break; |
twisti@2047 | 799 | case Bytecodes::_if_icmpeq: |
twisti@2047 | 800 | b = pop(); |
twisti@2047 | 801 | a = pop(); |
twisti@2047 | 802 | do_if(ICmpInst::ICMP_EQ, b, a); |
twisti@2047 | 803 | break; |
twisti@2047 | 804 | case Bytecodes::_if_icmpne: |
twisti@2047 | 805 | b = pop(); |
twisti@2047 | 806 | a = pop(); |
twisti@2047 | 807 | do_if(ICmpInst::ICMP_NE, b, a); |
twisti@2047 | 808 | break; |
twisti@2047 | 809 | case Bytecodes::_if_icmplt: |
twisti@2047 | 810 | b = pop(); |
twisti@2047 | 811 | a = pop(); |
twisti@2047 | 812 | do_if(ICmpInst::ICMP_SLT, b, a); |
twisti@2047 | 813 | break; |
twisti@2047 | 814 | case Bytecodes::_if_icmple: |
twisti@2047 | 815 | b = pop(); |
twisti@2047 | 816 | a = pop(); |
twisti@2047 | 817 | do_if(ICmpInst::ICMP_SLE, b, a); |
twisti@2047 | 818 | break; |
twisti@2047 | 819 | case Bytecodes::_if_icmpgt: |
twisti@2047 | 820 | b = pop(); |
twisti@2047 | 821 | a = pop(); |
twisti@2047 | 822 | do_if(ICmpInst::ICMP_SGT, b, a); |
twisti@2047 | 823 | break; |
twisti@2047 | 824 | case Bytecodes::_if_icmpge: |
twisti@2047 | 825 | b = pop(); |
twisti@2047 | 826 | a = pop(); |
twisti@2047 | 827 | do_if(ICmpInst::ICMP_SGE, b, a); |
twisti@2047 | 828 | break; |
twisti@2047 | 829 | |
twisti@2047 | 830 | case Bytecodes::_tableswitch: |
twisti@2047 | 831 | case Bytecodes::_lookupswitch: |
twisti@2047 | 832 | do_switch(); |
twisti@2047 | 833 | break; |
twisti@2047 | 834 | |
twisti@2047 | 835 | case Bytecodes::_invokestatic: |
twisti@2047 | 836 | case Bytecodes::_invokespecial: |
twisti@2047 | 837 | case Bytecodes::_invokevirtual: |
twisti@2047 | 838 | case Bytecodes::_invokeinterface: |
twisti@2047 | 839 | do_call(); |
twisti@2047 | 840 | break; |
twisti@2047 | 841 | |
twisti@2047 | 842 | case Bytecodes::_instanceof: |
twisti@2047 | 843 | // This is a very common construct: |
twisti@2047 | 844 | // |
twisti@2047 | 845 | // if (object instanceof Klass) { |
twisti@2047 | 846 | // something = (Klass) object; |
twisti@2047 | 847 | // ... |
twisti@2047 | 848 | // } |
twisti@2047 | 849 | // |
twisti@2047 | 850 | // which gets compiled to something like this: |
twisti@2047 | 851 | // |
twisti@2047 | 852 | // 28: aload 9 |
twisti@2047 | 853 | // 30: instanceof <Class Klass> |
twisti@2047 | 854 | // 33: ifeq 52 |
twisti@2047 | 855 | // 36: aload 9 |
twisti@2047 | 856 | // 38: checkcast <Class Klass> |
twisti@2047 | 857 | // |
twisti@2047 | 858 | // Handling both bytecodes at once allows us |
twisti@2047 | 859 | // to eliminate the checkcast. |
twisti@2047 | 860 | if (iter()->next_bci() < limit && |
twisti@2047 | 861 | (iter()->next_bc() == Bytecodes::_ifeq || |
twisti@2047 | 862 | iter()->next_bc() == Bytecodes::_ifne) && |
twisti@2047 | 863 | (!UseLoopSafepoints || |
twisti@2047 | 864 | iter()->next_get_dest() > iter()->next_bci())) { |
twisti@2047 | 865 | if (maybe_do_instanceof_if()) { |
twisti@2047 | 866 | iter()->next(); |
twisti@2047 | 867 | if (SharkTraceBytecodes) |
twisti@2047 | 868 | tty->print_cr("%4d: %s", bci(), Bytecodes::name(bc())); |
twisti@2047 | 869 | break; |
twisti@2047 | 870 | } |
twisti@2047 | 871 | } |
twisti@2047 | 872 | // fall through |
twisti@2047 | 873 | case Bytecodes::_checkcast: |
twisti@2047 | 874 | do_instance_check(); |
twisti@2047 | 875 | break; |
twisti@2047 | 876 | |
twisti@2047 | 877 | case Bytecodes::_new: |
twisti@2047 | 878 | do_new(); |
twisti@2047 | 879 | break; |
twisti@2047 | 880 | case Bytecodes::_newarray: |
twisti@2047 | 881 | do_newarray(); |
twisti@2047 | 882 | break; |
twisti@2047 | 883 | case Bytecodes::_anewarray: |
twisti@2047 | 884 | do_anewarray(); |
twisti@2047 | 885 | break; |
twisti@2047 | 886 | case Bytecodes::_multianewarray: |
twisti@2047 | 887 | do_multianewarray(); |
twisti@2047 | 888 | break; |
twisti@2047 | 889 | |
twisti@2047 | 890 | case Bytecodes::_monitorenter: |
twisti@2047 | 891 | do_monitorenter(); |
twisti@2047 | 892 | break; |
twisti@2047 | 893 | case Bytecodes::_monitorexit: |
twisti@2047 | 894 | do_monitorexit(); |
twisti@2047 | 895 | break; |
twisti@2047 | 896 | |
twisti@2047 | 897 | default: |
twisti@2047 | 898 | ShouldNotReachHere(); |
twisti@2047 | 899 | } |
twisti@2047 | 900 | } |
twisti@2047 | 901 | } |
twisti@2047 | 902 | |
twisti@2047 | 903 | SharkState* SharkBlock::initial_current_state() { |
twisti@2047 | 904 | return entry_state()->copy(); |
twisti@2047 | 905 | } |
twisti@2047 | 906 | |
twisti@2047 | 907 | int SharkBlock::switch_default_dest() { |
twisti@2047 | 908 | return iter()->get_dest_table(0); |
twisti@2047 | 909 | } |
twisti@2047 | 910 | |
twisti@2047 | 911 | int SharkBlock::switch_table_length() { |
twisti@2047 | 912 | switch(bc()) { |
twisti@2047 | 913 | case Bytecodes::_tableswitch: |
twisti@2047 | 914 | return iter()->get_int_table(2) - iter()->get_int_table(1) + 1; |
twisti@2047 | 915 | |
twisti@2047 | 916 | case Bytecodes::_lookupswitch: |
twisti@2047 | 917 | return iter()->get_int_table(1); |
twisti@2047 | 918 | |
twisti@2047 | 919 | default: |
twisti@2047 | 920 | ShouldNotReachHere(); |
twisti@2047 | 921 | } |
twisti@2047 | 922 | } |
twisti@2047 | 923 | |
twisti@2047 | 924 | int SharkBlock::switch_key(int i) { |
twisti@2047 | 925 | switch(bc()) { |
twisti@2047 | 926 | case Bytecodes::_tableswitch: |
twisti@2047 | 927 | return iter()->get_int_table(1) + i; |
twisti@2047 | 928 | |
twisti@2047 | 929 | case Bytecodes::_lookupswitch: |
twisti@2047 | 930 | return iter()->get_int_table(2 + 2 * i); |
twisti@2047 | 931 | |
twisti@2047 | 932 | default: |
twisti@2047 | 933 | ShouldNotReachHere(); |
twisti@2047 | 934 | } |
twisti@2047 | 935 | } |
twisti@2047 | 936 | |
twisti@2047 | 937 | int SharkBlock::switch_dest(int i) { |
twisti@2047 | 938 | switch(bc()) { |
twisti@2047 | 939 | case Bytecodes::_tableswitch: |
twisti@2047 | 940 | return iter()->get_dest_table(i + 3); |
twisti@2047 | 941 | |
twisti@2047 | 942 | case Bytecodes::_lookupswitch: |
twisti@2047 | 943 | return iter()->get_dest_table(2 + 2 * i + 1); |
twisti@2047 | 944 | |
twisti@2047 | 945 | default: |
twisti@2047 | 946 | ShouldNotReachHere(); |
twisti@2047 | 947 | } |
twisti@2047 | 948 | } |
twisti@2047 | 949 | |
twisti@2047 | 950 | void SharkBlock::do_div_or_rem(bool is_long, bool is_rem) { |
twisti@2047 | 951 | SharkValue *sb = pop(); |
twisti@2047 | 952 | SharkValue *sa = pop(); |
twisti@2047 | 953 | |
twisti@2047 | 954 | check_divide_by_zero(sb); |
twisti@2047 | 955 | |
twisti@2047 | 956 | Value *a, *b, *p, *q; |
twisti@2047 | 957 | if (is_long) { |
twisti@2047 | 958 | a = sa->jlong_value(); |
twisti@2047 | 959 | b = sb->jlong_value(); |
twisti@2047 | 960 | p = LLVMValue::jlong_constant(0x8000000000000000LL); |
twisti@2047 | 961 | q = LLVMValue::jlong_constant(-1); |
twisti@2047 | 962 | } |
twisti@2047 | 963 | else { |
twisti@2047 | 964 | a = sa->jint_value(); |
twisti@2047 | 965 | b = sb->jint_value(); |
twisti@2047 | 966 | p = LLVMValue::jint_constant(0x80000000); |
twisti@2047 | 967 | q = LLVMValue::jint_constant(-1); |
twisti@2047 | 968 | } |
twisti@2047 | 969 | |
twisti@2047 | 970 | BasicBlock *ip = builder()->GetBlockInsertionPoint(); |
twisti@2047 | 971 | BasicBlock *special_case = builder()->CreateBlock(ip, "special_case"); |
twisti@2047 | 972 | BasicBlock *general_case = builder()->CreateBlock(ip, "general_case"); |
twisti@2047 | 973 | BasicBlock *done = builder()->CreateBlock(ip, "done"); |
twisti@2047 | 974 | |
twisti@2047 | 975 | builder()->CreateCondBr( |
twisti@2047 | 976 | builder()->CreateAnd( |
twisti@2047 | 977 | builder()->CreateICmpEQ(a, p), |
twisti@2047 | 978 | builder()->CreateICmpEQ(b, q)), |
twisti@2047 | 979 | special_case, general_case); |
twisti@2047 | 980 | |
twisti@2047 | 981 | builder()->SetInsertPoint(special_case); |
twisti@2047 | 982 | Value *special_result; |
twisti@2047 | 983 | if (is_rem) { |
twisti@2047 | 984 | if (is_long) |
twisti@2047 | 985 | special_result = LLVMValue::jlong_constant(0); |
twisti@2047 | 986 | else |
twisti@2047 | 987 | special_result = LLVMValue::jint_constant(0); |
twisti@2047 | 988 | } |
twisti@2047 | 989 | else { |
twisti@2047 | 990 | special_result = a; |
twisti@2047 | 991 | } |
twisti@2047 | 992 | builder()->CreateBr(done); |
twisti@2047 | 993 | |
twisti@2047 | 994 | builder()->SetInsertPoint(general_case); |
twisti@2047 | 995 | Value *general_result; |
twisti@2047 | 996 | if (is_rem) |
twisti@2047 | 997 | general_result = builder()->CreateSRem(a, b); |
twisti@2047 | 998 | else |
twisti@2047 | 999 | general_result = builder()->CreateSDiv(a, b); |
twisti@2047 | 1000 | builder()->CreateBr(done); |
twisti@2047 | 1001 | |
twisti@2047 | 1002 | builder()->SetInsertPoint(done); |
twisti@2047 | 1003 | PHINode *result; |
twisti@2047 | 1004 | if (is_long) |
twisti@4314 | 1005 | result = builder()->CreatePHI(SharkType::jlong_type(), 0, "result"); |
twisti@2047 | 1006 | else |
twisti@4314 | 1007 | result = builder()->CreatePHI(SharkType::jint_type(), 0, "result"); |
twisti@2047 | 1008 | result->addIncoming(special_result, special_case); |
twisti@2047 | 1009 | result->addIncoming(general_result, general_case); |
twisti@2047 | 1010 | |
twisti@2047 | 1011 | if (is_long) |
twisti@2047 | 1012 | push(SharkValue::create_jlong(result, false)); |
twisti@2047 | 1013 | else |
twisti@2047 | 1014 | push(SharkValue::create_jint(result, false)); |
twisti@2047 | 1015 | } |
twisti@2047 | 1016 | |
twisti@2047 | 1017 | void SharkBlock::do_field_access(bool is_get, bool is_field) { |
twisti@2047 | 1018 | bool will_link; |
twisti@2047 | 1019 | ciField *field = iter()->get_field(will_link); |
twisti@2047 | 1020 | assert(will_link, "typeflow responsibility"); |
twisti@2047 | 1021 | assert(is_field != field->is_static(), "mismatch"); |
twisti@2047 | 1022 | |
twisti@2047 | 1023 | // Pop the value off the stack where necessary |
twisti@2047 | 1024 | SharkValue *value = NULL; |
twisti@2047 | 1025 | if (!is_get) |
twisti@2047 | 1026 | value = pop(); |
twisti@2047 | 1027 | |
twisti@2047 | 1028 | // Find the object we're accessing, if necessary |
twisti@2047 | 1029 | Value *object = NULL; |
twisti@2047 | 1030 | if (is_field) { |
twisti@2047 | 1031 | SharkValue *value = pop(); |
twisti@2047 | 1032 | check_null(value); |
twisti@2047 | 1033 | object = value->generic_value(); |
twisti@2047 | 1034 | } |
twisti@4444 | 1035 | if (is_get && field->is_constant() && field->is_static()) { |
twisti@2047 | 1036 | SharkConstant *constant = SharkConstant::for_field(iter()); |
twisti@2047 | 1037 | if (constant->is_loaded()) |
twisti@2047 | 1038 | value = constant->value(builder()); |
twisti@2047 | 1039 | } |
twisti@2047 | 1040 | if (!is_get || value == NULL) { |
twisti@4314 | 1041 | if (!is_field) { |
twisti@4314 | 1042 | object = builder()->CreateInlineOop(field->holder()->java_mirror()); |
twisti@4314 | 1043 | } |
twisti@2047 | 1044 | BasicType basic_type = field->type()->basic_type(); |
twisti@4314 | 1045 | Type *stack_type = SharkType::to_stackType(basic_type); |
twisti@4314 | 1046 | Type *field_type = SharkType::to_arrayType(basic_type); |
twisti@4441 | 1047 | Type *type = field_type; |
twisti@4441 | 1048 | if (field->is_volatile()) { |
twisti@4441 | 1049 | if (field_type == SharkType::jfloat_type()) { |
twisti@4441 | 1050 | type = SharkType::jint_type(); |
twisti@4441 | 1051 | } else if (field_type == SharkType::jdouble_type()) { |
twisti@4441 | 1052 | type = SharkType::jlong_type(); |
twisti@4441 | 1053 | } |
twisti@4441 | 1054 | } |
twisti@2047 | 1055 | Value *addr = builder()->CreateAddressOfStructEntry( |
twisti@2047 | 1056 | object, in_ByteSize(field->offset_in_bytes()), |
twisti@4441 | 1057 | PointerType::getUnqual(type), |
twisti@2047 | 1058 | "addr"); |
twisti@2047 | 1059 | |
twisti@2047 | 1060 | // Do the access |
twisti@2047 | 1061 | if (is_get) { |
twisti@4314 | 1062 | Value* field_value; |
twisti@4314 | 1063 | if (field->is_volatile()) { |
twisti@4314 | 1064 | field_value = builder()->CreateAtomicLoad(addr); |
twisti@4441 | 1065 | field_value = builder()->CreateBitCast(field_value, field_type); |
twisti@4314 | 1066 | } else { |
twisti@4314 | 1067 | field_value = builder()->CreateLoad(addr); |
twisti@4314 | 1068 | } |
twisti@2047 | 1069 | if (field_type != stack_type) { |
twisti@2047 | 1070 | field_value = builder()->CreateIntCast( |
twisti@2047 | 1071 | field_value, stack_type, basic_type != T_CHAR); |
twisti@2047 | 1072 | } |
twisti@2047 | 1073 | |
twisti@2047 | 1074 | value = SharkValue::create_generic(field->type(), field_value, false); |
twisti@2047 | 1075 | } |
twisti@2047 | 1076 | else { |
twisti@2047 | 1077 | Value *field_value = value->generic_value(); |
twisti@2047 | 1078 | |
twisti@2047 | 1079 | if (field_type != stack_type) { |
twisti@2047 | 1080 | field_value = builder()->CreateIntCast( |
twisti@2047 | 1081 | field_value, field_type, basic_type != T_CHAR); |
twisti@2047 | 1082 | } |
twisti@2047 | 1083 | |
twisti@4314 | 1084 | if (field->is_volatile()) { |
twisti@4441 | 1085 | field_value = builder()->CreateBitCast(field_value, type); |
twisti@4314 | 1086 | builder()->CreateAtomicStore(field_value, addr); |
twisti@4314 | 1087 | } else { |
twisti@4314 | 1088 | builder()->CreateStore(field_value, addr); |
twisti@4314 | 1089 | } |
twisti@2047 | 1090 | |
twisti@4314 | 1091 | if (!field->type()->is_primitive_type()) { |
twisti@2047 | 1092 | builder()->CreateUpdateBarrierSet(oopDesc::bs(), addr); |
twisti@4314 | 1093 | } |
twisti@2047 | 1094 | } |
twisti@2047 | 1095 | } |
twisti@2047 | 1096 | |
twisti@2047 | 1097 | // Push the value onto the stack where necessary |
twisti@2047 | 1098 | if (is_get) |
twisti@2047 | 1099 | push(value); |
twisti@2047 | 1100 | } |
twisti@2047 | 1101 | |
twisti@2047 | 1102 | void SharkBlock::do_lcmp() { |
twisti@2047 | 1103 | Value *b = pop()->jlong_value(); |
twisti@2047 | 1104 | Value *a = pop()->jlong_value(); |
twisti@2047 | 1105 | |
twisti@2047 | 1106 | BasicBlock *ip = builder()->GetBlockInsertionPoint(); |
twisti@2047 | 1107 | BasicBlock *ne = builder()->CreateBlock(ip, "lcmp_ne"); |
twisti@2047 | 1108 | BasicBlock *lt = builder()->CreateBlock(ip, "lcmp_lt"); |
twisti@2047 | 1109 | BasicBlock *gt = builder()->CreateBlock(ip, "lcmp_gt"); |
twisti@2047 | 1110 | BasicBlock *done = builder()->CreateBlock(ip, "done"); |
twisti@2047 | 1111 | |
twisti@2047 | 1112 | BasicBlock *eq = builder()->GetInsertBlock(); |
twisti@2047 | 1113 | builder()->CreateCondBr(builder()->CreateICmpEQ(a, b), done, ne); |
twisti@2047 | 1114 | |
twisti@2047 | 1115 | builder()->SetInsertPoint(ne); |
twisti@2047 | 1116 | builder()->CreateCondBr(builder()->CreateICmpSLT(a, b), lt, gt); |
twisti@2047 | 1117 | |
twisti@2047 | 1118 | builder()->SetInsertPoint(lt); |
twisti@2047 | 1119 | builder()->CreateBr(done); |
twisti@2047 | 1120 | |
twisti@2047 | 1121 | builder()->SetInsertPoint(gt); |
twisti@2047 | 1122 | builder()->CreateBr(done); |
twisti@2047 | 1123 | |
twisti@2047 | 1124 | builder()->SetInsertPoint(done); |
twisti@4314 | 1125 | PHINode *result = builder()->CreatePHI(SharkType::jint_type(), 0, "result"); |
twisti@2047 | 1126 | result->addIncoming(LLVMValue::jint_constant(-1), lt); |
twisti@2047 | 1127 | result->addIncoming(LLVMValue::jint_constant(0), eq); |
twisti@2047 | 1128 | result->addIncoming(LLVMValue::jint_constant(1), gt); |
twisti@2047 | 1129 | |
twisti@2047 | 1130 | push(SharkValue::create_jint(result, false)); |
twisti@2047 | 1131 | } |
twisti@2047 | 1132 | |
twisti@2047 | 1133 | void SharkBlock::do_fcmp(bool is_double, bool unordered_is_greater) { |
twisti@2047 | 1134 | Value *a, *b; |
twisti@2047 | 1135 | if (is_double) { |
twisti@2047 | 1136 | b = pop()->jdouble_value(); |
twisti@2047 | 1137 | a = pop()->jdouble_value(); |
twisti@2047 | 1138 | } |
twisti@2047 | 1139 | else { |
twisti@2047 | 1140 | b = pop()->jfloat_value(); |
twisti@2047 | 1141 | a = pop()->jfloat_value(); |
twisti@2047 | 1142 | } |
twisti@2047 | 1143 | |
twisti@2047 | 1144 | BasicBlock *ip = builder()->GetBlockInsertionPoint(); |
twisti@2047 | 1145 | BasicBlock *ordered = builder()->CreateBlock(ip, "ordered"); |
twisti@2047 | 1146 | BasicBlock *ge = builder()->CreateBlock(ip, "fcmp_ge"); |
twisti@2047 | 1147 | BasicBlock *lt = builder()->CreateBlock(ip, "fcmp_lt"); |
twisti@2047 | 1148 | BasicBlock *eq = builder()->CreateBlock(ip, "fcmp_eq"); |
twisti@2047 | 1149 | BasicBlock *gt = builder()->CreateBlock(ip, "fcmp_gt"); |
twisti@2047 | 1150 | BasicBlock *done = builder()->CreateBlock(ip, "done"); |
twisti@2047 | 1151 | |
twisti@2047 | 1152 | builder()->CreateCondBr( |
twisti@2047 | 1153 | builder()->CreateFCmpUNO(a, b), |
twisti@2047 | 1154 | unordered_is_greater ? gt : lt, ordered); |
twisti@2047 | 1155 | |
twisti@2047 | 1156 | builder()->SetInsertPoint(ordered); |
twisti@2047 | 1157 | builder()->CreateCondBr(builder()->CreateFCmpULT(a, b), lt, ge); |
twisti@2047 | 1158 | |
twisti@2047 | 1159 | builder()->SetInsertPoint(ge); |
twisti@2047 | 1160 | builder()->CreateCondBr(builder()->CreateFCmpUGT(a, b), gt, eq); |
twisti@2047 | 1161 | |
twisti@2047 | 1162 | builder()->SetInsertPoint(lt); |
twisti@2047 | 1163 | builder()->CreateBr(done); |
twisti@2047 | 1164 | |
twisti@2047 | 1165 | builder()->SetInsertPoint(gt); |
twisti@2047 | 1166 | builder()->CreateBr(done); |
twisti@2047 | 1167 | |
twisti@2047 | 1168 | builder()->SetInsertPoint(eq); |
twisti@2047 | 1169 | builder()->CreateBr(done); |
twisti@2047 | 1170 | |
twisti@2047 | 1171 | builder()->SetInsertPoint(done); |
twisti@4314 | 1172 | PHINode *result = builder()->CreatePHI(SharkType::jint_type(), 0, "result"); |
twisti@2047 | 1173 | result->addIncoming(LLVMValue::jint_constant(-1), lt); |
twisti@2047 | 1174 | result->addIncoming(LLVMValue::jint_constant(0), eq); |
twisti@2047 | 1175 | result->addIncoming(LLVMValue::jint_constant(1), gt); |
twisti@2047 | 1176 | |
twisti@2047 | 1177 | push(SharkValue::create_jint(result, false)); |
twisti@2047 | 1178 | } |
twisti@2047 | 1179 | |
twisti@2047 | 1180 | void SharkBlock::emit_IR() { |
twisti@2047 | 1181 | ShouldNotCallThis(); |
twisti@2047 | 1182 | } |
twisti@2047 | 1183 | |
twisti@2047 | 1184 | SharkState* SharkBlock::entry_state() { |
twisti@2047 | 1185 | ShouldNotCallThis(); |
twisti@2047 | 1186 | } |
twisti@2047 | 1187 | |
twisti@2047 | 1188 | void SharkBlock::do_zero_check(SharkValue* value) { |
twisti@2047 | 1189 | ShouldNotCallThis(); |
twisti@2047 | 1190 | } |
twisti@2047 | 1191 | |
twisti@2047 | 1192 | void SharkBlock::maybe_add_backedge_safepoint() { |
twisti@2047 | 1193 | ShouldNotCallThis(); |
twisti@2047 | 1194 | } |
twisti@2047 | 1195 | |
twisti@2047 | 1196 | bool SharkBlock::has_trap() { |
twisti@2047 | 1197 | return false; |
twisti@2047 | 1198 | } |
twisti@2047 | 1199 | |
twisti@2047 | 1200 | int SharkBlock::trap_request() { |
twisti@2047 | 1201 | ShouldNotCallThis(); |
twisti@2047 | 1202 | } |
twisti@2047 | 1203 | |
twisti@2047 | 1204 | int SharkBlock::trap_bci() { |
twisti@2047 | 1205 | ShouldNotCallThis(); |
twisti@2047 | 1206 | } |
twisti@2047 | 1207 | |
twisti@2047 | 1208 | void SharkBlock::do_trap(int trap_request) { |
twisti@2047 | 1209 | ShouldNotCallThis(); |
twisti@2047 | 1210 | } |
twisti@2047 | 1211 | |
twisti@2047 | 1212 | void SharkBlock::do_arraylength() { |
twisti@2047 | 1213 | ShouldNotCallThis(); |
twisti@2047 | 1214 | } |
twisti@2047 | 1215 | |
twisti@2047 | 1216 | void SharkBlock::do_aload(BasicType basic_type) { |
twisti@2047 | 1217 | ShouldNotCallThis(); |
twisti@2047 | 1218 | } |
twisti@2047 | 1219 | |
twisti@2047 | 1220 | void SharkBlock::do_astore(BasicType basic_type) { |
twisti@2047 | 1221 | ShouldNotCallThis(); |
twisti@2047 | 1222 | } |
twisti@2047 | 1223 | |
twisti@2047 | 1224 | void SharkBlock::do_return(BasicType type) { |
twisti@2047 | 1225 | ShouldNotCallThis(); |
twisti@2047 | 1226 | } |
twisti@2047 | 1227 | |
twisti@2047 | 1228 | void SharkBlock::do_athrow() { |
twisti@2047 | 1229 | ShouldNotCallThis(); |
twisti@2047 | 1230 | } |
twisti@2047 | 1231 | |
twisti@2047 | 1232 | void SharkBlock::do_goto() { |
twisti@2047 | 1233 | ShouldNotCallThis(); |
twisti@2047 | 1234 | } |
twisti@2047 | 1235 | |
twisti@2047 | 1236 | void SharkBlock::do_jsr() { |
twisti@2047 | 1237 | ShouldNotCallThis(); |
twisti@2047 | 1238 | } |
twisti@2047 | 1239 | |
twisti@2047 | 1240 | void SharkBlock::do_ret() { |
twisti@2047 | 1241 | ShouldNotCallThis(); |
twisti@2047 | 1242 | } |
twisti@2047 | 1243 | |
twisti@2047 | 1244 | void SharkBlock::do_if(ICmpInst::Predicate p, SharkValue* b, SharkValue* a) { |
twisti@2047 | 1245 | ShouldNotCallThis(); |
twisti@2047 | 1246 | } |
twisti@2047 | 1247 | |
twisti@2047 | 1248 | void SharkBlock::do_switch() { |
twisti@2047 | 1249 | ShouldNotCallThis(); |
twisti@2047 | 1250 | } |
twisti@2047 | 1251 | |
twisti@2047 | 1252 | void SharkBlock::do_call() { |
twisti@2047 | 1253 | ShouldNotCallThis(); |
twisti@2047 | 1254 | } |
twisti@2047 | 1255 | |
twisti@2047 | 1256 | void SharkBlock::do_instance_check() { |
twisti@2047 | 1257 | ShouldNotCallThis(); |
twisti@2047 | 1258 | } |
twisti@2047 | 1259 | |
twisti@2047 | 1260 | bool SharkBlock::maybe_do_instanceof_if() { |
twisti@2047 | 1261 | ShouldNotCallThis(); |
twisti@2047 | 1262 | } |
twisti@2047 | 1263 | |
twisti@2047 | 1264 | void SharkBlock::do_new() { |
twisti@2047 | 1265 | ShouldNotCallThis(); |
twisti@2047 | 1266 | } |
twisti@2047 | 1267 | |
twisti@2047 | 1268 | void SharkBlock::do_newarray() { |
twisti@2047 | 1269 | ShouldNotCallThis(); |
twisti@2047 | 1270 | } |
twisti@2047 | 1271 | |
twisti@2047 | 1272 | void SharkBlock::do_anewarray() { |
twisti@2047 | 1273 | ShouldNotCallThis(); |
twisti@2047 | 1274 | } |
twisti@2047 | 1275 | |
twisti@2047 | 1276 | void SharkBlock::do_multianewarray() { |
twisti@2047 | 1277 | ShouldNotCallThis(); |
twisti@2047 | 1278 | } |
twisti@2047 | 1279 | |
twisti@2047 | 1280 | void SharkBlock::do_monitorenter() { |
twisti@2047 | 1281 | ShouldNotCallThis(); |
twisti@2047 | 1282 | } |
twisti@2047 | 1283 | |
twisti@2047 | 1284 | void SharkBlock::do_monitorexit() { |
twisti@2047 | 1285 | ShouldNotCallThis(); |
twisti@2047 | 1286 | } |