Rename Type::isInt to Type::isInt32.
Rename Type::isInt to Type::isInt32.
1.1 --- a/jitcraft/Array.cpp Sun Jul 01 00:07:40 2012 -0700
1.2 +++ b/jitcraft/Array.cpp Sun Jul 01 11:25:36 2012 -0700
1.3 @@ -41,7 +41,7 @@
1.4 {
1.5 if (type->levels() > 1)
1.6 return sizeof(Array) + elements * sizeof(jc::Object *);
1.7 - if (type->contained()->isInt())
1.8 + if (type->contained()->isInt32())
1.9 return sizeof(Array) + elements * sizeof(int);
1.10 assert(type->contained()->isFloat());
1.11 return sizeof(Array) + elements * sizeof(float);
2.1 --- a/jitcraft/Array.h Sun Jul 01 00:07:40 2012 -0700
2.2 +++ b/jitcraft/Array.h Sun Jul 01 11:25:36 2012 -0700
2.3 @@ -105,7 +105,7 @@
2.4 Array::int32Vec()
2.5 {
2.6 assert(ArrayMap::cast(map())->type()->levels() == 1);
2.7 - assert(ArrayMap::cast(map())->type()->contained()->isInt());
2.8 + assert(ArrayMap::cast(map())->type()->contained()->isInt32());
2.9 return reinterpret_cast<int *>(vec());
2.10 }
2.11
3.1 --- a/jitcraft/BytecodeCompiler.cpp Sun Jul 01 00:07:40 2012 -0700
3.2 +++ b/jitcraft/BytecodeCompiler.cpp Sun Jul 01 11:25:36 2012 -0700
3.3 @@ -144,7 +144,7 @@
3.4 if (var->type()->contained()->isFloat()) {
3.5 __ getref_f();
3.6 } else {
3.7 - assert(var->type()->contained()->isInt());
3.8 + assert(var->type()->contained()->isInt32());
3.9 __ getref_i();
3.10 }
3.11 }
3.12 @@ -187,7 +187,7 @@
3.13 if (var->type()->contained()->isFloat()) {
3.14 __ setref_f();
3.15 } else {
3.16 - assert(var->type()->contained()->isInt());
3.17 + assert(var->type()->contained()->isInt32());
3.18 __ setref_i();
3.19 }
3.20 } else {
3.21 @@ -203,7 +203,7 @@
3.22 if (index->left()->type()->contained()->isFloat()) {
3.23 __ setarray_f();
3.24 } else {
3.25 - assert(index->left()->type()->contained()->isInt());
3.26 + assert(index->left()->type()->contained()->isInt32());
3.27 __ setarray_i();
3.28 }
3.29 }
3.30 @@ -242,7 +242,7 @@
3.31 __ getarray_f();
3.32 } else {
3.33 __ getarray_i();
3.34 - assert(node->type()->isInt());
3.35 + assert(node->type()->isInt32());
3.36 }
3.37 }
3.38
4.1 --- a/jitcraft/SemanticAnalysis.cpp Sun Jul 01 00:07:40 2012 -0700
4.2 +++ b/jitcraft/SemanticAnalysis.cpp Sun Jul 01 11:25:36 2012 -0700
4.3 @@ -190,15 +190,15 @@
4.4
4.5 // If either side is a float, the other side must be a float or int.
4.6 if (left->isFloat() || right->isFloat()) {
4.7 - assert(left->isFloat() || left->isInt());
4.8 - assert(right->isFloat() || right->isInt());
4.9 + assert(left->isFloat() || left->isInt32());
4.10 + assert(right->isFloat() || right->isInt32());
4.11 node->setType(left->isFloat() ? left : right);
4.12 return;
4.13 }
4.14 }
4.15
4.16 // For now, assert everything else is integer and untagged.
4.17 - assert(left->isInt() && right->isInt());
4.18 + assert(left->isInt32() && right->isInt32());
4.19 assert(!left->tag() && !right->tag());
4.20 node->setType(left);
4.21 }
4.22 @@ -436,7 +436,7 @@
4.23 Type *left = visitForRef(node->left());
4.24 Type *right = visitForLoad(node->right());
4.25
4.26 - if (!right || !right->isInt()) {
4.27 + if (!right || !right->isInt32()) {
4.28 typeError(node->right(), "integer");
4.29 return;
4.30 }
5.1 --- a/jitcraft/TypeManager.cpp Sun Jul 01 00:07:40 2012 -0700
5.2 +++ b/jitcraft/TypeManager.cpp Sun Jul 01 11:25:36 2012 -0700
5.3 @@ -66,7 +66,7 @@
5.4 Type *
5.5 TypeManager::getReference(Type *type)
5.6 {
5.7 - if (type->isFloat() || (type->isInt() && !type->tag()))
5.8 + if (type->isFloat() || (type->isInt32() && !type->tag()))
5.9 return referenceTypes_[type->primitive()];
5.10
5.11 // :TODO: cache this.
6.1 --- a/jitcraft/Types.h Sun Jul 01 00:07:40 2012 -0700
6.2 +++ b/jitcraft/Types.h Sun Jul 01 11:25:36 2012 -0700
6.3 @@ -27,6 +27,7 @@
6.4
6.5 enum PrimitiveType
6.6 {
6.7 + PrimitiveType_Int8, // signed, 8-bit character
6.8 PrimitiveType_Int32, // signed, 32-bit integer
6.9 PrimitiveType_Float, // 32-bit IEEE-754 float
6.10 PrimitiveType_Native, // native-sized word
6.11 @@ -39,7 +40,8 @@
6.12 PRIMITIVE,
6.13 ARRAY,
6.14 REFERENCE,
6.15 - FUNCTION
6.16 + FUNCTION,
6.17 + CHAR
6.18 };
6.19
6.20 private:
6.21 @@ -105,7 +107,7 @@
6.22 bool isFloat() {
6.23 return isPrimitive() && primitive() == PrimitiveType_Float;
6.24 }
6.25 - bool isInt() {
6.26 + bool isInt32() {
6.27 return isPrimitive() && primitive() == PrimitiveType_Int32;
6.28 }
6.29 Type *returnType() {