[llvm-commits] [vmkit] r51337 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaConstantPool.cpp JavaConstantPool.h
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Tue May 20 13:49:16 PDT 2008
Author: geoffray
Date: Tue May 20 15:49:16 2008
New Revision: 51337
URL: http://llvm.org/viewvc/llvm-project?rev=51337&view=rev
Log:
Inline simple functions.
Bugfix in IntegerAt, FloatAt, DoubleAt and UTF8At
Modified:
vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.cpp?rev=51337&r1=51336&r2=51337&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.cpp Tue May 20 15:49:16 2008
@@ -20,7 +20,6 @@
#include "JavaConstantPool.h"
#include "JavaJIT.h"
#include "Jnjvm.h"
-#include "JnjvmModule.h"
#include "JnjvmModuleProvider.h"
#include "JavaThread.h"
#include "JavaTypes.h"
@@ -225,21 +224,9 @@
}
}
-bool JavaCtpInfo::isAStaticCall(uint32 index) {
- return (ctpType[index] & 0x80) != 0;
-}
-
-void JavaCtpInfo::markAsStaticCall(uint32 index) {
- ctpType[index] |= 0x80;
-}
-
-uint8 JavaCtpInfo::typeAt(uint32 index) {
- return ctpType[index] & 0x7F;
-}
-
const UTF8* JavaCtpInfo::UTF8At(uint32 entry) {
- if (! (entry > 0) && (entry < ctpSize) &&
- typeAt(entry) == ConstantUTF8) {
+ if (! ((entry > 0) && (entry < ctpSize) &&
+ typeAt(entry) == ConstantUTF8)) {
JavaThread::get()->isolate->error(Jnjvm::ClassFormatError,
"bad constant pool number for utf8 at entry %d", entry);
}
@@ -247,8 +234,8 @@
}
float JavaCtpInfo::FloatAt(uint32 entry) {
- if (! (entry > 0) && (entry < ctpSize) &&
- typeAt(entry) == ConstantFloat) {
+ if (! ((entry > 0) && (entry < ctpSize) &&
+ typeAt(entry) == ConstantFloat)) {
JavaThread::get()->isolate->error(Jnjvm::ClassFormatError,
"bad constant pool number for float at entry %d", entry);
}
@@ -256,8 +243,8 @@
}
sint32 JavaCtpInfo::IntegerAt(uint32 entry) {
- if (! (entry > 0) && (entry < ctpSize) &&
- typeAt(entry) == ConstantInteger) {
+ if (! ((entry > 0) && (entry < ctpSize) &&
+ typeAt(entry) == ConstantInteger)) {
JavaThread::get()->isolate->error(Jnjvm::ClassFormatError,
"bad constant pool number for integer at entry %d", entry);
}
@@ -265,8 +252,8 @@
}
sint64 JavaCtpInfo::LongAt(uint32 entry) {
- if (! (entry > 0) && (entry < ctpSize) &&
- typeAt(entry) == ConstantLong) {
+ if (! ((entry > 0) && (entry < ctpSize) &&
+ typeAt(entry) == ConstantLong)) {
JavaThread::get()->isolate->error(Jnjvm::ClassFormatError,
"bad constant pool number for long at entry %d", entry);
}
@@ -274,8 +261,8 @@
}
double JavaCtpInfo::DoubleAt(uint32 entry) {
- if (! (entry > 0) && (entry < ctpSize) &&
- typeAt(entry) == ConstantDouble) {
+ if (! ((entry > 0) && (entry < ctpSize) &&
+ typeAt(entry) == ConstantDouble)) {
JavaThread::get()->isolate->error(Jnjvm::ClassFormatError,
"bad constant pool number for double at entry %d", entry);
}
@@ -283,8 +270,8 @@
}
CommonClass* JavaCtpInfo::isLoadedClassOrClassName(uint32 entry) {
- if (! (entry > 0) && (entry < ctpSize) &&
- typeAt(entry) == ConstantClass) {
+ if (! ((entry > 0) && (entry < ctpSize) &&
+ typeAt(entry) == ConstantClass)) {
JavaThread::get()->isolate->error(Jnjvm::ClassFormatError,
"bad constant pool number for class at entry %d", entry);
}
@@ -302,7 +289,7 @@
if (!temp) {
JavaObject* loader = classDef->classLoader;
const UTF8* name = UTF8At(ctpDef[index]);
- if (name->at(0) == AssessorDesc::I_TAB) {
+ if (name->elements[0] == AssessorDesc::I_TAB) {
// Don't put into ctpRes because the class can be isolate specific
temp = JavaThread::get()->isolate->constructArray(name, loader);
} else {
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h?rev=51337&r1=51336&r2=51337&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h Tue May 20 15:49:16 2008
@@ -89,10 +89,18 @@
static void read(Jnjvm *vm, Class* cl, Reader* reader);
- bool isAStaticCall(uint32 index);
- void markAsStaticCall(uint32 index);
+ bool isAStaticCall(uint32 index) {
+ return (ctpType[index] & 0x80) != 0;
+ }
+
+ void markAsStaticCall(uint32 index) {
+ ctpType[index] |= 0x80;
+ }
+
+ uint8 typeAt(uint32 index) {
+ return ctpType[index] & 0x7F;
+ }
- uint8 typeAt(uint32 index);
const UTF8* UTF8At(uint32 entry);
float FloatAt(uint32 entry);
sint32 IntegerAt(uint32 entry);
More information about the llvm-commits
mailing list