1
0
mirror of https://github.com/golang/go synced 2024-11-19 02:14:43 -07:00
go/pointer
Alan Donovan 94c387c610 go.tools/pointer: implement (reflect.Value).Call.
The implementation follows the basic pattern of an indirect
function call (genDynamicCall).

We use the same trick as SetFinalizer so that direct calls to
(r.V).Call, which are overwhelmingly the norm, are inlined.

Bug fix (and simplification): calling untag() to unbox a
reflect.Value is wrong for reflect.Values containing interfaces
(rare).  Now, we call untag for concrete types and typeFilter
for interface types, and we can use this pattern in all cases.
It corresponds to the ssa.TypeAssert operator, so we call
it typeAssert.  Added tests to cover this.

We also specialize reflect.{In,Out} when the operand is an int
literal.

+ Tests.

Also:
- make taggedValue() panic, not return nil, eliminating many checks.
  We call isTaggedValue for the one place that cares.
- pointer_test: recover from panics in Analyze() and dump the log.

R=crawshaw
CC=golang-dev
https://golang.org/cl/14426050
2013-10-29 21:57:53 -04:00
..
testdata go.tools/pointer: implement (reflect.Value).Call. 2013-10-29 21:57:53 -04:00
analysis.go go.tools/pointer: more reflection. 2013-10-17 09:26:44 -04:00
api.go go.tools/pointer: implement (reflect.Value).Call. 2013-10-29 21:57:53 -04:00
callgraph.go go.tools/pointer: more reflection. 2013-10-17 09:26:44 -04:00
doc.go go.tools/pointer: implement (reflect.Value).Call. 2013-10-29 21:57:53 -04:00
example_test.go go.tools/importer: expose CreatePackage method. 2013-10-10 12:37:49 -04:00
gen.go go.tools/pointer: implement (reflect.Value).Call. 2013-10-29 21:57:53 -04:00
intrinsics.go go.tools/pointer: implement (reflect.Value).Call. 2013-10-29 21:57:53 -04:00
labels.go go.tools/pointer: fix panic in reflection. 2013-10-28 10:58:46 -04:00
pointer_test.go go.tools/pointer: implement (reflect.Value).Call. 2013-10-29 21:57:53 -04:00
print.go go.tools/pointer: use assignable not identical type predicate in reflect.{Send,SetMapIndex,etc} 2013-10-14 13:53:41 -04:00
reflect.go go.tools/pointer: implement (reflect.Value).Call. 2013-10-29 21:57:53 -04:00
solve.go go.tools/pointer: implement (reflect.Value).Call. 2013-10-29 21:57:53 -04:00
TODO go.tools/pointer: make os.Args point to something. 2013-10-01 09:46:33 -04:00
util.go go.tools/pointer: implement (reflect.Value).Call. 2013-10-29 21:57:53 -04:00