change reflect.CopyArray into a method on ArrayValue called CopyFrom

R=rsc
DELTA=16  (12 added, 0 deleted, 4 changed)
OCL=23242
CL=23242
diff --git a/src/lib/json/struct.go b/src/lib/json/struct.go
index 167fcbf..0d0c147 100644
--- a/src/lib/json/struct.go
+++ b/src/lib/json/struct.go
@@ -149,7 +149,7 @@
 					n *= 2
 				}
 				av1 := reflect.NewOpenArrayValue(av.Type(), av.Len(), n);
-				reflect.CopyArray(av1, av, av.Len());
+				av1.CopyFrom(av, av.Len());
 				pv.SetSub(av1);
 				av = av1;
 			}
diff --git a/src/lib/reflect/all_test.go b/src/lib/reflect/all_test.go
index 631a566..f991110 100644
--- a/src/lib/reflect/all_test.go
+++ b/src/lib/reflect/all_test.go
@@ -308,7 +308,7 @@
 		}
 	}
 	for tocopy := 1; tocopy <= 7; tocopy++ {
-		CopyArray(vb.(PtrValue).Sub(), va.(PtrValue).Sub(), tocopy);
+		vb.(PtrValue).Sub().(ArrayValue).CopyFrom(va.(PtrValue).Sub(), tocopy);
 		for i := 0; i < tocopy; i++ {
 			if a[i] != b[i] {
 				t.Errorf("1 tocopy=%d a[%d]=%d, b[%d]=%d",
diff --git a/src/lib/reflect/value.go b/src/lib/reflect/value.go
index f1651a2..6fd4fe2 100644
--- a/src/lib/reflect/value.go
+++ b/src/lib/reflect/value.go
@@ -553,8 +553,11 @@
 	Cap() int;
 	Elem(i int)	Value;
 	SetLen(len int);
+	CopyFrom(src ArrayValue, n int)
 }
 
+func copyArray(dst ArrayValue, src ArrayValue, n int);
+
 /*
 	Run-time representation of open arrays looks like this:
 		struct	Array {
@@ -600,6 +603,10 @@
 	return newValueAddr(v.elemtype, Addr(data_uint));
 }
 
+func (v *openArrayValueStruct) CopyFrom(src ArrayValue, n int) {
+	copyArray(v, src, n);
+}
+
 type fixedArrayValueStruct struct {
 	commonValue;
 	elemtype	Type;
@@ -628,6 +635,10 @@
 	return nil
 }
 
+func (v *fixedArrayValueStruct) CopyFrom(src ArrayValue, n int) {
+	copyArray(v, src, n);
+}
+
 func arrayCreator(typ Type, addr Addr) Value {
 	arraytype := typ.(ArrayType);
 	if arraytype.Open() {
@@ -843,7 +854,8 @@
 	return newValueAddr(typ, Addr(array));
 }
 
-func CopyArray(dst ArrayValue, src ArrayValue, n int) {
+// Works on both fixed and open arrays.
+func copyArray(dst ArrayValue, src ArrayValue, n int) {
 	if n == 0 {
 		return
 	}