MCPcopy Create free account
hub / github.com/google/gapid / throw

Method throw

core/codegen/exceptions.go:46–57  ·  view source on GitHub ↗
(b *Builder, v *Value)

Source from the content-addressed store, hash-verified

44}
45
46func (e *exceptions) throw(b *Builder, v *Value) {
47 t := b.m.Types
48 voidPtr := t.Pointer(b.m.Types.Void)
49 ex := b.Call(e.allocFn, b.Scalar(v.Type().SizeInBits()/8).Cast(t.Size))
50 ex.Cast(t.Pointer(v.Type())).Store(v)
51 ty, ok := e.typeInfos[v.Type()]
52 if !ok {
53 fail("Unsuporrted exception type %v", v.Type())
54 }
55 destructor := b.Zero(voidPtr)
56 b.Call(e.throwFn, ex, ty.Value(b).Cast(voidPtr), destructor)
57}

Callers 1

ThrowMethod · 0.80

Calls 10

failFunction · 0.70
CallMethod · 0.65
SizeInBitsMethod · 0.65
TypeMethod · 0.65
StoreMethod · 0.65
PointerMethod · 0.45
CastMethod · 0.45
ScalarMethod · 0.45
ZeroMethod · 0.45
ValueMethod · 0.45

Tested by

no test coverage detected