[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Jilc-patches] CVS: jilc/src jdasm.h,1.7,1.8 jdasm.c,1.5,1.6
From: |
Gopal.V <address@hidden> |
Subject: |
[Jilc-patches] CVS: jilc/src jdasm.h,1.7,1.8 jdasm.c,1.5,1.6 |
Date: |
Tue, 26 Feb 2002 23:31:01 -0500 |
Update of /cvsroot/jilc/jilc/src
In directory subversions:/tmp/cvs-serv3451
Modified Files:
jdasm.h jdasm.c
Log Message:
put in WIDE opcode support in jdasm.c
Index: jdasm.h
===================================================================
RCS file: /cvsroot/jilc/jilc/src/jdasm.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** jdasm.h 26 Feb 2002 22:31:23 -0000 1.7
--- jdasm.h 27 Feb 2002 04:30:58 -0000 1.8
***************
*** 63,67 ****
void print_fields(JVClass *klass, JVCPEntry *cp_entry);
void print_string_cp(JVCPEntry *cp_entry, unsigned int i);
! void print_byte_code(byte *code, int *start_index, int code_len, UInt32 *
jump_points, JVCPEntry *cp_entry);
void print_method_code(JVMethodEntry *method, JVCPEntry *cp_entry);
void print_methods(JVClass *klass, JVCPEntry *cp_entry);
--- 63,67 ----
void print_fields(JVClass *klass, JVCPEntry *cp_entry);
void print_string_cp(JVCPEntry *cp_entry, unsigned int i);
! void print_byte_code(byte *code, int *start_index, int code_len, int
*wide,UInt32 * jump_points, JVCPEntry *cp_entry);
void print_method_code(JVMethodEntry *method, JVCPEntry *cp_entry);
void print_methods(JVClass *klass, JVCPEntry *cp_entry);
Index: jdasm.c
===================================================================
RCS file: /cvsroot/jilc/jilc/src/jdasm.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** jdasm.c 26 Feb 2002 22:31:23 -0000 1.5
--- jdasm.c 27 Feb 2002 04:30:58 -0000 1.6
***************
*** 207,211 ****
}
! void print_byte_code(byte *code, int *start_index, int code_len, UInt32
*jump_points,JVCPEntry *cp_entry)
{
int start = *start_index;
--- 207,211 ----
}
! void print_byte_code(byte *code, int *start_index, int code_len, int
*wide,UInt32 *jump_points,JVCPEntry *cp_entry)
{
int start = *start_index;
***************
*** 242,247 ****
PRINT_OP_NAME(found);
start++;
! printf(" %u ", (unsigned
char)(code[start]));
! start += 1;
break;
case I_U2:
--- 242,256 ----
PRINT_OP_NAME(found);
start++;
! if(*wide==1)
! {
!
uint_16=(UInt16)READ_UINT16(code,start);
! printf(" %u ",uint_16);
! start += 2;
! }
! else
! {
! printf(" %u ", (unsigned
char)(code[start]));
! start += 1;
! }
break;
case I_U2:
***************
*** 268,274 ****
PRINT_OP_NAME(found);
start++;
! printf(" %u %d", (unsigned
char)(code[start]), \
(signed char)(code[start + 1]));
! start += 2;
break;
case FIELD_U2:
--- 277,295 ----
PRINT_OP_NAME(found);
start++;
! if(*wide ==1)
! {
!
uint_16=READ_UINT16(code,start);
! printf(" %u ", uint_16);
! start+=2;
!
int_16=READ_INT16(code,start);
! printf("%d ", int_16);
! start+=2;
! }
! else
! {
! printf(" %u %d", (unsigned
char)(code[start]), \
(signed char)(code[start + 1]));
! start += 2;
! }
break;
case FIELD_U2:
***************
*** 383,389 ****
--- 404,419 ----
start+=4;//skip one byte coz
SUN says so
break;
+ case IGNORE: // wide opcode !
+ PRINT_OP_NAME(found);
+ start++;
+ *wide=1;
+ break;
default: printf(": Unknown instruction %d",
code[start]);
start++;
}
+ if(*wide && (found.opcode != JAVA_WIDE))
+ {
+ *wide=0;
+ }
printf("\n");
}
***************
*** 423,426 ****
--- 453,457 ----
int codelen =
method->attr_entries[method->code_index].attributes.code.code_count;
UInt32 *jump_points;
+ int wide=0;
if( (method->acc_flags & ACCESS_ABSTRACT) != 0 || codelen == 0)
***************
*** 440,448 ****
while(start < codelen)
{
! print_byte_code(code, &start, codelen, jump_points, cp_entry);
}
//printf(": TODO-> label management\n"); worked out
printf(": TODO-> wide opcode not supported\n");
}
void print_method_throws(JVMethodEntry *method,JVCPEntry *cp_entry)
{
--- 471,480 ----
while(start < codelen)
{
! print_byte_code(code, &start, codelen,
&wide,jump_points,cp_entry);
}
//printf(": TODO-> label management\n"); worked out
printf(": TODO-> wide opcode not supported\n");
}
+
void print_method_throws(JVMethodEntry *method,JVCPEntry *cp_entry)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Jilc-patches] CVS: jilc/src jdasm.h,1.7,1.8 jdasm.c,1.5,1.6,
Gopal.V <address@hidden> <=
- Prev by Date:
[Jilc-patches] CVS: jilc/examples Test9.java,NONE,1.1 Test10.java,NONE,1.1 Test11.java,NONE,1.1
- Next by Date:
[Jilc-patches] CVS: jilc/examples Test12.jasm,NONE,1.1
- Previous by thread:
[Jilc-patches] CVS: jilc/examples Test9.java,NONE,1.1 Test10.java,NONE,1.1 Test11.java,NONE,1.1
- Next by thread:
[Jilc-patches] CVS: jilc/examples Test12.jasm,NONE,1.1
- Index(es):