| 1 | (******************************************************************************* |
|---|
| 2 | Copyright 2008 Sun Microsystems, Inc., |
|---|
| 3 | 4150 Network Circle, Santa Clara, California 95054, U.S.A. |
|---|
| 4 | All rights reserved. |
|---|
| 5 | |
|---|
| 6 | U.S. Government Rights - Commercial software. |
|---|
| 7 | Government users are subject to the Sun Microsystems, Inc. standard |
|---|
| 8 | license agreement and applicable provisions of the FAR and its supplements. |
|---|
| 9 | |
|---|
| 10 | Use is subject to license terms. |
|---|
| 11 | |
|---|
| 12 | This distribution may include materials developed by third parties. |
|---|
| 13 | |
|---|
| 14 | Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered |
|---|
| 15 | trademarks of Sun Microsystems, Inc. in the U.S. and other countries. |
|---|
| 16 | ******************************************************************************) |
|---|
| 17 | |
|---|
| 18 | native component NativeArray |
|---|
| 19 | export NativeArray |
|---|
| 20 | |
|---|
| 21 | private language="java" |
|---|
| 22 | private package="com.sun.fortress.interpreter.glue.prim" |
|---|
| 23 | |
|---|
| 24 | object PrimitiveArray[\T, nat s0\]() extends Array1[\T,0,s0\] |
|---|
| 25 | get(i:ZZ32):T = |
|---|
| 26 | builtinPrimitive("com.sun.fortress.interpreter.glue.prim.PrimitiveArray$get") |
|---|
| 27 | put(i:ZZ32, v:T):() = |
|---|
| 28 | builtinPrimitive("com.sun.fortress.interpreter.glue.prim.PrimitiveArray$put") |
|---|
| 29 | init00(i:ZZ32, v:T):Boolean = |
|---|
| 30 | builtinPrimitive("com.sun.fortress.interpreter.glue.prim.PrimitiveArray$init0") |
|---|
| 31 | (* We used to validate the result of init00, but that doesn't work if |
|---|
| 32 | the ith element was initialized as part of a failed transaction. *) |
|---|
| 33 | init0(i:ZZ32, v:T):() = do _ = init00(i,v); () end |
|---|
| 34 | end |
|---|
| 35 | |
|---|
| 36 | object PrimImmutableArray[\T, nat s0\]() extends ImmutableArray1[\T,0,s0\] |
|---|
| 37 | get(i:ZZ32):T = |
|---|
| 38 | builtinPrimitive("com.sun.fortress.interpreter.glue.prim.PrimImmutableArray$get") |
|---|
| 39 | init00(i:ZZ32, v:T):Boolean = |
|---|
| 40 | builtinPrimitive("com.sun.fortress.interpreter.glue.prim.PrimImmutableArray$init0") |
|---|
| 41 | (* We used to validate the result of init00, but that doesn't work if |
|---|
| 42 | the ith element was initialized as part of a failed transaction. *) |
|---|
| 43 | init0(i:ZZ32, v:T):() = do _ = init00(i,v); () end |
|---|
| 44 | end |
|---|
| 45 | |
|---|
| 46 | object PrimImmutableRR64Array[\nat s0\]() extends ImmutableArray1[\RR64,0,s0\] |
|---|
| 47 | get(i:ZZ32):RR64 = |
|---|
| 48 | builtinPrimitive("com.sun.fortress.interpreter.glue.prim.PrimImmutableRR64Array$get") |
|---|
| 49 | init00(i:ZZ32, v:RR64):Boolean = |
|---|
| 50 | builtinPrimitive("com.sun.fortress.interpreter.glue.prim.PrimImmutableRR64Array$init0") |
|---|
| 51 | (* We used to validate the result of init00, but that doesn't work if |
|---|
| 52 | the ith element was initialized as part of a failed transaction. *) |
|---|
| 53 | init0(i:ZZ32, v:RR64):() = do _ = init00(i,v); () end |
|---|
| 54 | end |
|---|
| 55 | |
|---|
| 56 | end |
|---|