Changeset 2397


Ignore:
Timestamp:
Feb 11, 2007, 7:03:44 PM (14 years ago)
Author:
yura
Message:
  • No not needed CHECKCASTs
  • V1_4 (48)
Location:
to-imperative/trunk
Files:
1 added
3 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/compiler/rfp_asail_jbc.rf

    r2396 r2397  
    9090          )'}');;
    9191      } :: e.entry,*/
    92   <CWvisit s.cw &"V1_2" &"ACC_PUBLIC" s.class-name <Null> "java/lang/Object" ()>,
     92  <CWvisit s.cw &"V1_4" &"ACC_PUBLIC" s.class-name <Null> "java/lang/Object" ()>,
    9393  <Module-To-JBC s.cw e.module>,
    9494
     
    118118      <MVvisitLdcInsn <MV> <WordToString s.rf-name>>,
    119119      <MVvisitMethodInsn <MV> &INVOKESPECIAL s.cl-name "<init>" "(Ljava/lang/String;)V">,
    120       <MVvisitTypeInsn <MV> &CHECKCAST "java/lang/Object">,
    121120      <MVvisitMethodInsn <MV> &INVOKESPECIAL "org/refal/plus/Expr" "<init>" "(Ljava/lang/Object;)V">,
    122121      <MVvisitFieldInsn <MV> &PUTSTATIC s.class-name s.j-name "Lorg/refal/plus/Expr;">,
     
    145144    <? &Func-Refs> : e (s.cl-name s.mod-name s.func-name s.type) e,
    146145      <ClassWriter <"+" &"COMPUTE_MAXS" &"COMPUTE_FRAMES">> :: s.cw,
    147       <CWvisit s.cw &"V1_2" &"ACC_FINAL" <To-Word s.class-name '$' s.cl-name> <Null> "java/lang/Object" ("org/refal/plus/Func")>,
     146      <CWvisit s.cw &"V1_4" &"ACC_FINAL" <To-Word s.class-name '$' s.cl-name> <Null> "java/lang/Object" ("org/refal/plus/Func")>,
    148147      <CWvisitMethod s.cw 0 "<init>" "()V" <Null> ()> :: s.mv,
    149148      <MVvisitVarInsn s.mv &ALOAD 0>,
     
    577576        <MVvisitLdcInsn <MV> <Integer s.i>>,
    578577        <Term-Ref-To-JBC t.term>,
    579         <MVvisitTypeInsn <MV> &CHECKCAST "java/lang/Object">, // TODO!!!
    580578        <MVvisitInsn <MV> &AASTORE>,
    581579        <"+" s.i 1> e.rest;
     
    590588    <MVvisitInsn <MV> &DUP>,
    591589    <Expr-Ref-To-JBC e.expr>,
    592     <MVvisitTypeInsn <MV> &CHECKCAST "java/lang/Object">,
    593590    <MVvisitMethodInsn <MV> &INVOKESPECIAL "org/refal/plus/Expr" "<init>" "(Ljava/lang/Object;)V">;
    594591  (DEREF e.expr (e.pos)) =
     
    764761        <MVvisitLdcInsn <MV> <Integer s.i>>,
    765762        <Const-Term-To-JBC t.term>,
    766         <MVvisitTypeInsn <MV> &CHECKCAST "java/lang/Object">, // TODO!!!
    767763        <MVvisitInsn <MV> &AASTORE>,
    768764        <"+" s.i 1> e.rest;
     
    811807    <MVvisitInsn <MV> &DUP>,
    812808    <Const-Expr-To-JBC e.expr>,
    813     <MVvisitTypeInsn <MV> &CHECKCAST "java/lang/Object">,
    814809    <MVvisitMethodInsn <MV> &INVOKESPECIAL "org/refal/plus/Expr" "<init>" "(Ljava/lang/Object;)V">;
    815810  t.term, t.term : \{
     
    827822    <MVvisitInsn <MV> &DUP>,
    828823    <MVvisitMethodInsn <MV> &INVOKESPECIAL s.cl-name "<init>" "()V">,
    829     <MVvisitTypeInsn <MV> &CHECKCAST "java/lang/Object">,
    830824    <MVvisitMethodInsn <MV> &INVOKESPECIAL "org/refal/plus/Expr" "<init>" "(Ljava/lang/Object;)V">;
    831825  s.sym, {
     
    840834          <MVvisitLdcInsn <MV> <WordToString <To-Word s.sym>>>,
    841835          <MVvisitMethodInsn <MV> &INVOKESPECIAL "java/math/BigInteger" "<init>" "(Ljava/lang/String;)V">,
    842           <MVvisitTypeInsn <MV> &CHECKCAST "java/lang/Object">,
    843836          <MVvisitMethodInsn <MV> &INVOKESPECIAL "org/refal/plus/Expr" "<init>" "(Ljava/lang/Object;)V">;
    844837        //    () ('new Expr (new '<? &Int>' ("'s.sym'"))');
     
    851844      <MVvisitLdcInsn <MV> <WordToString <To-Word <Symbol-To-JBC s.sym>>>>,
    852845      <MVvisitMethodInsn <MV> &INVOKESPECIAL "org/refal/plus/Word" "<init>" "(Ljava/lang/String;)V">,
    853       <MVvisitTypeInsn <MV> &CHECKCAST "java/lang/Object">,
    854846      <MVvisitMethodInsn <MV> &INVOKESPECIAL "org/refal/plus/Expr" "<init>" "(Ljava/lang/Object;)V">;
    855847  };
  • to-imperative/trunk/java/org/refal/plus/wrapgen/WrapGen.java

    r2356 r2397  
    123123                                mv.visitInsn(Opcodes.I2L);
    124124                                mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/math/BigInteger", "valueOf", "(J)Ljava/math/BigInteger;");
    125                                 mv.visitTypeInsn(Opcodes.CHECKCAST, "java/lang/Object"); // TODO: It is not needed.
    126125                                mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "org/refal/plus/Expr", "<init>", "(Ljava/lang/Object;)V");
    127126                                mv.visitFieldInsn(Opcodes.PUTSTATIC, this.newName, name, "Lorg/refal/plus/Expr;");
     
    219218                        mv.visitInsn(Opcodes.DUP);
    220219                        mv.visitFieldInsn(Opcodes.GETSTATIC, "org/refal/plus/library/Java", "null_obj", "Lorg/refal/plus/library/Java$Null;");
    221                         mv.visitTypeInsn(Opcodes.CHECKCAST, "java/lang/Object"); // TODO: It is not needed.
    222220                        mv.visitJumpInsn(Opcodes.IF_ACMPEQ, l1);
    223221                        if (type.equals(Type.getType("Ljava/lang/String;"))) {
     
    307305                        mv.visitInsn(Opcodes.DUP);
    308306                        mv.visitJumpInsn(Opcodes.IFNULL, l1);
    309                         if (type.equals(Type.getType("Ljava/lang/String;"))) {
     307                        if (type.equals(Type.getType("Ljava/lang/String;")))
    310308                                mv.visitMethodInsn(Opcodes.INVOKESTATIC, "org/refal/plus/Word", "valueOf", "(Ljava/lang/String;)Lorg/refal/plus/Word;");
    311                                 mv.visitTypeInsn(Opcodes.CHECKCAST, "java/lang/Object"); // TODO: It is not needed.
    312                         }
    313309                        mv.visitJumpInsn(Opcodes.GOTO, l2);
    314310                        mv.visitLabel(l1);
    315311                        mv.visitInsn(Opcodes.POP);
    316312                        mv.visitFieldInsn(Opcodes.GETSTATIC, "org/refal/plus/library/Java", "null_obj", "Lorg/refal/plus/library/Java$Null;");
    317                         mv.visitTypeInsn(Opcodes.CHECKCAST, "java/lang/Object"); // TODO: It is not needed.
    318313                        mv.visitLabel(l2);
    319314                        break;
    320315                }
    321                 mv.visitTypeInsn(Opcodes.CHECKCAST, "java/lang/Object"); // TODO: It is not needed.
    322316        }
    323317
Note: See TracChangeset for help on using the changeset viewer.