Mercurial > hg > graal-jvmci-8
comparison src/share/vm/prims/methodHandleWalk.cpp @ 3363:167b70ff3abc
6939861: JVM should handle more conversion operations
Reviewed-by: twisti, jrose
author | never |
---|---|
date | Fri, 06 May 2011 16:33:13 -0700 |
parents | 2a23b1b5a0a8 |
children | e2a92dd0d3d2 |
comparison
equal
deleted
inserted
replaced
3362:d4c1fbc3de95 | 3363:167b70ff3abc |
---|---|
407 case java_lang_invoke_AdapterMethodHandle::OP_COLLECT_ARGS: { //NYI, may GC | 407 case java_lang_invoke_AdapterMethodHandle::OP_COLLECT_ARGS: { //NYI, may GC |
408 lose("unimplemented", CHECK_(empty)); | 408 lose("unimplemented", CHECK_(empty)); |
409 break; | 409 break; |
410 } | 410 } |
411 | 411 |
412 case java_lang_invoke_AdapterMethodHandle::OP_FOLD_ARGS: { //NYI, may GC | |
413 lose("unimplemented", CHECK_(empty)); | |
414 break; | |
415 } | |
416 | |
412 case java_lang_invoke_AdapterMethodHandle::OP_SPREAD_ARGS: { | 417 case java_lang_invoke_AdapterMethodHandle::OP_SPREAD_ARGS: { |
413 klassOop array_klass_oop = NULL; | 418 klassOop array_klass_oop = NULL; |
414 BasicType array_type = java_lang_Class::as_BasicType(chain().adapter_arg_oop(), | 419 BasicType array_type = java_lang_Class::as_BasicType(chain().adapter_arg_oop(), |
415 &array_klass_oop); | 420 &array_klass_oop); |
416 assert(array_type == T_OBJECT, ""); | 421 assert(array_type == T_OBJECT, ""); |
450 arglist[2] = ArgToken(); // sentinel | 455 arglist[2] = ArgToken(); // sentinel |
451 make_invoke(NULL, vmIntrinsics::_checkSpreadArgument, | 456 make_invoke(NULL, vmIntrinsics::_checkSpreadArgument, |
452 Bytecodes::_invokestatic, false, 3, &arglist[0], CHECK_(empty)); | 457 Bytecodes::_invokestatic, false, 3, &arglist[0], CHECK_(empty)); |
453 | 458 |
454 // Spread out the array elements. | 459 // Spread out the array elements. |
455 Bytecodes::Code aload_op = Bytecodes::_aaload; | 460 Bytecodes::Code aload_op = Bytecodes::_nop; |
456 if (element_type != T_OBJECT) { | 461 switch (element_type) { |
457 lose("primitive array NYI", CHECK_(empty)); | 462 case T_INT: aload_op = Bytecodes::_iaload; break; |
463 case T_LONG: aload_op = Bytecodes::_laload; break; | |
464 case T_FLOAT: aload_op = Bytecodes::_faload; break; | |
465 case T_DOUBLE: aload_op = Bytecodes::_daload; break; | |
466 case T_OBJECT: aload_op = Bytecodes::_aaload; break; | |
467 case T_BOOLEAN: // fall through: | |
468 case T_BYTE: aload_op = Bytecodes::_baload; break; | |
469 case T_CHAR: aload_op = Bytecodes::_caload; break; | |
470 case T_SHORT: aload_op = Bytecodes::_saload; break; | |
471 default: lose("primitive array NYI", CHECK_(empty)); | |
458 } | 472 } |
459 int ap = arg_slot; | 473 int ap = arg_slot; |
460 for (int i = 0; i < spread_length; i++) { | 474 for (int i = 0; i < spread_length; i++) { |
461 jvalue offset_jvalue; offset_jvalue.i = i; | 475 jvalue offset_jvalue; offset_jvalue.i = i; |
462 ArgToken offset_arg = make_prim_constant(T_INT, &offset_jvalue, CHECK_(empty)); | 476 ArgToken offset_arg = make_prim_constant(T_INT, &offset_jvalue, CHECK_(empty)); |
464 change_argument(T_VOID, ap, element_type, element_arg); | 478 change_argument(T_VOID, ap, element_type, element_arg); |
465 ap += type2size[element_type]; | 479 ap += type2size[element_type]; |
466 } | 480 } |
467 break; | 481 break; |
468 } | 482 } |
469 | |
470 case java_lang_invoke_AdapterMethodHandle::OP_FLYBY: //NYI, runs Java code | |
471 case java_lang_invoke_AdapterMethodHandle::OP_RICOCHET: //NYI, runs Java code | |
472 lose("unimplemented", CHECK_(empty)); | |
473 break; | |
474 | 483 |
475 default: | 484 default: |
476 lose("bad adapter conversion", CHECK_(empty)); | 485 lose("bad adapter conversion", CHECK_(empty)); |
477 break; | 486 break; |
478 } | 487 } |