[llvm-commits] CVS: llvm-java/lib/Compiler/VMClass.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Tue May 10 19:29:30 PDT 2005
Changes in directory llvm-java/lib/Compiler:
VMClass.cpp updated: 1.46 -> 1.47
---
Log message:
Reverse the array of superclasses in the type information block. This
makes instanceof a bit faster since we don't need to subtract the two
depths to check if a class is a subclass of another.
This was pointed out by Dinakar at the presentation today. Thanks Dinakar :-)
---
Diffs of the changes: (+1 -1)
VMClass.cpp | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm-java/lib/Compiler/VMClass.cpp
diff -u llvm-java/lib/Compiler/VMClass.cpp:1.46 llvm-java/lib/Compiler/VMClass.cpp:1.47
--- llvm-java/lib/Compiler/VMClass.cpp:1.46 Fri Apr 22 19:12:14 2005
+++ llvm-java/lib/Compiler/VMClass.cpp Tue May 10 21:28:59 2005
@@ -191,7 +191,7 @@
{
std::vector<llvm::Constant*> init;
init.reserve(getNumSuperClasses());
- for (unsigned i = 0, e = getNumSuperClasses(); i != e; ++i)
+ for (unsigned i = getNumSuperClasses(); i--; )
init.push_back(ConstantExpr::getCast(
getSuperClass(i)->getClassRecord(),
resolver_->getClassRecordPtrType()));
More information about the llvm-commits
mailing list