示例#1
0
void
runtime·assertI2I2(InterfaceType* inter, Iface i, Iface ret, bool ok)
{
	ret.tab = 0;
	ret.data = 0;
	FLUSH(&ret);
	ok = 0;
	FLUSH(&ok);
#line 400 "/tmp/makerelease197226928/go/src/pkg/runtime/iface.goc"

	Itab *tab;

	tab = i.tab;
	if(tab != nil && (tab->inter == inter || (tab = itab(inter, tab->type, 1)) != nil)) {
		ret.data = i.data;
		ret.tab = tab;
		ok = 1;
	} else {
		ret.data = 0;
		ret.tab = 0;
		ok = 0;
	}
	FLUSH(&ret);
	FLUSH(&ok);
}
示例#2
0
void
runtime·assertI2I2(InterfaceType* inter, Iface i, Iface ret, bool ok)
{
	ret.tab = 0;
	ret.data = 0;
	FLUSH(&ret);
	ok = 0;
	FLUSH(&ok);
#line 385 "/home/14/ren/source/golang/go/src/pkg/runtime/iface.goc"

	Itab *tab;

	tab = i.tab;
	if(tab != nil && (tab->inter == inter || (tab = itab(inter, tab->type, 1)) != nil)) {
		ret.data = i.data;
		ret.tab = tab;
		ok = 1;
	} else {
		ret.data = 0;
		ret.tab = 0;
		ok = 0;
	}
	FLUSH(&ret);
	FLUSH(&ok);
}
示例#3
0
bool 
runtime·ifaceE2I2 ( InterfaceType *inter , Eface e , Iface *ret ) 
{ 
ret->tab = itab ( inter , e.type , 1 ) ; 
if ( ret->tab == nil ) 
return false; 
ret->data = e.data; 
return true; 
} 
示例#4
0
void
runtime·typ2Itab(Type* t, InterfaceType* inter, Itab** cache, Itab* tab)
{
#line 172 "/home/pi/go_build/hg/go/src/pkg/runtime/iface.goc"

	tab = itab(inter, t, 0);
	runtime·atomicstorep(cache, tab);
	FLUSH(&tab);
}
示例#5
0
文件: iface.c 项目: 29decibel/golang
void
runtime·typ2Itab(Type *t, InterfaceType *inter, Itab **cache, Itab *ret)
{
	Itab *tab;

	tab = itab(inter, t, 0);
	runtime·atomicstorep(cache, tab);
	ret = tab;
	FLUSH(&ret);
}
示例#6
0
void
runtime·typ2Itab(Type* t, InterfaceType* inter, Itab** cache, Itab* tab)
{
	tab = 0;
	FLUSH(&tab);
#line 186 "/home/14/ren/source/golang/go/src/pkg/runtime/iface.goc"

	tab = itab(inter, t, 0);
	runtime·atomicstorep(cache, tab);
	FLUSH(&tab);
}
示例#7
0
void
runtime·typ2Itab(Type* t, InterfaceType* inter, Itab** cache, Itab* tab)
{
	tab = 0;
	FLUSH(&tab);
#line 186 "/tmp/makerelease197226928/go/src/pkg/runtime/iface.goc"

	tab = itab(inter, t, 0);
	runtime·atomicstorep(cache, tab);
	FLUSH(&tab);
}
示例#8
0
文件: iface.c 项目: 29decibel/golang
// func convI2I(typ *byte, elem any) (ret any)
void
runtime·convI2I(InterfaceType* inter, Iface i, Iface ret)
{
	Itab *tab;

	ret.data = i.data;
	if((tab = i.tab) == nil)
		ret.tab = nil;
	else if(tab->inter == inter)
		ret.tab = tab;
	else
		ret.tab = itab(inter, tab->type, 0);
	FLUSH(&ret);
}
示例#9
0
void
runtime·convI2I(InterfaceType* inter, Iface i, Iface ret)
{
#line 337 "/home/pi/go_build/hg/go/src/pkg/runtime/iface.goc"

	Itab *tab;

	ret.data = i.data;
	if((tab = i.tab) == nil)
		ret.tab = nil;
	else if(tab->inter == inter)
		ret.tab = tab;
	else
		ret.tab = itab(inter, tab->type, 0);
	FLUSH(&ret);
}
示例#10
0
void
runtime·convT2I(Type* t, InterfaceType* inter, Itab** cache, byte* elem, Iface ret)
{
#line 178 "/home/pi/go_build/hg/go/src/pkg/runtime/iface.goc"

	Itab *tab;

	tab = runtime·atomicloadp(cache);
	if(!tab) {
		tab = itab(inter, t, 0);
		runtime·atomicstorep(cache, tab);
	}
	ret.tab = tab;
	copyin(t, elem, &ret.data);
	FLUSH(&ret);
}
示例#11
0
void 
runtime·ifaceE2I ( InterfaceType *inter , Eface e , Iface *ret ) 
{ 
Type *t; 
Eface err; 
#line 392 "/home/pi/go_build/hg/go/src/pkg/runtime/iface.goc"
t = e.type; 
if ( t == nil ) { 
#line 395 "/home/pi/go_build/hg/go/src/pkg/runtime/iface.goc"
runtime·newTypeAssertionError ( 
nil , nil , inter->string , 
nil , &err ) ; 
runtime·panic ( err ) ; 
} 
ret->data = e.data; 
ret->tab = itab ( inter , t , 0 ) ; 
} 
示例#12
0
文件: iface.c 项目: 29decibel/golang
// ifaceE2I2(sigi *byte, iface any) (ret any, ok bool)
void
runtime·assertE2I2(InterfaceType *inter, Eface e, Iface ret, bool ok)
{
	if(e.type == nil) {
		ok = 0;
		ret.data = nil;
		ret.tab = nil;
	} else if((ret.tab = itab(inter, e.type, 1)) == nil) {
		ok = 0;
		ret.data = nil;
	} else {
		ok = 1;
		ret.data = e.data;
	}
	FLUSH(&ret);
	FLUSH(&ok);
}
示例#13
0
void 
runtime·ifaceI2I ( InterfaceType *inter , Iface i , Iface *ret ) 
{ 
Itab *tab; 
Eface err; 
#line 384 "/tmp/makerelease197226928/go/src/pkg/runtime/iface.goc"
tab = i.tab; 
if ( tab == nil ) { 
#line 387 "/tmp/makerelease197226928/go/src/pkg/runtime/iface.goc"
runtime·newTypeAssertionError ( 
nil , nil , inter->string , 
nil , &err ) ; 
runtime·panic ( err ) ; 
} 
ret->data = i.data; 
ret->tab = itab ( inter , tab->type , 0 ) ; 
} 
示例#14
0
void 
runtime·ifaceE2I ( InterfaceType *inter , Eface e , Iface *ret ) 
{ 
Type *t; 
Eface err; 
#line 421 "/tmp/makerelease197226928/go/src/pkg/runtime/iface.goc"
t = e.type; 
if ( t == nil ) { 
#line 424 "/tmp/makerelease197226928/go/src/pkg/runtime/iface.goc"
runtime·newTypeAssertionError ( 
nil , nil , inter->string , 
nil , &err ) ; 
runtime·panic ( err ) ; 
} 
ret->data = e.data; 
ret->tab = itab ( inter , t , 0 ) ; 
} 
示例#15
0
文件: iface.c 项目: 29decibel/golang
void
runtime·ifaceE2I(InterfaceType *inter, Eface e, Iface *ret)
{
	Type *t;
	Eface err;

	t = e.type;
	if(t == nil) {
		// explicit conversions require non-nil interface value.
		runtime·newTypeAssertionError(
			nil, nil, inter->string,
			nil, &err);
		runtime·panic(err);
	}
	ret->data = e.data;
	ret->tab = itab(inter, t, 0);
}
示例#16
0
文件: iface.c 项目: 29decibel/golang
void
runtime·ifaceI2I(InterfaceType *inter, Iface i, Iface *ret)
{
	Itab *tab;
	Eface err;

	tab = i.tab;
	if(tab == nil) {
		// explicit conversions require non-nil interface value.
		runtime·newTypeAssertionError(
			nil, nil, inter->string,
			nil, &err);
		runtime·panic(err);
	}
	ret->data = i.data;
	ret->tab = itab(inter, tab->type, 0);
}
示例#17
0
void 
runtime·ifaceI2I ( InterfaceType *inter , Iface i , Iface *ret ) 
{ 
Itab *tab; 
Eface err; 
#line 355 "/home/pi/go_build/hg/go/src/pkg/runtime/iface.goc"
tab = i.tab; 
if ( tab == nil ) { 
#line 358 "/home/pi/go_build/hg/go/src/pkg/runtime/iface.goc"
runtime·newTypeAssertionError ( 
nil , nil , inter->string , 
nil , &err ) ; 
runtime·panic ( err ) ; 
} 
ret->data = i.data; 
ret->tab = itab ( inter , tab->type , 0 ) ; 
} 
示例#18
0
void 
runtime·ifaceE2I ( InterfaceType *inter , Eface e , Iface *ret ) 
{ 
Type *t; 
Eface err; 
#line 406 "/home/14/ren/source/golang/go/src/pkg/runtime/iface.goc"
t = e.type; 
if ( t == nil ) { 
#line 409 "/home/14/ren/source/golang/go/src/pkg/runtime/iface.goc"
runtime·newTypeAssertionError ( 
nil , nil , inter->string , 
nil , &err ) ; 
runtime·panic ( err ) ; 
} 
ret->data = e.data; 
ret->tab = itab ( inter , t , 0 ) ; 
} 
示例#19
0
文件: iface.c 项目: 29decibel/golang
// func ifaceI2I2(sigi *byte, iface any) (ret any, ok bool)
void
runtime·assertI2I2(InterfaceType *inter, Iface i, Iface ret, bool ok)
{
	Itab *tab;

	tab = i.tab;
	if(tab != nil && (tab->inter == inter || (tab = itab(inter, tab->type, 1)) != nil)) {
		ret.data = i.data;
		ret.tab = tab;
		ok = 1;
	} else {
		ret.data = 0;
		ret.tab = 0;
		ok = 0;
	}
	FLUSH(&ret);
	FLUSH(&ok);
}
示例#20
0
void
runtime·convI2I(InterfaceType* inter, Iface i, Iface ret)
{
	ret.tab = 0;
	ret.data = 0;
	FLUSH(&ret);
#line 366 "/tmp/makerelease197226928/go/src/pkg/runtime/iface.goc"

	Itab *tab;

	ret.data = i.data;
	if((tab = i.tab) == nil)
		ret.tab = nil;
	else if(tab->inter == inter)
		ret.tab = tab;
	else
		ret.tab = itab(inter, tab->type, 0);
	FLUSH(&ret);
}
示例#21
0
void
runtime·convT2I(Type* t, InterfaceType* inter, Itab** cache, byte* elem, Iface ret)
{
	ret.tab = 0;
	ret.data = 0;
	FLUSH(&ret);
#line 192 "/home/14/ren/source/golang/go/src/pkg/runtime/iface.goc"

	Itab *tab;

	tab = runtime·atomicloadp(cache);
	if(!tab) {
		tab = itab(inter, t, 0);
		runtime·atomicstorep(cache, tab);
	}
	ret.tab = tab;
	copyin(t, elem, &ret.data);
	FLUSH(&ret);
}
示例#22
0
void
runtime·convI2I(InterfaceType* inter, Iface i, Iface ret)
{
	ret.tab = 0;
	ret.data = 0;
	FLUSH(&ret);
#line 351 "/home/14/ren/source/golang/go/src/pkg/runtime/iface.goc"

	Itab *tab;

	ret.data = i.data;
	if((tab = i.tab) == nil)
		ret.tab = nil;
	else if(tab->inter == inter)
		ret.tab = tab;
	else
		ret.tab = itab(inter, tab->type, 0);
	FLUSH(&ret);
}
示例#23
0
void
runtime·assertE2I2(InterfaceType* inter, Eface e, Iface ret, bool ok)
{
#line 422 "/home/pi/go_build/hg/go/src/pkg/runtime/iface.goc"

	if(e.type == nil) {
		ok = 0;
		ret.data = nil;
		ret.tab = nil;
	} else if((ret.tab = itab(inter, e.type, 1)) == nil) {
		ok = 0;
		ret.data = nil;
	} else {
		ok = 1;
		ret.data = e.data;
	}
	FLUSH(&ret);
	FLUSH(&ok);
}
示例#24
0
文件: iface.c 项目: 29decibel/golang
void
runtime·convT2I(Type *t, InterfaceType *inter, Itab **cache, ...)
{
	byte *elem;
	Iface *ret;
	Itab *tab;
	int32 wid;

	elem = (byte*)(&cache+1);
	wid = t->size;
	ret = (Iface*)(elem + ROUND(wid, Structrnd));
	tab = runtime·atomicloadp(cache);
	if(!tab) {
		tab = itab(inter, t, 0);
		runtime·atomicstorep(cache, tab);
	}
	ret->tab = tab;
	copyin(t, elem, &ret->data);
}
示例#25
0
void
runtime·assertE2I2(InterfaceType* inter, Eface e, Iface ret, bool ok)
{
	ret.tab = 0;
	ret.data = 0;
	FLUSH(&ret);
	ok = 0;
	FLUSH(&ok);
#line 451 "/tmp/makerelease197226928/go/src/pkg/runtime/iface.goc"

	if(e.type == nil) {
		ok = 0;
		ret.data = nil;
		ret.tab = nil;
	} else if((ret.tab = itab(inter, e.type, 1)) == nil) {
		ok = 0;
		ret.data = nil;
	} else {
		ok = 1;
		ret.data = e.data;
	}
	FLUSH(&ret);
	FLUSH(&ok);
}
示例#26
0
void
runtime·assertE2I2(InterfaceType* inter, Eface e, Iface ret, bool ok)
{
	ret.tab = 0;
	ret.data = 0;
	FLUSH(&ret);
	ok = 0;
	FLUSH(&ok);
#line 436 "/home/14/ren/source/golang/go/src/pkg/runtime/iface.goc"

	if(e.type == nil) {
		ok = 0;
		ret.data = nil;
		ret.tab = nil;
	} else if((ret.tab = itab(inter, e.type, 1)) == nil) {
		ok = 0;
		ret.data = nil;
	} else {
		ok = 1;
		ret.data = e.data;
	}
	FLUSH(&ret);
	FLUSH(&ok);
}