Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/WordValueAttribute.java13
2 files changed, 10 insertions, 19 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java
index 2bb2ddf11..fdd41d732 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java
@@ -72,6 +72,7 @@ public class MethodInfo extends ClassFileStruct implements IBinaryMethod, Compar
protected long version;
//{ObjectTeams: method level attributes:
+ private static final long HAVE_OT_MODIFIERS = 1l << 32;
/* After reading a method its attributes are stored here. */
private LinkedList<AbstractAttribute> methodAttributes = new LinkedList<AbstractAttribute>();
// more bits decoded from attributes:
@@ -508,7 +509,7 @@ private synchronized void readExceptionAttributes() {
private synchronized void readModifierRelatedAttributes() {
int flags = u2At(0);
//{ObjectTeams:
- int otFlags = 0;
+ long otFlags = 0;
// SH}
int attributesCount = u2At(6);
int readOffset = 8;
@@ -544,10 +545,10 @@ private synchronized void readModifierRelatedAttributes() {
}
//{ObjectTeams: combine sets of modifiers
if (otFlags != 0) {
- if ((otFlags & ExtraCompilerModifiers.AccVisibilityMASK) != 0) {
+ if ((otFlags & HAVE_OT_MODIFIERS) != 0) {
flags &= ~ExtraCompilerModifiers.AccVisibilityMASK; // replace those bits
}
- flags |= otFlags;
+ flags |= (otFlags & 0xffffffff);
}
// SH}
this.accessFlags = flags;
@@ -562,7 +563,7 @@ private synchronized void readModifierRelatedAttributes() {
* @param aStructOffset (subtract when indexing via constantPoolOffsets)
* @param someConstantPoolOffsets
*/
- int readOTAttribute(
+ long readOTAttribute(
char[] attributeName,
MethodInfo info,
int readOffset,
@@ -573,12 +574,12 @@ private synchronized void readModifierRelatedAttributes() {
return 0; // optimization only.
if (CharOperation.equals(attributeName, MODIFIERS_NAME))
{
- return WordValueAttribute.readModifiers(info, readOffset);
+ return readOTModifiers(info, readOffset);
// not added to _readAttributes because evaluated immediately.
}
else if (CharOperation.equals(attributeName, ROLECLASS_METHOD_MODIFIERS_NAME))
{
- return WordValueAttribute.readModifiers(info, readOffset);
+ return readOTModifiers(info, readOffset);
// not added to _readAttributes because evaluated immediately.
}
else if (CharOperation.equals(attributeName, CALLS_BASE_CTOR))
@@ -602,6 +603,9 @@ private synchronized void readModifierRelatedAttributes() {
return 0;
}
+ long readOTModifiers(MethodInfo info, int readOffset) {
+ return info.u2At(readOffset) | HAVE_OT_MODIFIERS;
+ }
// SH}
/**
* Answer the size of the receiver in bytes.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/WordValueAttribute.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/WordValueAttribute.java
index 93b5a1a5f..e12d62e90 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/WordValueAttribute.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/WordValueAttribute.java
@@ -180,19 +180,6 @@ public class WordValueAttribute
}
/**
- * Read the value of a "Modifiers" or "RoleClassMethodModifiers" attribute from byte code.
- * @param method method to read from
- * @param readOffset where to read
- * @return the modifier flags
- */
- public static int readModifiers(
- MethodInfo method,
- int readOffset)
- {
- return method.u2At(readOffset);
- }
-
- /**
* just like readModifiers(MethodInfo,int)
*/
public static void readModifiers(FieldInfo field, int readOffset) {

Back to the top