Package haikuvm.pc.tools.haikuc

Examples of haikuvm.pc.tools.haikuc.PrintOnChange


            // Must be after Closure.root(..) because of HAIKU_Threads may become 1
            new HaikuDefs(HaikuDefs.getProperty("APP_BASE")).print();

      File cf=new File(HaikuDefs.getProperty("APP_BASE")+"/"+Haikufy.choice("haikuC")+"/haikuConfig.h");
      haikuConfigh=new PrintOnChange(cf)
      haikuConfigh.println("#include \"haikuJ2C.h\"");

     
      File ni=new File(HaikuDefs.getProperty("APP_BASE")+"/"+Haikufy.choice("haikuC")+"/haikuConfig.c");
      haikuConfigc=new PrintOnChange(ni)
      haikuConfigc.println("#include \"haikuConfig.h\"");
      haikuConfigc.println();
      //haikuConfigc.printf("#include \"Bytecodes.h\"\n");
      haikuConfigc.printf("#include <float.h>\n");
      haikuConfigc.printf("\n");
     

            Closure.root("java.lang.Thread");
            Closure.root("java.lang.String");
           
            int distinctBCs = Closure.getDistinctBCs();
            FunctionTable.setInvokeShortMax(Math.max(256-distinctBCs-35, 0));
           
      /*
       * Order is important to keep exceptionCode at position 0 in case of exception usage.
       *
       * statics_t allStatics;
       * //jobject:
       * ...
       * //jint:
       * //        0  haiku_vm_arduino_HaikuMicroKernel_exceptionCode
       * //        1  haiku_vm_arduino_HaikuMicroKernel_exceptionArg
       *
       * FIRST
       */
      if(mainOsThread!=null) {     
        if (linkerOption) {
          new Compile2Data(mainOsThread).link();
        } else {
          new Compile2C(mainOsThread).compile();
        }
      }

            /*
             * SECOND
             */
            if (!mainOsThread.equals(mainclass)) {
                if (linkerOption) {
                    new Compile2Data(mainclass).link();
                } else {
                    new Compile2C(mainclass).compile();
                }
            }
           
            /*
             * THIRD
             *
             */
            if (linkerOption) {
                new Compile2Data("java/lang/Thread").link();
            } else {
                new Compile2C("java/lang/Thread").compile();
            }
           
            /*
             * FOURTH
             *
             */
            if (linkerOption) {
                new Compile2Data("java/lang/String").link();
            } else {
                new Compile2C("java/lang/String").compile();
            }
           
      Msg2Meth.printAllMsgsH(haikuConfigh);

      BC2IDX.printAllBCdefinesH(haikuConfigh);
      BC2IDX.printBCtableC(haikuConfigc);
      PrintOnChange bytecodeDispatcher=new PrintOnChange(new File(HaikuDefs.getProperty("APP_BASE")+"/"+Haikufy.choice("haikuC")+"/bytecodeDispatcher.h"));
      BC2IDX.printBytecodeLabels(bytecodeDispatcher);
      bytecodeDispatcher.close();

      if (singleFile) {
            haikuConfigc.printf("\n");
                haikuConfigc.printf("\n");
                haikuConfigc.println("#include \"haikuJava.h\"");
View Full Code Here


            outc.println(inc);
        }
        if (array==null) {
            if (!singleFile) {
                if (!cf.exists()) {
                    PrintOnChange f = new HaikuJava2H(cf);
                    f.close();
                }
            }
        } else if (!CollectedIncludes.contains(inc)) {
            PrintOnChange arrayh = new HaikuJava2H(new File(HaikuDefs.getProperty("APP_BASE")+"/"+Haikufy.choice("haikuJava")+"/"+include+".h"));
            arrayh.printf("extern const class_t %s__class;\n", array);
            arrayh.close();
           
            PrintOnChange arrayc = new HaikuJava2C(new File(HaikuDefs.getProperty("APP_BASE")+"/"+Haikufy.choice("haikuJava")+"/"+include+".c"));
            if (!singleFile) {
                arrayc.printf("#include \"haikuConfig.h\"\n");
                arrayc.printf("#include \"haikuJava.h\"\n");
            }

            arrayc.printf("\n");
            arrayc.printf("const class_t %s__class PROGMEM = {\n", array);
            arrayc.printf("    & java_lang_Object__class,\n");
            arrayc.printf("    0,\n");
            arrayc.printf("    0,\n");
            arrayc.printf("    // {{}} VC 5\n");
            arrayc.printf("};\n");
            arrayc.close();
        }
        CollectedIncludes.put(inc);
    }
View Full Code Here

  public void printJ2C() throws IOException {
    msg2meth =new Msg2Meth();
   
    Method[] methods=jc.getMethods();
    outc=new PrintOnChange(new File(HaikuDefs.getProperty("APP_BASE")+"/"+filename(classname)+".c"));
    outh=new PrintOnChange(new File(HaikuDefs.getProperty("APP_BASE")+"/"+filename(classname)+".h"));
 
    outc.println("/*");
    outc.println(jc);
    outc.println("*/");
    outc.println();
 
View Full Code Here

TOP

Related Classes of haikuvm.pc.tools.haikuc.PrintOnChange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.