osprey/kgccfe/gnu/java/expr.c File Reference

#include "config.h"
#include "system.h"
#include "tree.h"
#include "real.h"
#include "rtl.h"
#include "flags.h"
#include "expr.h"
#include "java-tree.h"
#include "javaop.h"
#include "java-opcodes.h"
#include "jcf.h"
#include "java-except.h"
#include "parse.h"
#include "toplev.h"
#include "except.h"
#include "ggc.h"
#include "javaop.def"

Include dependency graph for expr.c:

Go to the source code of this file.

Defines

#define BCODE   byte_ops
#define BYTE_type_node   byte_type_node
#define SHORT_type_node   short_type_node
#define INT_type_node   int_type_node
#define LONG_type_node   long_type_node
#define CHAR_type_node   char_type_node
#define PTR_type_node   ptr_type_node
#define FLOAT_type_node   float_type_node
#define DOUBLE_type_node   double_type_node
#define VOID_type_node   void_type_node
#define CONST_INDEX_1   (saw_index = 1, IMMEDIATE_u1)
#define CONST_INDEX_2   (saw_index = 1, IMMEDIATE_u2)
#define VAR_INDEX_1   (saw_index = 1, IMMEDIATE_u1)
#define VAR_INDEX_2   (saw_index = 1, IMMEDIATE_u2)
#define CHECK_PC_IN_RANGE(PC)   ((void)1)
#define JAVAOP(OPNAME, OPCODE, OPKIND, OPERAND_TYPE, OPERAND_VALUE)
#define NOTE_LABEL(PC)   note_label(oldpc, PC)
#define PRE_PUSHC(OPERAND_TYPE, OPERAND_VALUE)   (void)(OPERAND_VALUE);
#define PRE_LOAD(OPERAND_TYPE, OPERAND_VALUE)   (void)(OPERAND_VALUE);
#define PRE_STORE(OPERAND_TYPE, OPERAND_VALUE)   (void)(OPERAND_VALUE);
#define PRE_STACK(OPERAND_TYPE, OPERAND_VALUE)
#define PRE_UNOP(OPERAND_TYPE, OPERAND_VALUE)
#define PRE_BINOP(OPERAND_TYPE, OPERAND_VALUE)
#define PRE_CONVERT(OPERAND_TYPE, OPERAND_VALUE)
#define PRE_CONVERT2(OPERAND_TYPE, OPERAND_VALUE)
#define PRE_SPECIAL(OPERAND_TYPE, INSTRUCTION)   PRE_SPECIAL_##INSTRUCTION(OPERAND_TYPE)
#define PRE_SPECIAL_IINC(OPERAND_TYPE)   ((void) IMMEDIATE_u1, (void) IMMEDIATE_s1)
#define PRE_SPECIAL_ENTER(IGNORE)
#define PRE_SPECIAL_EXIT(IGNORE)
#define PRE_SPECIAL_THROW(IGNORE)
#define PRE_SPECIAL_BREAK(IGNORE)
#define PRE_SPECIAL_WIDE(IGNORE)
#define PRE_IMPL(IGNORE1, IGNORE2)
#define PRE_MONITOR(OPERAND_TYPE, OPERAND_VALUE)
#define PRE_RETURN(OPERAND_TYPE, OPERAND_VALUE)
#define PRE_ARRAY(OPERAND_TYPE, SUBOP)   PRE_ARRAY_##SUBOP(OPERAND_TYPE)
#define PRE_ARRAY_LOAD(TYPE)
#define PRE_ARRAY_STORE(TYPE)
#define PRE_ARRAY_LENGTH(TYPE)
#define PRE_ARRAY_NEW(TYPE)   PRE_ARRAY_NEW_##TYPE
#define PRE_ARRAY_NEW_NUM   ((void) IMMEDIATE_u1)
#define PRE_ARRAY_NEW_PTR   ((void) IMMEDIATE_u2)
#define PRE_ARRAY_NEW_MULTI   ((void) IMMEDIATE_u2, (void) IMMEDIATE_u1)
#define PRE_TEST(OPERAND_TYPE, OPERAND_VALUE)   NOTE_LABEL (oldpc+IMMEDIATE_s2)
#define PRE_COND(OPERAND_TYPE, OPERAND_VALUE)   NOTE_LABEL (oldpc+IMMEDIATE_s2)
#define PRE_BRANCH(OPERAND_TYPE, OPERAND_VALUE)
#define PRE_JSR(OPERAND_TYPE, OPERAND_VALUE)
#define PRE_RET(OPERAND_TYPE, OPERAND_VALUE)   (void)(OPERAND_VALUE)
#define PRE_SWITCH(OPERAND_TYPE, TABLE_OR_LOOKUP)   PC = (PC + 3) / 4 * 4; PRE_##TABLE_OR_LOOKUP##_SWITCH
#define PRE_LOOKUP_SWITCH
#define PRE_TABLE_SWITCH
#define PRE_FIELD(MAYBE_STATIC, PUT_OR_GET)   (void)(IMMEDIATE_u2);
#define PRE_OBJECT(MAYBE_STATIC, PUT_OR_GET)   (void)(IMMEDIATE_u2);
#define PRE_INVOKE(MAYBE_STATIC, IS_INTERFACE)
#define JAVAOP(OPNAME, OPCODE, OPKIND, OPERAND_TYPE, OPERAND_VALUE)
#define RET(OPERAND_TYPE, OPERAND_VALUE)
#define JSR(OPERAND_TYPE, OPERAND_VALUE)
#define PUSHC(OPERAND_TYPE, OPERAND_VALUE)
#define LOAD_INTERNAL(OPTYPE, OPVALUE)   expand_load_internal (OPVALUE, type_map[OPVALUE], oldpc);
#define LOAD(OPERAND_TYPE, OPERAND_VALUE)
#define RETURN(OPERAND_TYPE, OPERAND_VALUE)   expand_java_return (OPERAND_TYPE##_type_node)
#define REM_EXPR   TRUNC_MOD_EXPR
#define BINOP(OPERAND_TYPE, OPERAND_VALUE)   expand_java_binop (OPERAND_TYPE##_type_node, OPERAND_VALUE##_EXPR)
#define FIELD(IS_STATIC, IS_PUT)   expand_java_field_op (IS_STATIC, IS_PUT, IMMEDIATE_u2)
#define TEST(OPERAND_TYPE, CONDITION)   expand_test (CONDITION##_EXPR, OPERAND_TYPE##_type_node, oldpc+IMMEDIATE_s2)
#define COND(OPERAND_TYPE, CONDITION)   expand_cond (CONDITION##_EXPR, OPERAND_TYPE##_type_node, oldpc+IMMEDIATE_s2)
#define BRANCH(OPERAND_TYPE, OPERAND_VALUE)   BRANCH_##OPERAND_TYPE (OPERAND_VALUE)
#define BRANCH_GOTO(OPERAND_VALUE)   expand_java_goto (oldpc + OPERAND_VALUE)
#define BRANCH_CALL(OPERAND_VALUE)   expand_java_call (oldpc + OPERAND_VALUE, oldpc)
#define NOT_IMPL(OPERAND_TYPE, OPERAND_VALUE)
#define NOT_IMPL1(OPERAND_VALUE)
#define BRANCH_RETURN(OPERAND_VALUE)   NOT_IMPL1(OPERAND_VALUE)
#define STACK(SUBOP, COUNT)   STACK_##SUBOP (COUNT)
#define STACK_POP(COUNT)   java_stack_pop (COUNT)
#define STACK_SWAP(COUNT)   java_stack_swap()
#define STACK_DUP(COUNT)   java_stack_dup (COUNT, 0)
#define STACK_DUPx1(COUNT)   java_stack_dup (COUNT, 1)
#define STACK_DUPx2(COUNT)   java_stack_dup (COUNT, 2)
#define SWITCH(OPERAND_TYPE, TABLE_OR_LOOKUP)   PC = (PC + 3) / 4 * 4; TABLE_OR_LOOKUP##_SWITCH
#define LOOKUP_SWITCH
#define TABLE_SWITCH
#define INVOKE(MAYBE_STATIC, IS_INTERFACE)
#define OBJECT(TYPE, OP)   expand_java_##OP (get_class_constant (current_jcf, IMMEDIATE_u2))
#define ARRAY(OPERAND_TYPE, SUBOP)   ARRAY_##SUBOP(OPERAND_TYPE)
#define ARRAY_LOAD(OPERAND_TYPE)
#define ARRAY_STORE(OPERAND_TYPE)
#define ARRAY_LENGTH(OPERAND_TYPE)   expand_java_array_length();
#define ARRAY_NEW(OPERAND_TYPE)   ARRAY_NEW_##OPERAND_TYPE()
#define ARRAY_NEW_PTR()
#define ARRAY_NEW_NUM()
#define ARRAY_NEW_MULTI()
#define UNOP(OPERAND_TYPE, OPERAND_VALUE)
#define CONVERT2(FROM_TYPE, TO_TYPE)
#define CONVERT(FROM_TYPE, TO_TYPE)
#define STORE_INTERNAL(OPTYPE, OPVALUE)
#define STORE(OPERAND_TYPE, OPERAND_VALUE)
#define SPECIAL(OPERAND_TYPE, INSTRUCTION)   SPECIAL_##INSTRUCTION(OPERAND_TYPE)
#define SPECIAL_ENTER(IGNORED)   MONITOR_OPERATION (soft_monitorenter_node)
#define SPECIAL_EXIT(IGNORED)   MONITOR_OPERATION (soft_monitorexit_node)
#define MONITOR_OPERATION(call)
#define SPECIAL_IINC(IGNORED)
#define SPECIAL_WIDE(IGNORED)
#define SPECIAL_THROW(IGNORED)   build_java_athrow (pop_value (throwable_type_node))
#define SPECIAL_BREAK   NOT_IMPL1
#define IMPL   NOT_IMPL

Functions/Subroutines

static void flush_quick_stack PARAMS ((void))
static void push_value PARAMS ((tree))
static void java_stack_dup PARAMS ((int, int))
static void
expand_java_multianewarray 
PARAMS ((tree, int))
static tree build_java_monitor PARAMS ((tree, tree))
static void expand_java_pushc PARAMS ((int, tree))
static void expand_load_internal PARAMS ((int, tree, int))
static void expand_iinc PARAMS ((unsigned int, int, int))
static void expand_java_binop PARAMS ((tree, enum tree_code))
static void expand_compare PARAMS ((enum tree_code, tree, tree, int))
static void expand_test PARAMS ((enum tree_code, tree, int))
static void expand_java_goto PARAMS ((int))
static void expand_invoke PARAMS ((int, int, int))
static void
java_push_constant_from_pool 
PARAMS ((struct JCF *, int))
static unsigned char
peek_opcode_at_pc 
PARAMS ((struct JCF *, int, int))
static bool
emit_init_test_initialization 
PARAMS ((struct hash_entry *, PTR ptr))
void init_expr_processing ()
tree truthvalue_conversion (tree expr)
static void flush_quick_stack ()
int push_type_0 (tree type)
void push_type (tree type)
static void push_value (tree value)
tree pop_type_0 (tree type, char **messagep)
tree pop_type (tree type)
int can_widen_reference_to (tree source_type, tree target_type)
static tree pop_value (tree type)
static void java_stack_pop (int count)
static void java_stack_swap ()
static void java_stack_dup (int size, int offset)
static void build_java_athrow (tree node)
static void build_java_jsr (int target_pc, int return_pc)
static void build_java_ret (tree location)
tree decode_newarray_type (int atype)
int encode_newarray_type (tree type)
static tree build_java_throw_out_of_bounds_exception (tree index)
tree build_java_array_length_access (tree node)
tree java_check_reference (tree expr, int check)
tree build_java_indirect_ref (tree type, tree expr, int check)
tree build_java_arrayaccess (tree array, tree type, tree index)
tree build_java_arraystore_check (tree array, tree object)
static tree build_java_check_indexed_type (tree array_node, tree indexed_type)
tree build_newarray (int atype_value, tree length)
tree build_anewarray (tree class_type, tree length)
tree build_new_array (tree type, tree length)
static void expand_java_multianewarray (tree class_type, int ndim)
static void expand_java_arraystore (tree rhs_type_node)
static void expand_java_arrayload (tree lhs_type_node)
static void expand_java_array_length ()
static tree build_java_monitor (tree call, tree object)
static void expand_java_pushc (int ival, tree type)
static void expand_java_return (tree type)
static void expand_load_internal (int index, tree type, int pc)
tree build_address_of (tree value)
bool class_has_finalize_method (tree type)
static void expand_java_NEW (tree type)
tree build_get_class (tree value)
tree build_instanceof (tree value, tree type)
static void expand_java_INSTANCEOF (tree type)
static void expand_java_CHECKCAST (tree type)
static void expand_iinc (unsigned int local_var_index, int ival, int pc)
tree build_java_soft_divmod (enum tree_code op, tree type, tree op1, tree op2)
tree build_java_binop (enum tree_code op, tree type, tree arg1, tree arg2)
static void expand_java_binop (tree type, enum tree_code op)
tree lookup_field (tree *typep, tree name)
tree build_field_ref (tree self_value, tree self_class, tree name)
tree lookup_label (int pc)
tree generate_name ()
tree create_label_decl (tree name)
static void note_label (current_pc, int current_pc target_pc)
static void expand_compare (enum tree_code condition, tree value1, tree value2, int target_pc)
static void expand_test (enum tree_code condition, tree type, int target_pc)
static void expand_cond (enum tree_code condition, tree type, int target_pc)
static void expand_java_goto (int target_pc)
static tree pop_arguments (tree arg_types)
tree build_class_init (tree clas, tree expr)
tree build_known_method_ref (tree method, method_type, tree self_type, method_signature, arg_list)
tree invoke_build_dtable (int is_invoke_interface, tree arg_list)
int get_offset_table_index (tree method)
tree build_invokevirtual (tree dtable, tree method)
tree build_invokeinterface (tree dtable, tree method)
static void expand_invoke (int opcode, int method_ref_index, nargs)
tree build_jni_stub (tree method)
static void expand_java_field_op (int is_static, int is_putting, int field_ref_index)
void load_type_state (tree label)
static tree case_identity (t, tree v)
static tree get_primitive_array_vtable (tree elt)
struct rtx_def * java_lang_expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier modifier)
void note_instructions (JCF *jcf, tree method)
void expand_byte_code (JCF *jcf, tree method)
static void java_push_constant_from_pool (JCF *jcf, int index)
int process_jvm_instruction (int PC, const unsigned char *byte_ops, length)
static unsigned char peek_opcode_at_pc (JCF *jcf, int code_offset, int pc)
int maybe_adjust_start_pc (struct JCF *jcf, int code_offset, int start_pc, int slot)
tree force_evaluation_order (tree node)
static bool emit_init_test_initialization (struct hash_entry *entry, key)

Variables

static tree operand_type [59]
struct obstack permanent_obstack
static tree methods_ident = NULL_TREE
static tree ncode_ident = NULL_TREE
tree dtable_ident = NULL_TREE
int always_initialize_class_p
static tree quick_stack = NULL_TREE
static tree tree_list_free_list = NULL_TREE
int stack_pointer
const unsigned char * linenumber_table
int linenumber_count
char * instruction_bits


Define Documentation

#define ARRAY ( OPERAND_TYPE,
SUBOP   )     ARRAY_##SUBOP(OPERAND_TYPE)

#define ARRAY_LENGTH ( OPERAND_TYPE   )     expand_java_array_length();

#define ARRAY_LOAD ( OPERAND_TYPE   ) 

Value:

{             \
    expand_java_arrayload( OPERAND_TYPE##_type_node );  \
  }

#define ARRAY_NEW ( OPERAND_TYPE   )     ARRAY_NEW_##OPERAND_TYPE()

 
#define ARRAY_NEW_MULTI (  ) 

Value:

{               \
    tree class = get_class_constant (current_jcf, IMMEDIATE_u2 ); \
    int  ndims = IMMEDIATE_u1;          \
    expand_java_multianewarray( class, ndims );     \
  }

 
#define ARRAY_NEW_NUM (  ) 

Value:

{           \
    int atype = IMMEDIATE_u1;     \
    push_value (build_newarray (atype, pop_value (int_type_node)));\
  }

 
#define ARRAY_NEW_PTR (  ) 

#define ARRAY_STORE ( OPERAND_TYPE   ) 

Value:

{             \
    expand_java_arraystore( OPERAND_TYPE##_type_node ); \
  }

#define BCODE   byte_ops

#define BINOP ( OPERAND_TYPE,
OPERAND_VALUE   )     expand_java_binop (OPERAND_TYPE##_type_node, OPERAND_VALUE##_EXPR)

#define BRANCH ( OPERAND_TYPE,
OPERAND_VALUE   )     BRANCH_##OPERAND_TYPE (OPERAND_VALUE)

#define BRANCH_CALL ( OPERAND_VALUE   )     expand_java_call (oldpc + OPERAND_VALUE, oldpc)

#define BRANCH_GOTO ( OPERAND_VALUE   )     expand_java_goto (oldpc + OPERAND_VALUE)

#define BRANCH_RETURN ( OPERAND_VALUE   )     NOT_IMPL1(OPERAND_VALUE)

#define BYTE_type_node   byte_type_node

#define CHAR_type_node   char_type_node

#define CHECK_PC_IN_RANGE ( PC   )     ((void)1)

#define COND ( OPERAND_TYPE,
CONDITION   )     expand_cond (CONDITION##_EXPR, OPERAND_TYPE##_type_node, oldpc+IMMEDIATE_s2)

#define CONST_INDEX_1   (saw_index = 1, IMMEDIATE_u1)

#define CONST_INDEX_2   (saw_index = 1, IMMEDIATE_u2)

#define CONVERT ( FROM_TYPE,
TO_TYPE   ) 

Value:

{               \
    push_value (convert (TO_TYPE##_type_node,                 \
       pop_value (FROM_TYPE##_type_node))); \
  }

#define CONVERT2 ( FROM_TYPE,
TO_TYPE   ) 

Value:

{                  \
    push_value (build1 (NOP_EXPR, int_type_node,       \
      (convert (TO_TYPE##_type_node,       \
          pop_value (FROM_TYPE##_type_node))))); \
  }

#define DOUBLE_type_node   double_type_node

#define FIELD ( IS_STATIC,
IS_PUT   )     expand_java_field_op (IS_STATIC, IS_PUT, IMMEDIATE_u2)

#define FLOAT_type_node   float_type_node

#define IMPL   NOT_IMPL

#define INT_type_node   int_type_node

#define INVOKE ( MAYBE_STATIC,
IS_INTERFACE   ) 

Value:

{ int opcode = byte_ops[PC-1]; \
    int method_ref_index = IMMEDIATE_u2; \
    int nargs; \
    if (IS_INTERFACE) { nargs = IMMEDIATE_u1;  (void) IMMEDIATE_u1; } \
    else nargs = -1; \
    expand_invoke (opcode, method_ref_index, nargs); \
  }

#define JAVAOP ( OPNAME,
OPCODE,
OPKIND,
OPERAND_TYPE,
OPERAND_VALUE   ) 

Value:

case OPCODE: \
      opname = #OPNAME; \
      OPKIND(OPERAND_TYPE, OPERAND_VALUE); \
      break;

#define JAVAOP ( OPNAME,
OPCODE,
OPKIND,
OPERAND_TYPE,
OPERAND_VALUE   ) 

Value:

case OPCODE: \
    PRE_##OPKIND(OPERAND_TYPE, OPERAND_VALUE); \
    break;

#define JSR ( OPERAND_TYPE,
OPERAND_VALUE   ) 

Value:

{               \
    /* OPERAND_VALUE may have side-effects on PC */ \
    int opvalue = OPERAND_VALUE;        \
    build_java_jsr (oldpc + opvalue, PC);     \
  }

#define LOAD ( OPERAND_TYPE,
OPERAND_VALUE   ) 

Value:

{ \
    /* have to do this since OPERAND_VALUE may have side-effects */ \
    int opvalue = OPERAND_VALUE; \
    LOAD_INTERNAL(OPERAND_TYPE##_type_node, opvalue); \
  }

#define LOAD_INTERNAL ( OPTYPE,
OPVALUE   )     expand_load_internal (OPVALUE, type_map[OPVALUE], oldpc);

#define LONG_type_node   long_type_node

#define LOOKUP_SWITCH

Value:

{ jint default_offset = IMMEDIATE_s4;  jint npairs = IMMEDIATE_s4; \
    tree selector = pop_value (INT_type_node); \
    tree duplicate, label; \
    tree type = TREE_TYPE (selector); \
    flush_quick_stack (); \
    expand_start_case (0, selector, type, "switch statement");\
    while (--npairs >= 0) \
      { \
  jint match = IMMEDIATE_s4; jint offset = IMMEDIATE_s4; \
  tree value = build_int_2 (match, match < 0 ? -1 : 0); \
  TREE_TYPE (value) = type; \
  label =  build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); \
  pushcase (value, convert, label, &duplicate); \
  expand_java_goto (oldpc + offset); \
      } \
    label =  build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); \
    pushcase (NULL_TREE, 0, label, &duplicate); \
    expand_java_goto (oldpc + default_offset); \
    expand_end_case (selector); \
  }

#define MONITOR_OPERATION ( call   ) 

Value:

#define NOT_IMPL ( OPERAND_TYPE,
OPERAND_VALUE   ) 

Value:

fprintf (stderr, "%3d: %s ", oldpc, opname); \
    fprintf (stderr, "(not implemented)\n")

#define NOT_IMPL1 ( OPERAND_VALUE   ) 

Value:

fprintf (stderr, "%3d: %s ", oldpc, opname); \
    fprintf (stderr, "(not implemented)\n")

#define NOTE_LABEL ( PC   )     note_label(oldpc, PC)

#define OBJECT ( TYPE,
OP   )     expand_java_##OP (get_class_constant (current_jcf, IMMEDIATE_u2))

#define PRE_ARRAY ( OPERAND_TYPE,
SUBOP   )     PRE_ARRAY_##SUBOP(OPERAND_TYPE)

#define PRE_ARRAY_LENGTH ( TYPE   ) 

#define PRE_ARRAY_LOAD ( TYPE   ) 

#define PRE_ARRAY_NEW ( TYPE   )     PRE_ARRAY_NEW_##TYPE

#define PRE_ARRAY_NEW_MULTI   ((void) IMMEDIATE_u2, (void) IMMEDIATE_u1)

#define PRE_ARRAY_NEW_NUM   ((void) IMMEDIATE_u1)

#define PRE_ARRAY_NEW_PTR   ((void) IMMEDIATE_u2)

#define PRE_ARRAY_STORE ( TYPE   ) 

#define PRE_BINOP ( OPERAND_TYPE,
OPERAND_VALUE   ) 

#define PRE_BRANCH ( OPERAND_TYPE,
OPERAND_VALUE   ) 

Value:

saw_index = 0;  INT_temp = (OPERAND_VALUE); \
  if (!saw_index)  NOTE_LABEL(oldpc + INT_temp);

#define PRE_COND ( OPERAND_TYPE,
OPERAND_VALUE   )     NOTE_LABEL (oldpc+IMMEDIATE_s2)

#define PRE_CONVERT ( OPERAND_TYPE,
OPERAND_VALUE   ) 

#define PRE_CONVERT2 ( OPERAND_TYPE,
OPERAND_VALUE   ) 

#define PRE_FIELD ( MAYBE_STATIC,
PUT_OR_GET   )     (void)(IMMEDIATE_u2);

#define PRE_IMPL ( IGNORE1,
IGNORE2   ) 

#define PRE_INVOKE ( MAYBE_STATIC,
IS_INTERFACE   ) 

Value:

(void)(IMMEDIATE_u2); \
  PC += 2 * IS_INTERFACE /* for invokeinterface */;

#define PRE_JSR ( OPERAND_TYPE,
OPERAND_VALUE   ) 

Value:

saw_index = 0;  INT_temp = (OPERAND_VALUE); \
  NOTE_LABEL (PC); \
  if (!saw_index)  NOTE_LABEL(oldpc + INT_temp);

#define PRE_LOAD ( OPERAND_TYPE,
OPERAND_VALUE   )     (void)(OPERAND_VALUE);

#define PRE_LOOKUP_SWITCH

Value:

{ jint default_offset = IMMEDIATE_s4;  jint npairs = IMMEDIATE_s4;  \
    NOTE_LABEL (default_offset+oldpc);          \
    if (npairs >= 0)              \
      while (--npairs >= 0) {           \
       jint match ATTRIBUTE_UNUSED = IMMEDIATE_s4;      \
       jint offset = IMMEDIATE_s4;          \
       NOTE_LABEL (offset+oldpc); }         \
  }

#define PRE_MONITOR ( OPERAND_TYPE,
OPERAND_VALUE   ) 

#define PRE_OBJECT ( MAYBE_STATIC,
PUT_OR_GET   )     (void)(IMMEDIATE_u2);

#define PRE_PUSHC ( OPERAND_TYPE,
OPERAND_VALUE   )     (void)(OPERAND_VALUE);

#define PRE_RET ( OPERAND_TYPE,
OPERAND_VALUE   )     (void)(OPERAND_VALUE)

#define PRE_RETURN ( OPERAND_TYPE,
OPERAND_VALUE   ) 

#define PRE_SPECIAL ( OPERAND_TYPE,
INSTRUCTION   )     PRE_SPECIAL_##INSTRUCTION(OPERAND_TYPE)

#define PRE_SPECIAL_BREAK ( IGNORE   ) 

#define PRE_SPECIAL_ENTER ( IGNORE   ) 

#define PRE_SPECIAL_EXIT ( IGNORE   ) 

#define PRE_SPECIAL_IINC ( OPERAND_TYPE   )     ((void) IMMEDIATE_u1, (void) IMMEDIATE_s1)

#define PRE_SPECIAL_THROW ( IGNORE   ) 

#define PRE_SPECIAL_WIDE ( IGNORE   ) 

Value:

{ \
    int modified_opcode = IMMEDIATE_u1; \
    if (modified_opcode == OPCODE_iinc) \
      { \
  (void) IMMEDIATE_u2;  /* indexbyte1 and indexbyte2 */ \
  (void) IMMEDIATE_s2;  /* constbyte1 and constbyte2 */ \
      } \
    else \
      { \
  (void) IMMEDIATE_u2;  /* indexbyte1 and indexbyte2 */ \
      } \
  }

#define PRE_STACK ( OPERAND_TYPE,
OPERAND_VALUE   ) 

#define PRE_STORE ( OPERAND_TYPE,
OPERAND_VALUE   )     (void)(OPERAND_VALUE);

#define PRE_SWITCH ( OPERAND_TYPE,
TABLE_OR_LOOKUP   )     PC = (PC + 3) / 4 * 4; PRE_##TABLE_OR_LOOKUP##_SWITCH

#define PRE_TABLE_SWITCH

Value:

{ jint default_offset = IMMEDIATE_s4;     \
    jint low = IMMEDIATE_s4; jint high = IMMEDIATE_s4;  \
    NOTE_LABEL (default_offset+oldpc);      \
    if (low <= high)          \
     while (low++ <= high) {        \
       jint offset = IMMEDIATE_s4;      \
       NOTE_LABEL (offset+oldpc); }     \
  }

#define PRE_TEST ( OPERAND_TYPE,
OPERAND_VALUE   )     NOTE_LABEL (oldpc+IMMEDIATE_s2)

#define PRE_UNOP ( OPERAND_TYPE,
OPERAND_VALUE   ) 

#define PTR_type_node   ptr_type_node

#define PUSHC ( OPERAND_TYPE,
OPERAND_VALUE   ) 

Value:

{ int saw_index = 0;  int ival = (OPERAND_VALUE); \
    if (saw_index) java_push_constant_from_pool (current_jcf, ival); \
    else expand_java_pushc (ival, OPERAND_TYPE##_type_node); }

#define REM_EXPR   TRUNC_MOD_EXPR

#define RET ( OPERAND_TYPE,
OPERAND_VALUE   ) 

Value:

{                 \
    int saw_index = 0;              \
    int index     = OPERAND_VALUE;          \
    build_java_ret (find_local_variable (index, ptr_type_node, oldpc)); \
  }

#define RETURN ( OPERAND_TYPE,
OPERAND_VALUE   )     expand_java_return (OPERAND_TYPE##_type_node)

#define SHORT_type_node   short_type_node

#define SPECIAL ( OPERAND_TYPE,
INSTRUCTION   )     SPECIAL_##INSTRUCTION(OPERAND_TYPE)

#define SPECIAL_BREAK   NOT_IMPL1

#define SPECIAL_ENTER ( IGNORED   )     MONITOR_OPERATION (soft_monitorenter_node)

#define SPECIAL_EXIT ( IGNORED   )     MONITOR_OPERATION (soft_monitorexit_node)

#define SPECIAL_IINC ( IGNORED   ) 

Value:

{ \
    unsigned int local_var_index = IMMEDIATE_u1; \
    int ival = IMMEDIATE_s1; \
    expand_iinc(local_var_index, ival, oldpc); \
  }

#define SPECIAL_THROW ( IGNORED   )     build_java_athrow (pop_value (throwable_type_node))

#define SPECIAL_WIDE ( IGNORED   ) 

#define STACK ( SUBOP,
COUNT   )     STACK_##SUBOP (COUNT)

#define STACK_DUP ( COUNT   )     java_stack_dup (COUNT, 0)

#define STACK_DUPx1 ( COUNT   )     java_stack_dup (COUNT, 1)

#define STACK_DUPx2 ( COUNT   )     java_stack_dup (COUNT, 2)

#define STACK_POP ( COUNT   )     java_stack_pop (COUNT)

#define STACK_SWAP ( COUNT   )     java_stack_swap()

#define STORE ( OPERAND_TYPE,
OPERAND_VALUE   ) 

Value:

{ \
    /* have to do this since OPERAND_VALUE may have side-effects */ \
    int opvalue = OPERAND_VALUE; \
    STORE_INTERNAL(OPERAND_TYPE##_type_node, opvalue); \
  }

#define STORE_INTERNAL ( OPTYPE,
OPVALUE   ) 

Value:

{             \
    tree decl, value;         \
    int var = OPVALUE;          \
    tree type = OPTYPE;         \
    value = pop_value (type);       \
    type = TREE_TYPE (value);       \
    decl = find_local_variable (var, type, oldpc);  \
    set_local_type (var, type );      \
    expand_assignment (decl, value, 0, 0);    \
  }

#define SWITCH ( OPERAND_TYPE,
TABLE_OR_LOOKUP   )     PC = (PC + 3) / 4 * 4; TABLE_OR_LOOKUP##_SWITCH

#define TABLE_SWITCH

Value:

{ jint default_offset = IMMEDIATE_s4; \
    jint low = IMMEDIATE_s4; jint high = IMMEDIATE_s4; \
    tree selector = pop_value (INT_type_node); \
    tree duplicate, label; \
    tree type = TREE_TYPE (selector); \
    flush_quick_stack (); \
    expand_start_case (0, selector, type, "switch statement");\
    for (; low <= high; low++) \
      { \
        jint offset = IMMEDIATE_s4; \
        tree value = build_int_2 (low, low < 0 ? -1 : 0); \
        TREE_TYPE (value) = type; \
        label =  build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); \
        pushcase (value, convert, label, &duplicate); \
        expand_java_goto (oldpc + offset); \
      } \
    label =  build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); \
    pushcase (NULL_TREE, 0, label, &duplicate); \
    expand_java_goto (oldpc + default_offset); \
    expand_end_case (selector); \
  }

#define TEST ( OPERAND_TYPE,
CONDITION   )     expand_test (CONDITION##_EXPR, OPERAND_TYPE##_type_node, oldpc+IMMEDIATE_s2)

#define UNOP ( OPERAND_TYPE,
OPERAND_VALUE   ) 

Value:

push_value (fold (build1 (NEGATE_EXPR, OPERAND_TYPE##_type_node, \
          pop_value (OPERAND_TYPE##_type_node))));

#define VAR_INDEX_1   (saw_index = 1, IMMEDIATE_u1)

#define VAR_INDEX_2   (saw_index = 1, IMMEDIATE_u2)

#define VOID_type_node   void_type_node


Function Documentation

tree build_address_of ( tree  value  ) 

tree build_anewarray ( tree  class_type,
tree  length 
)

tree build_class_init ( tree  clas,
tree  expr 
)

tree build_field_ref ( tree  self_value,
tree  self_class,
tree  name 
)

tree build_get_class ( tree  value  ) 

tree build_instanceof ( tree  value,
tree  type 
)

tree build_invokeinterface ( tree  dtable,
tree  method 
)

tree build_invokevirtual ( tree  dtable,
tree  method 
)

tree build_java_array_length_access ( tree  node  ) 

tree build_java_arrayaccess ( tree  array,
tree  type,
tree  index 
)

tree build_java_arraystore_check ( tree  array,
tree  object 
)

static void build_java_athrow ( tree  node  )  [static]

tree build_java_binop ( enum tree_code  op,
tree  type,
tree  arg1,
tree  arg2 
)

static tree build_java_check_indexed_type ( tree  array_node,
tree  indexed_type 
) [static]

tree build_java_indirect_ref ( tree  type,
tree  expr,
int  check 
)

static void build_java_jsr ( int  target_pc,
int  return_pc 
) [static]

static tree build_java_monitor ( tree  call,
tree  object 
) [static]

Definition at line 1082 of file expr.c.

References build(), build_address_of(), build_tree_list, NULL_TREE, and void_type_node.

static void build_java_ret ( tree  location  )  [static]

Definition at line 625 of file expr.c.

References expand_computed_goto().

tree build_java_soft_divmod ( enum tree_code  op,
tree  type,
tree  op1,
tree  op2 
)

static tree build_java_throw_out_of_bounds_exception ( tree  index  )  [static]

tree build_jni_stub ( tree  method  ) 

tree build_known_method_ref ( tree  method,
method_type  ,
tree  self_type,
method_signature  ,
arg_list   
)

tree build_new_array ( tree  type,
tree  length 
)

tree build_newarray ( int  atype_value,
tree  length 
)

int can_widen_reference_to ( tree  source_type,
tree  target_type 
)

static tree case_identity ( ,
tree  v 
) [static]

Definition at line 2453 of file expr.c.

Referenced by java_lang_expand_expr().

bool class_has_finalize_method ( tree  type  ) 

Definition at line 1183 of file expr.c.

References CLASSTYPE_SUPER, HAS_FINALIZER_P, and NULL_TREE.

Referenced by expand_java_NEW().

tree create_label_decl ( tree  name  ) 

tree decode_newarray_type ( int  atype  ) 

static bool emit_init_test_initialization ( struct hash_entry entry,
key   
) [static]

int encode_newarray_type ( tree  type  ) 

void expand_byte_code ( JCF jcf,
tree  method 
)

static void expand_compare ( enum tree_code  condition,
tree  value1,
tree  value2,
int  target_pc 
) [static]

static void expand_cond ( enum tree_code  condition,
tree  type,
int  target_pc 
) [static]

Definition at line 1686 of file expr.c.

References expand_compare(), flush_quick_stack(), and pop_value().

static void expand_iinc ( unsigned int  local_var_index,
int  ival,
int  pc 
) [static]

static void expand_invoke ( int  opcode,
int  method_ref_index,
nargs   
) [static]

static void expand_java_array_length (  )  [static]

Definition at line 1070 of file expr.c.

References build_java_array_length_access(), length, pop_value(), ptr_type_node, and push_value().

static void expand_java_arrayload ( tree  lhs_type_node  )  [static]

static void expand_java_arraystore ( tree  rhs_type_node  )  [static]

static void expand_java_binop ( tree  type,
enum tree_code  op 
) [static]

Definition at line 1474 of file expr.c.

References build_java_binop(), int_type_node, ltype, pop_value(), and push_value().

static void expand_java_CHECKCAST ( tree  type  )  [static]

static void expand_java_field_op ( int  is_static,
int  is_putting,
int  field_ref_index 
) [static]

static void expand_java_goto ( int  target_pc  )  [static]

Definition at line 1701 of file expr.c.

References expand_goto(), flush_quick_stack(), and lookup_label().

static void expand_java_INSTANCEOF ( tree  type  )  [static]

Definition at line 1304 of file expr.c.

References build_instanceof(), object_ptr_type_node, pop_value(), and push_value().

static void expand_java_multianewarray ( tree  class_type,
int  ndim 
) [static]

static void expand_java_NEW ( tree  type  )  [static]

static void expand_java_pushc ( int  ival,
tree  type 
) [static]

static void expand_java_return ( tree  type  )  [static]

static void expand_load_internal ( int  index,
tree  type,
int  pc 
) [static]

static void expand_test ( enum tree_code  condition,
tree  type,
int  target_pc 
) [static]

static void flush_quick_stack (  )  [static]

tree force_evaluation_order ( tree  node  ) 

tree generate_name (  ) 

Definition at line 1620 of file expr.c.

References ASM_GENERATE_INTERNAL_LABEL, and get_identifier().

Referenced by java_lang_expand_expr().

int get_offset_table_index ( tree  method  ) 

Definition at line 1908 of file expr.c.

References build_tree_list, i, NULL_TREE, otable_methods, TREE_CHAIN, and TREE_VALUE.

Referenced by build_invokeinterface(), and build_invokevirtual().

static tree get_primitive_array_vtable ( tree  elt  )  [static]

void init_expr_processing (  ) 

Definition at line 140 of file expr.c.

References double_type_node, float_type_node, int_type_node, long_type_node, and ptr_type_node.

Referenced by java_init_decl_processing().

tree invoke_build_dtable ( int  is_invoke_interface,
tree  arg_list 
)

tree java_check_reference ( tree  expr,
int  check 
)

struct rtx_def* java_lang_expand_expr ( tree  exp,
rtx  target,
enum machine_mode  tmode,
enum expand_modifier  modifier 
) [read]

static void java_push_constant_from_pool ( JCF jcf,
int  index 
) [static]

static void java_stack_dup ( int  size,
int  offset 
) [static]

static void java_stack_pop ( int  count  )  [static]

Definition at line 491 of file expr.c.

References abort, pop_value(), stack_type_map, TYPE_SECOND, and val.

Referenced by build_java_athrow().

static void java_stack_swap (  )  [static]

void load_type_state ( tree  label  ) 

tree lookup_field ( tree typep,
tree  name 
)

tree lookup_label ( int  pc  ) 

int maybe_adjust_start_pc ( struct JCF jcf,
int  code_offset,
int  start_pc,
int  slot 
)

Definition at line 3305 of file expr.c.

References BCODE_INSTRUCTION_START, first, index(), int, opcode, pc, and peek_opcode_at_pc().

Referenced by give_name_to_locals().

void note_instructions ( JCF jcf,
tree  method 
)

static void note_label ( current_pc  ,
int current_pc  target_pc 
) [static]

Definition at line 1645 of file expr.c.

References BCODE_JUMP_TARGET, and lookup_label().

static bool emit_init_test_initialization PARAMS ( (struct hash_entry *, PTR ptr  )  [static]

static unsigned char peek_opcode_at_pc PARAMS ( (struct JCF *, int, int)   )  [static]

static void java_push_constant_from_pool PARAMS ( (struct JCF *, int)   )  [static]

static void expand_invoke PARAMS ( (int, int, int)   )  [static]

static void expand_java_goto PARAMS ( (int)   )  [static]

static void expand_test PARAMS ( (enum tree_code, tree, int)   )  [static]

static void expand_compare PARAMS ( (enum tree_code, tree, tree, int)   )  [static]

static void expand_java_binop PARAMS ( (tree, enum tree_code  )  [static]

static void expand_iinc PARAMS ( (unsigned int, int, int)   )  [static]

static void expand_load_internal PARAMS ( (int, tree, int)   )  [static]

static void expand_java_pushc PARAMS ( (int, tree  )  [static]

static tree build_java_monitor PARAMS ( (tree, tree  )  [static]

static void expand_java_multianewarray PARAMS ( (tree, int)   )  [static]

static void java_stack_dup PARAMS ( (int, int)   )  [static]

static void push_value PARAMS ( (tree  )  [static]

static void flush_quick_stack PARAMS ( (void  )  [static, read]

Definition at line 77 of file cplus-dem.c.

static unsigned char peek_opcode_at_pc ( JCF jcf,
int  code_offset,
int  pc 
) [static]

Definition at line 3267 of file expr.c.

References JCF_SEEK, JCF_TELL, long, and opcode.

Referenced by maybe_adjust_start_pc().

static tree pop_arguments ( tree  arg_types  )  [static]

tree pop_type ( tree  type  ) 

tree pop_type_0 ( tree  type,
char **  messagep 
)

static tree pop_value ( tree  type  )  [static]

int process_jvm_instruction ( int  PC,
const unsigned char*  byte_ops,
length   
)

Definition at line 2952 of file expr.c.

References BCODE_EXCEPTION_TARGET, build(), fprintf(), pop_type(), ptr_type_node, and push_value().

Referenced by expand_byte_code().

void push_type ( tree  type  ) 

Definition at line 282 of file expr.c.

References abort, and push_type_0().

Referenced by push_value(), and type_stack_dup().

int push_type_0 ( tree  type  ) 

Definition at line 266 of file expr.c.

References current_function_decl, DECL_MAX_STACK, promote_type(), stack_type_map, TYPE_IS_WIDE, and TYPE_SECOND.

Referenced by push_type().

static void push_value ( tree  value  )  [static]

tree truthvalue_conversion ( tree  expr  ) 


Variable Documentation

Definition at line 97 of file expr.c.

tree dtable_ident = NULL_TREE

Definition at line 93 of file expr.c.

Definition at line 1642 of file expr.c.

Referenced by build_java_jsr(), and verify_jvm_instructions().

Definition at line 137 of file expr.c.

const unsigned char* linenumber_table

Definition at line 136 of file expr.c.

Referenced by dwarf1_unit_find_nearest_line().

tree methods_ident = NULL_TREE [static]

Definition at line 91 of file expr.c.

tree ncode_ident = NULL_TREE [static]

Definition at line 92 of file expr.c.

tree operand_type[59] [static]

Definition at line 88 of file expr.c.

tree quick_stack = NULL_TREE [static]

Definition at line 126 of file expr.c.

Definition at line 134 of file expr.c.

Referenced by thumb_exit().

tree tree_list_free_list = NULL_TREE [static]

Definition at line 129 of file expr.c.


Generated on Wed Apr 8 15:29:14 2009 for Open64 by  doxygen 1.5.6