Changeset 2386


Ignore:
Timestamp:
Feb 11, 2007, 7:13:51 AM (14 years ago)
Author:
orlov
Message:
  • Initiallization for objects.
File:
1 edited

Legend:

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

    r2385 r2386  
    4747$func Access-Mode t.name = s.jbc-access-mode;
    4848
     49$box Objects;
    4950$box Constants;
    5051
     
    5657
    5758RFP-ASAIL-To-JBC (e.module-name) (e.package) (e.exports) e.module =
     59  <Store &Objects>,
    5860  <Store &Constants>,
    5961  {
     
    7072  :: e.java-module-name,
    7173  <Store &Module-Name e.java-module-name>,
     74  <To-Word <Intersperse ('/') e.java-module-name>> :: s.class-name,
    7275  <ClassWriter <"+" &"COMPUTE_MAXS" &"COMPUTE_FRAMES">> :: s.cw,
    7376  /*<ASAIL-To-JBC-Temp s.cw e.module> : e,
     
    8285          )'}');;
    8386      } :: e.entry,*/
    84   <"visit" s.cw 46 &"ACC_PUBLIC" <To-Word <Intersperse ('/') e.java-module-name>> <Null> "java/lang/Object" ()>,
     87  <"visit" s.cw 46 &"ACC_PUBLIC" s.class-name <Null> "java/lang/Object" ()>,
    8588  <Module-To-JBC s.cw e.module>,
    8689
     
    9194      <MVvisitInsn <MV> &DUP>,
    9295      <MVvisitMethodInsn <MV> &INVOKESPECIAL "org/refal/plus/Result" "<init>" "()V">,
    93       <MVvisitMethodInsn <MV> &INVOKESTATIC <To-Word <Intersperse ('/') e.java-module-name>> s.name "(Lorg/refal/plus/Result;)V">,
     96      <MVvisitMethodInsn <MV> &INVOKESTATIC s.class-name s.name "(Lorg/refal/plus/Result;)V">,
    9497      <MVvisitInsn <MV> &RETURN>,
    9598      <MVvisitMaxs <MV> 0 0>,
     
    98101
    99102  <Store &MVbox <"visitMethod" s.cw &"ACC_STATIC" "<clinit>" "()V" <Null> ()>>,
     103  {
     104    <? &Objects> : e (s.j-name s.rf-name e.cl-name) e,
     105      <To-Word "org/refal/plus/library/" e.cl-name> :: s.cl-name,
     106      <MVvisitTypeInsn <MV> &NEW "org/refal/plus/Expr">,
     107      <MVvisitInsn <MV> &DUP>,
     108      <MVvisitTypeInsn <MV> &NEW s.cl-name>,
     109      <MVvisitInsn <MV> &DUP>,
     110      <MVvisitLdcInsn <MV> <WordToString s.rf-name>>,
     111      <MVvisitMethodInsn <MV> &INVOKESPECIAL s.cl-name "<init>" "(Ljava/lang/String;)V">,
     112      <MVvisitMethodInsn <MV> &INVOKESPECIAL "org/refal/plus/Expr" "<init>" "(Ljava/lang/Object;)V">,
     113      <MVvisitFieldInsn <MV> &PUTSTATIC s.class-name s.j-name "Lorg/refal/plus/Expr;">,
     114      $fail;;
     115  },
    100116  {
    101117    <? &Constants> : e (s.const-name e.expr) e,
     
    177193
    178194Push-Trap s.end s.handler =
    179   <Put &Traps (s.end s.handler)>;
    180 
    181 Get-Trap = <R 0 <? &Traps>> : (s s.handler) = s.handler;
     195  <Put &Traps s.end s.handler>;
     196
     197Get-Trap = <R 0 <? &Traps>> : s.handler = s.handler;
    182198
    183199Pop-Trap =
    184   <? &Traps> : e.traps (s.end s),
     200  <? &Traps> : e.traps s.end s,
    185201  <Store &Traps e.traps>,
    186202  s.end;
     
    248264      <FVvisitEnd s.fv>,
    249265      <Put &Constants (s.n e.expr)>;
    250       //<Const-Expr-To-JBC e.expr> :: e.a (e.j-expr),
    251       //e.a ('static '<Access-Mode t.name>' final Expr 'e.n' = 'e.j-expr';');
    252266    (OBJ s.linkage s.tag t.name) =
    253267      t.name : (s s.obj-name),
    254268      <To-Chars s.tag> : s1 e2,
    255269      'Named' s1 <To-Lower e2> :: e.class-name,
     270      <To-Word <Rfp2Java s.obj-name>> :: s.n,
    256271      <"+" &"ACC_STATIC" <"+" &"ACC_FINAL" <Access-Mode t.name>>> :: s.accessMode,
    257       <"visitField" s.cw s.accessMode <To-Word <Rfp2Java s.obj-name>> "Lorg/refal/plus/Expr;" <Null> <Null>> :: s.fv,
    258       <FVvisitEnd s.fv>;
    259       //('static '<Access-Mode t.name>' final Expr '<Name-To-JBC t.name>
    260       //  ' = new Expr (new 'e.class-name' ("'e.n'"));');
     272      <"visitField" s.cw s.accessMode s.n "Lorg/refal/plus/Expr;" <Null> <Null>> :: s.fv,
     273      <FVvisitEnd s.fv>,
     274      <Put &Objects (s.n s.obj-name e.class-name)>;
    261275    (DECL-OBJ t.name) = ;
    262276    (DECL-FUNC t.name) = ;
     
    378392    (s.tag t.label), s.tag : \{ CONTINUE; BREAK; } =
    379393      <MVvisitJumpInsn <MV> &GOTO <Lookup-Label t.label>>;
    380     RETFAIL = <MVvisitInsn <MV> &"ICONST_0"> <MVvisitInsn <MV> &IRETURN>;
     394    RETFAIL =
     395      <MVvisitInsn <MV> &"ICONST_0"> <MVvisitInsn <MV> &IRETURN>;
    381396    (TRY e.body) =
    382397      <Label> :: s.start,
Note: See TracChangeset for help on using the changeset viewer.