Rename STA opcodes to be friendlier.
Rename STA opcodes to be friendlier.
1.1 --- a/jitcraft/BytecodeCompiler.cpp Wed Jun 27 02:28:39 2012 -0700
1.2 +++ b/jitcraft/BytecodeCompiler.cpp Wed Jun 27 20:44:27 2012 -0700
1.3 @@ -147,7 +147,7 @@
1.4 index->right()->accept(this);
1.5 __ bounds_sta();
1.6 node->expression()->accept(this);
1.7 - __ st_sta_i();
1.8 + __ setarray_i();
1.9 }
1.10 }
1.11
1.12 @@ -179,9 +179,9 @@
1.13 __ bounds_sta();
1.14
1.15 if (node->type()->isArray())
1.16 - __ ld_sta_p();
1.17 + __ getarray_p();
1.18 else
1.19 - __ ld_sta_i();
1.20 + __ getarray_i();
1.21 }
1.22
1.23 void
2.1 --- a/jitcraft/BytecodeEmitter.h Wed Jun 27 02:28:39 2012 -0700
2.2 +++ b/jitcraft/BytecodeEmitter.h Wed Jun 27 20:44:27 2012 -0700
2.3 @@ -257,14 +257,14 @@
2.4
2.5 stackDepth_ -= nargs;
2.6 }
2.7 - void ld_sta_i() {
2.8 - singleByteOp(OP_LD_STA_I);
2.9 + void getarray_i() {
2.10 + singleByteOp(OP_GETARRAY_I);
2.11 }
2.12 - void st_sta_i() {
2.13 - singleByteOp(OP_ST_STA_I);
2.14 + void setarray_i() {
2.15 + singleByteOp(OP_SETARRAY_I);
2.16 }
2.17 - void ld_sta_p() {
2.18 - singleByteOp(OP_LD_STA_P);
2.19 + void getarray_p() {
2.20 + singleByteOp(OP_GETARRAY_P);
2.21 }
2.22 void stackarray(Type *type);
2.23 void unwind(unsigned slot) {
3.1 --- a/jitcraft/Interpreter.cpp Wed Jun 27 02:28:39 2012 -0700
3.2 +++ b/jitcraft/Interpreter.cpp Wed Jun 27 20:44:27 2012 -0700
3.3 @@ -424,7 +424,7 @@
3.4 break;
3.5 }
3.6
3.7 -case OP_LD_STA_I:
3.8 +case OP_GETARRAY_I:
3.9 {
3.10 UnsafeArray *array = top.sp[-2].unsafeArray;
3.11 int index = top.sp[-1].i32;
3.12 @@ -433,7 +433,7 @@
3.13 break;
3.14 }
3.15
3.16 -case OP_ST_STA_I:
3.17 +case OP_SETARRAY_I:
3.18 {
3.19 UnsafeArray *array = top.sp[-3].unsafeArray;
3.20 int index = top.sp[-2].i32;
3.21 @@ -443,7 +443,7 @@
3.22 break;
3.23 }
3.24
3.25 -case OP_LD_STA_P:
3.26 +case OP_GETARRAY_P:
3.27 {
3.28 UnsafeArray *array = top.sp[-2].unsafeArray;
3.29 int index = top.sp[-1].i32;
4.1 --- a/jitcraft/Opcodes.cpp Wed Jun 27 02:28:39 2012 -0700
4.2 +++ b/jitcraft/Opcodes.cpp Wed Jun 27 20:44:27 2012 -0700
4.3 @@ -61,9 +61,9 @@
4.4 case OP_DIV_F:
4.5 case OP_CVT_I2F:
4.6 case OP_POP:
4.7 - case OP_LD_STA_I:
4.8 - case OP_LD_STA_P:
4.9 - case OP_ST_STA_I:
4.10 + case OP_GETARRAY_I:
4.11 + case OP_GETARRAY_P:
4.12 + case OP_SETARRAY_I:
4.13 case OP_BOUNDS_STA:
4.14 break;
4.15
5.1 --- a/jitcraft/Opcodes.tbl Wed Jun 27 02:28:39 2012 -0700
5.2 +++ b/jitcraft/Opcodes.tbl Wed Jun 27 20:44:27 2012 -0700
5.3 @@ -87,9 +87,9 @@
5.4 // ref = pop()
5.5 // ref[index]
5.6 //
5.7 -OPDEF(OP_LD_STA_I, 23, "ld.sta.i", 1, 2, 1)
5.8 -OPDEF(OP_ST_STA_I, 24, "st.sta.i", 1, 3, 1)
5.9 -OPDEF(OP_LD_STA_P, 25, "ld.sta.p", 1, 2, 1)
5.10 +OPDEF(OP_GETARRAY_I, 23, "getarray.i", 1, 2, 1)
5.11 +OPDEF(OP_SETARRAY_I, 24, "setarray.i", 1, 3, 1)
5.12 +OPDEF(OP_GETARRAY_P, 25, "getarray.p", 1, 2, 1)
5.13
5.14 // Allocate an array of N dimensions into unsafe memory. Each dimension size
5.15 // is encoded as an immediate. For the dynamic variant, they are popped off