Ejemplo n.º 1
0
jint init_globals() {
  HandleMark hm;
  management_init();
  bytecodes_init();
  classLoader_init();
  codeCache_init();
  VM_Version_init();
  os_init_globals();
  stubRoutines_init1();
  jint status = universe_init();  // dependent on codeCache_init and
                                  // stubRoutines_init1
  if (status != JNI_OK)
    return status;

  interpreter_init();  // before any methods loaded
  invocationCounter_init();  // before any methods loaded
  marksweep_init();
  accessFlags_init();
  templateTable_init();
  InterfaceSupport_init();
  SharedRuntime::generate_stubs();
  universe2_init();  // dependent on codeCache_init and stubRoutines_init1
  referenceProcessor_init();
  jni_handles_init();
#ifndef VM_STRUCTS_KERNEL
  vmStructs_init();
#endif // VM_STRUCTS_KERNEL

  vtableStubs_init();
  InlineCacheBuffer_init();
  compilerOracle_init();
  compilationPolicy_init();
  compileBroker_init();
  VMRegImpl::set_regName();

  if (!universe_post_init()) {
    return JNI_ERR;
  }
  javaClasses_init();   // must happen after vtable initialization
  stubRoutines_init2(); // note: StubRoutines need 2-phase init

  // Although we'd like to, we can't easily do a heap verify
  // here because the main thread isn't yet a JavaThread, so
  // its TLAB may not be made parseable from the usual interfaces.
  if (VerifyBeforeGC && !UseTLAB &&
      Universe::heap()->total_collections() >= VerifyGCStartAt) {
    Universe::heap()->prepare_for_verify();
    Universe::verify();   // make sure we're starting with a clean slate
  }

  // All the flags that get adjusted by VM_Version_init and os::init_2
  // have been set so dump the flags now.
  if (PrintFlagsFinal) {
    CommandLineFlags::printFlags(tty, false);
  }

  return JNI_OK;
}
Ejemplo n.º 2
0
jint init_globals() {
  HandleMark hm;
  management_init();
  bytecodes_init();
  classLoader_init();
  codeCache_init();
  VM_Version_init();
  os_init_globals();
  stubRoutines_init1();
  jint status = universe_init();  // dependent on codeCache_init and
                                  // stubRoutines_init1 and metaspace_init.
  if (status != JNI_OK)
    return status;

  interpreter_init();  // before any methods loaded
  invocationCounter_init();  // before any methods loaded
  marksweep_init();
  accessFlags_init();
  templateTable_init();
  InterfaceSupport_init();
  SharedRuntime::generate_stubs();
  universe2_init();  // dependent on codeCache_init and stubRoutines_init1
  referenceProcessor_init();
  jni_handles_init();
#if INCLUDE_VM_STRUCTS
  vmStructs_init();
#endif // INCLUDE_VM_STRUCTS

  vtableStubs_init();
  InlineCacheBuffer_init();
  compilerOracle_init();
  compilationPolicy_init();
  compileBroker_init();
  VMRegImpl::set_regName();

  if (!universe_post_init()) {
    return JNI_ERR;
  }
  javaClasses_init();   // must happen after vtable initialization
  stubRoutines_init2(); // note: StubRoutines need 2-phase init

  // All the flags that get adjusted by VM_Version_init and os::init_2
  // have been set so dump the flags now.
  if (PrintFlagsFinal) {
    CommandLineFlags::printFlags(tty, false);
  }

  return JNI_OK;
}
Ejemplo n.º 3
0
/*
 *	main program
 */
int	main( int argc, char *argv[])
{
	int	status;
	time_t	t;
/*
 *	print start of test time
 */
	time( &t);
	fprintf( stdout, "for ajb200 start time: %s", ctime( &t));
/*
 *	initialize or constructor, init
 */
	if(( status = universe_init()))
	{
		fprintf( stderr, "Error: init: %d\n", status);
		return status;
	}
/*
 *	process the command line args
 */
	while( --argc)
	       universe_process_flags( *++argv);
/*
 *	check if no files parsed
 */
	if( ! IS_FLAGS_PARSE( data.flags))
	{
/*
 *	so use stdin and call the parser
 */
		if(( status = yyparse()))
		{
			fprintf( stderr, "Error: yyparse %d\n", status);
		}
	}
/*
 *	deinitialize or destructor, exit
 */
	if(( status = universe_exit()))
	{
		fprintf( stderr, "Error: exit: %d\n", status);
	}
	return status;
}
Ejemplo n.º 4
0
/*
 * Tundra Universe configuration
 */
int do_universe(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
	ulong addr1 = 0, addr2 = 0, size = 0, vam = 0, pms = 0, vdw = 0;
	char cmd = 'x';

	/* get parameter */
	if (argc > 1)
		cmd = argv[1][0];
	if (argc > 2)
		addr1 = simple_strtoul(argv[2], NULL, 16);
	if (argc > 3)
		addr2 = simple_strtoul(argv[3], NULL, 16);
	if (argc > 4)
		size = simple_strtoul(argv[4], NULL, 16);
	if (argc > 5)
		vam = simple_strtoul(argv[5], NULL, 16);
	if (argc > 6)
		pms = simple_strtoul(argv[6], NULL, 16);
	if (argc > 7)
		vdw = simple_strtoul(argv[7], NULL, 16);

	switch (cmd) {
	case 'i':		/* init */
		universe_init();
		break;
	case 'v':		/* vme */
		printf("Configuring Universe VME Slave Window (VME->PCI):\n");
		printf("  vme=%08lx pci=%08lx size=%08lx vam=%02lx pms=%02lx\n",
		       addr1, addr2, size, vam, pms);
		universe_vme_slave_window(addr1, addr2, size, vam, pms);
		break;
	case 'p':		/* pci */
		printf("Configuring Universe PCI Slave Window (PCI->VME):\n");
		printf("  pci=%08lx vme=%08lx size=%08lx vam=%02lx pms=%02lx vdw=%02lx\n",
		       addr1, addr2, size, vam, pms, vdw);
		universe_pci_slave_window(addr1, addr2, size, vam, pms, vdw);
		break;
	default:
		printf("Universe command %s not supported!\n", argv[1]);
	}

	return 0;
}
Ejemplo n.º 5
0
jint init_globals() {
  HandleMark hm;
  management_init();
  bytecodes_init();
  classLoader_init1();
  compilationPolicy_init();
  codeCache_init();
  CodeCacheExtensions::initialize();
  VM_Version_init();
  CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::VMVersion);
  os_init_globals();
  stubRoutines_init1();
  CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::StubRoutines1);
  jint status = universe_init();  // dependent on codeCache_init and
                                  // stubRoutines_init1 and metaspace_init.
  if (status != JNI_OK)
    return status;

  CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::Universe);
  interpreter_init();  // before any methods loaded
  CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::Interpreter);
  invocationCounter_init();  // before any methods loaded
  marksweep_init();
  accessFlags_init();
  templateTable_init();
  InterfaceSupport_init();
  SharedRuntime::generate_stubs();
  universe2_init();  // dependent on codeCache_init and stubRoutines_init1
  referenceProcessor_init();
  jni_handles_init();
#if INCLUDE_VM_STRUCTS
  vmStructs_init();
#endif // INCLUDE_VM_STRUCTS

  vtableStubs_init();
  InlineCacheBuffer_init();
  compilerOracle_init();
  dependencyContext_init();

  if (!compileBroker_init()) {
    return JNI_EINVAL;
  }
  VMRegImpl::set_regName();

  if (!universe_post_init()) {
    return JNI_ERR;
  }
  javaClasses_init();   // must happen after vtable initialization
  stubRoutines_init2(); // note: StubRoutines need 2-phase init
  MethodHandles::generate_adapters();
  CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::StubRoutines2);

#if INCLUDE_NMT
  // Solaris stack is walkable only after stubRoutines are set up.
  // On Other platforms, the stack is always walkable.
  NMT_stack_walkable = true;
#endif // INCLUDE_NMT

  // All the flags that get adjusted by VM_Version_init and os::init_2
  // have been set so dump the flags now.
  if (PrintFlagsFinal || PrintFlagsRanges) {
    CommandLineFlags::printFlags(tty, false, PrintFlagsRanges);
  }

  CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::InitGlobals);
  return JNI_OK;
}
Ejemplo n.º 6
0
jint init_globals() {

  HandleMark hm;
  // 初始化各子系统的监控及管理服务
  // JMX、线程和同步子系统、类加载子系统的监控和管理
  management_init();
  // 初始化字节码表,如istore、iload、iadd
  bytecodes_init();
  // 类加载器初始化
  classLoader_init();
  // 代码缓存池初始化
  codeCache_init();
  // VM版本初始化
  VM_Version_init();
  // 系统初始化
  os_init_globals();
  stubRoutines_init1();
  // ============================
  // 初始化堆以及决定所使用GC策略
  // ============================
  jint status = universe_init();  // dependent on codeCache_init and
                                  // stubRoutines_init1
  if (status != JNI_OK)
    return status;
  // 初始化解析器
  interpreter_init();  // before any methods loaded
  // 初始化动作触发器
  invocationCounter_init();  // before any methods loaded
  // 初始化MarkSweep
  marksweep_init();
  // 初始化访问标识
  accessFlags_init();
  // 初始化操作码模板表
  templateTable_init();
  // 接口支持提供了VM_LEAF_BASE和VM_ENTRY_BASE宏
  InterfaceSupport_init();
  SharedRuntime::generate_stubs();
  // 初始化语法表及系统字典等
  universe2_init();  // dependent on codeCache_init and stubRoutines_init1
  // 初始化软引用时间戳表并设定软引用清除策略
  referenceProcessor_init();
  jni_handles_init();
  // 代码数据结构的必要性检查(仅限debug版本)
  vmStructs_init();
  vtableStubs_init();
  InlineCacheBuffer_init();
  // oracle编译器初始化(oracle编译器是一个编译器开关接口)
  compilerOracle_init();
  // 初始化编译策略(根据启动参数决定编译策略)
  compilationPolicy_init();
  compileBroker_init();
  VMRegImpl::set_regName();
  // 执行初始化
  if (!universe_post_init()) {
    return JNI_ERR;
  }
  // 计算各种filed的偏移量??
  javaClasses_init();   // must happen after vtable initialization
  stubRoutines_init2(); // note: StubRoutines need 2-phase init

  // All the flags that get adjusted by VM_Version_init and os::init_2
  // have been set so dump the flags now.
  if (PrintFlagsFinal) {
    CommandLineFlags::printFlags(tty, false);
  }

  return JNI_OK;
}