01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.object.bytecode;
06:
07: import com.tc.asm.ClassVisitor;
08: import com.tc.asm.MethodVisitor;
09: import com.tc.asm.Opcodes;
10:
11: public class AbstractListMethodCreator implements MethodCreator,
12: Opcodes {
13:
14: public void createMethods(ClassVisitor cv) {
15: MethodVisitor mv = cv.visitMethod(ACC_PROTECTED, ByteCodeUtil
16: .fieldGetterMethod("modCount"), "()I", null, null);
17: mv.visitCode();
18: mv.visitVarInsn(ALOAD, 0);
19: mv.visitFieldInsn(GETFIELD, "java/util/AbstractList",
20: "modCount", "I");
21: mv.visitInsn(IRETURN);
22: mv.visitMaxs(0, 0);
23: mv.visitEnd();
24:
25: mv = cv.visitMethod(ACC_PROTECTED, ByteCodeUtil
26: .fieldSetterMethod("modCount"), "(I)V", null, null);
27: mv.visitCode();
28: mv.visitVarInsn(ALOAD, 0);
29: mv.visitVarInsn(ILOAD, 1);
30: mv.visitFieldInsn(PUTFIELD, "java/util/AbstractList",
31: "modCount", "I");
32: mv.visitInsn(RETURN);
33: mv.visitMaxs(0, 0);
34: mv.visitEnd();
35:
36: }
37:
38: }
|