⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 icode.c

📁 linux下建立JAVA虚拟机的源码KAFFE
💻 C
📖 第 1 页 / 共 5 页
字号:
#endifvoidstore_offset_double(SlotInfo* dst, jint offset, SlotInfo* src){	if (offset == 0) {		store_double(dst, src);	}	else#if defined(HAVE_store_offset_double)	if (HAVE_store_offset_double_rangecheck(offset)) {		slot_slot_const(src, dst, offset, HAVE_store_offset_double, Tstore);	}	else#endif	{		SlotInfo* tmp;		slot_alloctmp(tmp);		add_ref_const(tmp, dst, offset);		store_double(tmp, src);		slot_freetmp(tmp);	}}voidstore_addr_double(void* addr, SlotInfo* src){	SlotInfo* tmp;	slot_alloctmp(tmp);	move_ref_const(tmp, addr);	store_double(tmp, src);	slot_freetmp(tmp);}voidstore_byte(SlotInfo* dst, SlotInfo* src){#if defined(HAVE_store_byte)	slot_slot_slot(NULL, dst, src, HAVE_store_byte, Tstore);#else	/* FIXME -- this is unlikely to work as-is as it doesn't	   allow for alignment requirements on the integer load.  */	SlotInfo* tmp;	SlotInfo* tmp2;	slot_alloctmp(tmp);	slot_alloctmp(tmp2);	and_int_const(tmp, src, (1 << (8 * sizeof(jbyte))) - 1);	load_int(tmp2, dst);	and_int_const(tmp2, tmp2, -(1 << (8 * sizeof(jbyte))));	or_int(tmp2, tmp2, tmp);	store_int(dst, tmp2);	slot_freetmp(tmp2);	slot_freetmp(tmp);#endif}voidstore_offset_byte(SlotInfo* dst, jint offset, SlotInfo* src){	if (offset == 0) {		store_byte(dst, src);	}	else#if defined(HAVE_store_offset_byte)	if (HAVE_store_offset_byte_rangecheck(offset)) {		slot_slot_const(src, dst, offset, HAVE_store_offset_byte, Tstore);	}	else#endif	{		SlotInfo* tmp;		slot_alloctmp(tmp);		add_ref_const(tmp, dst, offset);		store_byte(tmp, src);		slot_freetmp(tmp);	}}voidstore_addr_byte(void* addr, SlotInfo* src){	SlotInfo* tmp;	slot_alloctmp(tmp);	move_ref_const(tmp, addr);	store_byte(tmp, src);	slot_freetmp(tmp);}voidstore_char(SlotInfo* dst, SlotInfo* src){#if defined(HAVE_store_char)	slot_slot_slot(NULL, dst, src, HAVE_store_char, Tstore);#else	/* FIXME -- this is unlikely to work as-is as it doesn't	   allow for alignment requirements on the integer load.  */	SlotInfo* tmp;	SlotInfo* tmp2;	slot_alloctmp(tmp);	slot_alloctmp(tmp2);	and_int_const(tmp, src, (1 << (8 * sizeof(jchar))) - 1);	load_int(tmp2, dst);	and_int_const(tmp2, tmp2, -(1 << (8 * sizeof(jchar))));	or_int(tmp2, tmp2, tmp);	store_int(dst, tmp2);	slot_freetmp(tmp2);	slot_freetmp(tmp);#endif}voidstore_offset_char(SlotInfo* dst, jint offset, SlotInfo* src){	if (offset == 0) {		store_char(dst, src);	}	else#if defined(HAVE_store_offset_char)	if (HAVE_store_offset_char_rangecheck(offset)) {		slot_slot_const(src, dst, offset, HAVE_store_offset_char, Tstore);	}	else#endif	{		SlotInfo* tmp;		slot_alloctmp(tmp);		add_ref_const(tmp, dst, offset);		store_char(tmp, src);		slot_freetmp(tmp);	}}voidstore_addr_char(void* addr, SlotInfo* src){	SlotInfo* tmp;	slot_alloctmp(tmp);	move_ref_const(tmp, addr);	store_char(tmp, src);	slot_freetmp(tmp);}voidstore_short(SlotInfo* dst, SlotInfo* src){#if defined(HAVE_store_short)	slot_slot_slot(NULL, dst, src, HAVE_store_short, Tstore);#else	/* FIXME -- this is unlikely to work as-is as it doesn't	   allow for alignment requirements on the integer load.  */	SlotInfo* tmp;	SlotInfo* tmp2;	slot_alloctmp(tmp);	slot_alloctmp(tmp2);	and_int_const(tmp, src, (1 << (8 * sizeof(jshort))) - 1);	load_int(tmp2, dst);	and_int_const(tmp2, tmp2, -(1 << (8 * sizeof(jshort))));	or_int(tmp2, tmp2, tmp);	store_int(dst, tmp2);	slot_freetmp(tmp2);	slot_freetmp(tmp);#endif}voidstore_offset_short(SlotInfo* dst, jint offset, SlotInfo* src){	if (offset == 0) {		store_short(dst, src);	}	else#if defined(HAVE_store_offset_short)	if (HAVE_store_offset_short_rangecheck(offset)) {		slot_slot_const(src, dst, offset, HAVE_store_offset_short, Tstore);	}	else#endif	{		SlotInfo* tmp;		slot_alloctmp(tmp);		add_ref_const(tmp, dst, offset);		store_short(tmp, src);		slot_freetmp(tmp);	}}voidstore_addr_short(void* addr, SlotInfo* src){	SlotInfo* tmp;	slot_alloctmp(tmp);	move_ref_const(tmp, addr);	store_short(tmp, src);	slot_freetmp(tmp);}voidstore_offset_scaled_int(SlotInfo* dst, SlotInfo* idx, int offset, SlotInfo* src){	SlotInfo* tmp;	slot_alloctmp(tmp);	lshl_int_const(tmp, idx, SHIFT_jint);	add_ref(tmp, dst, tmp);	store_offset_int(tmp, offset, src);	slot_freetmp(tmp);}voidstore_offset_scaled_ref(SlotInfo* dst, SlotInfo* idx, int offset, SlotInfo* src){	SlotInfo* tmp;	slot_alloctmp(tmp);	lshl_int_const(tmp, idx, SHIFT_jref);	add_ref(tmp, dst, tmp);	store_offset_ref(tmp, offset, src);	slot_freetmp(tmp);}voidstore_offset_scaled_long(SlotInfo* dst, SlotInfo* idx, int offset, SlotInfo* src){	SlotInfo* tmp;	slot_alloctmp(tmp);	lshl_int_const(tmp, idx, SHIFT_jlong);	add_ref(tmp, dst, tmp);	store_offset_long(tmp, offset, src);	slot_freetmp(tmp);}voidstore_offset_scaled_float(SlotInfo* dst, SlotInfo* idx, int offset, SlotInfo* src){	SlotInfo* tmp;	slot_alloctmp(tmp);	lshl_int_const(tmp, idx, SHIFT_jfloat);	add_ref(tmp, dst, tmp);	store_offset_float(tmp, offset, src);	slot_freetmp(tmp);}voidstore_offset_scaled_double(SlotInfo* dst, SlotInfo* idx, int offset, SlotInfo* src){	SlotInfo* tmp;	slot_alloctmp(tmp);	lshl_int_const(tmp, idx, SHIFT_jdouble);	add_ref(tmp, dst, tmp);	store_offset_double(tmp, offset, src);	slot_freetmp(tmp);}voidstore_offset_scaled_byte(SlotInfo* dst, SlotInfo* idx, int offset, SlotInfo* src){	SlotInfo* tmp;	slot_alloctmp(tmp);	add_ref(tmp, dst, idx);	store_offset_byte(tmp, offset, src);	slot_freetmp(tmp);}voidstore_offset_scaled_char(SlotInfo* dst, SlotInfo* idx, int offset, SlotInfo* src){	SlotInfo* tmp;	slot_alloctmp(tmp);	lshl_int_const(tmp, idx, SHIFT_jchar);	add_ref(tmp, dst, tmp);	store_offset_char(tmp, offset, src);	slot_freetmp(tmp);}voidstore_offset_scaled_short(SlotInfo* dst, SlotInfo* idx, int offset, SlotInfo* src){	SlotInfo* tmp;	slot_alloctmp(tmp);	lshl_int_const(tmp, idx, SHIFT_jshort);	add_ref(tmp, dst, tmp);	store_offset_short(tmp, offset, src);	slot_freetmp(tmp);}#if defined(HAVE_store_const_offset_int)voidstore_const_offset_int(SlotInfo* dst, jint offset, jint val){	if (HAVE_store_const_offset_int_rangecheck(offset)) {		slot_const_const(dst, offset, val, HAVE_store_const_offset_int, Tstore);	}	else	{		SlotInfo* tmp;		SlotInfo* tmp2;		slot_alloctmp(tmp);		slot_alloctmp(tmp2);		add_ref_const(tmp, dst, offset);		move_int_cosnt(tmp2, val);		store_int(tmp, tmp2);		slot_freetmp(tmp2);		slot_freetmp(tmp);	}}#endif#if defined(HAVE_store_const_offset_byte)voidstore_const_offset_byte(SlotInfo* dst, jint offset, jint val){	if (HAVE_store_const_offset_byte_rangecheck(offset)) {		slot_const_const(dst, offset, val, HAVE_store_const_offset_byte, Tstore);	}	else	{		SlotInfo* tmp;		SlotInfo* tmp2;		slot_alloctmp(tmp);		slot_alloctmp(tmp2);		add_ref_const(tmp, dst, offset);		move_int_cosnt(tmp2, val);		store_byte(tmp, tmp2);		slot_freetmp(tmp2);		slot_freetmp(tmp);	}}#endif/* ----------------------------------------------------------------------- *//* Function argument management.					   *//*									   */voidpusharg_int_const(jint val, int idx){#if defined(HAVE_pusharg_int_const)	if (HAVE_pusharg_int_const_rangecheck(val)) {		slot_const_const(NULL, val, idx, HAVE_pusharg_int_const, Tnull);		argcount += 1;	}	else#endif	{		SlotInfo* tmp;		slot_alloctmp(tmp);		move_int_const(tmp, val);		pusharg_int(tmp, idx);		slot_freetmp(tmp);	}}#if defined(HAVE_pusharg_int)voidpusharg_int(SlotInfo* src, int idx){	slot_slot_const(NULL, src, idx, HAVE_pusharg_int, Tnull);	argcount += 1;}#endif#if defined(HAVE_pusharg_ref)voidpusharg_ref(SlotInfo* src, int idx){	slot_slot_const(NULL, src, idx, HAVE_pusharg_ref, Tnull);	argcount += 1;}#endifvoidpusharg_ref_const(void* val, int idx){#if defined(HAVE_pusharg_ref_const)	if (HAVE_pusharg_ref_const_rangecheck((jword)val)) {		slot_const_const(NULL, (jword)val, idx, HAVE_pusharg_ref_const, Tnull);		argcount += 1;	}	else#endif	{		SlotInfo* tmp;		slot_alloctmp(tmp);		move_ref_const(tmp, val);		pusharg_ref(tmp, idx);		slot_freetmp(tmp);	}}voidpusharg_class_const(void* cls, int idx){#if 1	pusharg_ref_const(cls, idx);#else	???#endif}voidpusharg_utf8_const(void* val, int idx){#if 1	pusharg_ref_const(val, idx);#else	???#endif}#if defined(HAVE_pusharg_float)voidpusharg_float(SlotInfo* src, int idx){	slot_slot_const(NULL, src, idx, HAVE_pusharg_float, Tnull);	argcount += 1;}#endif#if defined(HAVE_pusharg_double)voidpusharg_double(SlotInfo* src, int idx){	lslot_lslot_const(NULL, src, idx, HAVE_pusharg_double, Tnull);	argcount += pusharg_long_idx_inc;}#endifvoidpusharg_long(SlotInfo* src, int idx){#if defined(HAVE_pusharg_long)	lslot_lslot_const(NULL, src, idx, HAVE_pusharg_long, Tnull);	argcount += pusharg_long_idx_inc;#else	/* Don't use LSLOT & HSLOT here */	pusharg_int(src+1, idx+1);	pusharg_int(src, idx);#endif}voidpopargs(void){ 	if (argcount != 0) {#if defined(HAVE_popargs)		slot_slot_const(NULL, NULL, argcount, HAVE_popargs, Tnull);#endif		if (argcount > maxPush) {			maxPush = argcount;		}		argcount = 0;	}}/* ----------------------------------------------------------------------- *//* Control flow changes.						   *//*									   */#if defined(HAVE_branch)voidbranch(label* dst, int type){	slot_const_const(NULL, (jword)dst, type, HAVE_branch, Tnull);}#endifvoidcbranch_int(SlotInfo* s1, SlotInfo* s2, label* dst, int type){#if defined(HAVE_cbranch_int)	slot_slot_slot_const_const(NULL, s1, s2, (jword)dst, type,				   HAVE_cbranch_int, Tcomplex);#else	cmp_int(NULL, s1, s2);	branch(dst, type);#endif}voidcbranch_int_const(SlotInfo* s1, jint val, label* dst, int type){#if defined(HAVE_cbranch_int_const)	if (HAVE_cbranch_int_const_rangecheck(val)) {		slot_slot_const_const_const(NULL, s1, val, (jword)dst, type,					    HAVE_cbranch_int_const, Tcomplex);	}	else	{		SlotInfo* tmp;		slot_alloctmp(tmp);		move_int_const(tmp, val);		cbranch_int(s1, tmp, dst, type);		slot_freetmp(tmp);	}#else	cmp_int_const(NULL, s1, val);	branch(dst, type);#endif}voidcbranch_ref(SlotInfo* s1, SlotInfo* s2, label* dst, int type){#if defined(HAVE_cbranch_ref)	slot_slot_slot_const_const(NULL, s1, s2, (jword)dst, type,				   HAVE_cbranch_ref, Tcomplex);#else	cmp_ref(NULL, s1, s2);	branch(dst, type);#endif}voidcbranch_ref_const(SlotInfo* s1, void *val, label* dst, int type){#if defined(HAVE_cbranch_ref_const)	if (HAVE_cbranch_ref_const_rangecheck((jword)val)) {		slot_slot_const_const_const(NULL, s1, (jword)val, (jword)dst, type,					    HAVE_cbranch_ref_const, Tcomplex);	}	else	{		SlotInfo* tmp;		slot_alloctmp(tmp);		move_ref_const(tmp, val);		cbranch_ref(s1, tmp, dst, type);		slot_freetmp(tmp);	}#else	cmp_ref_const(NULL, s1, val);	branch(dst, type);#endif}voidbranch_indirect(SlotInfo* dst){#if defined(HAVE_branch_indirect)	slot_slot_const(NULL, dst, ba, HAVE_branch_indirect, Tnull);#else	load_ref(dst, dst);	call(dst);#endif}#if defined(HAVE_call)voidcall(SlotInfo* dst){	slot_slot_const(NULL, dst, ba, HAVE_call, Tnull);}#endifvoidcall_indirect_method(Method *meth){	void* ptr;	ptr = PMETHOD_NATIVECODE(meth);#if defined(HAVE_call_indirect_const)	slot_const_const(NULL, (jword)ptr, ba, HAVE_call_indirect_const, Tnull);#else	{		SlotInfo *tmp;		slot_alloctmp(tmp);		move_ref_const(tmp, ptr);		load_ref(tmp, tmp);		call(tmp);		slot_freetmp(tmp);	}#endif}voidcall_soft(void *routine){#if defined(HAVE_call_soft)	label* l = KaffeJIT_newLabel();	l->type = Labsolute|Lexternal|Lnoprofile;	l->at = 0;	l->to = (uintp)routine;	/* What place does it goto */	l->from = 0;	slot_const_const(0, (jword)l, ba, HAVE_call_soft, Tnull);#elif defined(HAVE_call_ref)	label* l;	l = KaffeJIT_newLabel();	l->type = Lexternal|Lnoprofile;	l->at = 0;	l->to = (uintp)routine;	/* What place does it goto */	l->from = 0;	slot_const_const(NULL, (jword)l, ba, HAVE_call_ref, Tnull);#else	label* l;	constpool* c;	SlotInfo* tmp;	l = KaffeJIT_newLabel();	c = KaffeJIT_newConstant(CPref, routine);	l->type = Lconstant;	l->at = 0;	l->to = (uintp)c;	l->from = 0;	slot_alloctmp(tmp);	move_label_const(tmp, l);	load_ref(tmp, tmp);	call(tmp);	slot_freetmp(tmp);#endif}#if defined(HAVE_return_int)voidreturn_int(SlotInfo* dst){	slot_slot_slot(dst, NULL, NULL, HAVE_return_int, Tnull);}#endif#if defined(HAVE_return_ref)voidreturn_ref(SlotInfo* dst){	slot_slot_slot(dst, NULL, NULL, HAVE_return_ref, Tnull);}#endif#if defined(HAVE_return_long)voidreturn_long(SlotInfo* dst){	lslot_lslot_lslot(dst, NULL, NULL, HAVE_return_long, Tnull);}#endif#if defined(HAVE_return_float)voidreturn_float(SlotInfo* dst){	slot_slot_slot(dst, NULL, NULL, HAVE_return_float, Tnull);}#endif#if defined(HAVE_return_double)voidreturn_double(SlotInfo* dst){	lslot_lslot_lslot(dst, NULL, NULL, HAVE_return_double, Tnull);}#endif#if defined(HAVE_returnarg_int)voidreturnarg_int(SlotInfo* src){	slot_slot_slot(NULL, NULL, src, HAVE_returnarg_int, Tcopy);}#endif#if defined(HAVE_returnarg_ref)voidreturnarg_ref(SlotInfo* src){	slot_slot_slot(NULL, NULL, src, HAVE_returnarg_ref, Tcopy);}#endif#if defined(HAVE_returnarg_long)voidreturnarg_long(SlotInfo* src){	lslot_lslot_lslot(NULL, NULL, src, HAVE_returnarg_long, Tcopy);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -