* x86.brg: CPBLK impl.
* emit-x86.c (tree_emit): modified to support 3 nonterminals per
rule (used for CPBLK).
svn path=/trunk/mono/; revision=4896
+2002-05-24 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86.brg: CPBLK impl.
+
+ * emit-x86.c (tree_emit): modified to support 3 nonterminals per
+ rule (used for CPBLK).
Thu May 23 18:43:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
if (nts [0]) {
if (nts [1]) { /* two kids */
MonoRegSet saved_rs;
- if (nts [2]) /* we cant handle three kids */
- g_assert_not_reached ();
if (!tree_allocate_regs (cfg, kids [0], nts [0], rs, left_exclude_mask, spillcount))
return FALSE;
#endif
}
+ if (nts [2]) {
+ if (nts [3]) /* we cant handle four kids */
+ g_assert_not_reached ();
+
+ if (!tree_allocate_regs (cfg, kids [2], nts [2], rs, right_exclude_mask, spillcount))
+ return FALSE;
+
+ }
+
} else { /* one kid */
if (!tree_allocate_regs (cfg, kids [0], nts [0], rs, left_exclude_mask, spillcount))
return FALSE;
if (nts [1]) {
int spilloffset1, spilloffset2, spilloffset3;
- if (nts [2])
- g_assert_not_reached ();
-
tree_emit (nts [0], cfg, kids [0], spillcount);
if (kids [0]->spilled) {
x86_mov_reg_membase (cfg->code, kids [0]->reg1, X86_EBP,
spilloffset1, 4);
}
+
+ if (nts [2]) {
+ g_assert (!nts [3]);
+ tree_emit (nts [2], cfg, kids [2], spillcount);
+ }
} else {
tree_emit (nts [0], cfg, kids [0], spillcount);
}
* stack_trace String.
*/
static gboolean
-arch_exc_is_catched (MonoDomain *domain, MonoJitTlsData *jit_tls, gpointer ip,
- gpointer *bp, gpointer obj)
+arch_exc_is_caught (MonoDomain *domain, MonoJitTlsData *jit_tls, gpointer ip,
+ gpointer *bp, gpointer obj)
{
MonoJitInfo *ji;
gpointer *end_of_stack;
cleanup = jit_tls->abort_func;
- if (!arch_exc_is_catched (domain, jit_tls, ip, (gpointer *)ctx->SC_EBP, obj)) {
+ if (!arch_exc_is_caught (domain, jit_tls, ip, (gpointer *)ctx->SC_EBP, obj)) {
if (mono_debug_format != MONO_DEBUG_FORMAT_NONE) {
mono_debug_make_symbols ();
}
case MONO_TYPE_I1:
case MONO_TYPE_U1:
case MONO_TYPE_BOOLEAN:
+
return MB_TERM_STIND_I1;
case MONO_TYPE_I2:
case MONO_TYPE_U2:
ip += 4;
sp -= 2;
- t1 = mono_ctree_new (mp, MB_TERM_CPOBJ, sp [0], sp [1]);
+ t1 = mono_ctree_new_leaf (mp, MB_TERM_CONST_I4);
+ t1->data.i = mono_class_value_size (class, NULL);
+ t1 = mono_ctree_new (mp, MB_TERM_CPSRC, sp [1], t1);
+ t1 = mono_ctree_new (mp, MB_TERM_CPBLK, sp [0], t1);
ADD_TREE (t1, cli_addr);
break;
PUSH_TREE (t1, VAL_I32);
break;
}
+ case CEE_CPBLK: {
+ ++ip;
+ sp -= 3;
+
+ t1 = mono_ctree_new (mp, MB_TERM_CPSRC, sp [1], sp [2]);
+ t1 = mono_ctree_new (mp, MB_TERM_CPBLK, sp [0], t1);
+ ADD_TREE (t1, cli_addr);
+ break;
+ }
case CEE_UNALIGNED_: {
++ip;
// fixme: implement me
%term DIV DIV_UN REM REM_UN AND OR XOR SHL SHR SHR_UN NEG NOT
%term COMPARE CBRANCH BRTRUE BRFALSE CSET
%term CONV_I4 CONV_I1 CONV_I2 CONV_I8 CONV_U1 CONV_U2 CONV_U4 CONV_U8 CONV_R4 CONV_R8 CONV_R_UN
-%term INTF_ADDR VFUNC_ADDR NOP NEWARR NEWARR_SPEC NEWOBJ NEWOBJ_SPEC NEWSTRUCT CPOBJ POP INITOBJ
+%term INTF_ADDR VFUNC_ADDR NOP NEWARR NEWARR_SPEC NEWOBJ NEWOBJ_SPEC NEWSTRUCT CPBLK CPSRC POP INITOBJ
%term ISINST CASTCLASS UNBOX
%term CONV_OVF_I1 CONV_OVF_U1 CONV_OVF_I2 CONV_OVF_U2 CONV_OVF_U4 CONV_OVF_U8 CONV_OVF_I4
%term CONV_OVF_I4_UN CONV_OVF_U1_UN CONV_OVF_U2_UN
x86_pop_reg (s->code, X86_EAX);
}
+stmt: CPBLK (reg, CPSRC (reg, reg)) {
+ int dest_reg = tree->left->reg1;
+ int source_reg = tree->right->left->reg1;
+ int size_reg = tree->right->right->reg1;
+
+ x86_push_reg (s->code, size_reg);
+ x86_push_reg (s->code, source_reg);
+ x86_push_reg (s->code, dest_reg);
+ mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, memcpy);
+ x86_call_code (s->code, 0);
+ x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, 12);
+}
+
stmt: NOP
stmt: POP (reg)