* mini-amd64.c (mono_arch_output_basic_block): Add some micro optimizations.
(mono_arch_emit_prolog): Increment maximum prolog size.
* mini-amd64.c inssel-amd64.brg cpu-amd64.md: Move the implementation of the
START_HANDLER/ENDFINALLY/ENDFILTER opcodes to mini-amd64.c.
svn path=/trunk/mono/; revision=89854
2007-11-17 Zoltan Varga <vargaz@gmail.com>
+ * mini-amd64.c (mono_arch_output_basic_block): Add some micro optimizations.
+ (mono_arch_emit_prolog): Increment maximum prolog size.
+
+ * mini-amd64.c inssel-amd64.brg cpu-amd64.md: Move the implementation of the
+ START_HANDLER/ENDFINALLY/ENDFILTER opcodes to mini-amd64.c.
+
* mini-x86.c (get_call_info): Receive a MonoCompile instead of a
MonoGenericSharingContext.
conv.u4: dest:i src1:i len:3
conv.u8: dest:i src1:i len:3
conv.r.un: dest:f src1:i len:8
+
throw: src1:i len:18
op_rethrow: src1:i len:18
+start_handler: len:9
+endfinally: len:9
+op_endfilter: src1:a len:9
+
conv.ovf.i4.un: dest:i src1:i len:16
conv.ovf.u4.un:
conv.ovf.u4: dest:i src1:i len:15
reg: CEE_LDIND_I2 (OP_REGVAR) {
MONO_EMIT_UNALU (s, tree, OP_SEXT_I2, state->reg1, state->left->tree->dreg);}
-stmt: OP_START_HANDLER {
- MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
- MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, spvar->inst_basereg, spvar->inst_offset, X86_ESP);
-}
-
+stmt: OP_START_HANDLER,
stmt: OP_ENDFINALLY {
- MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
- MONO_EMIT_NEW_LOAD_MEMBASE (s, X86_ESP, spvar->inst_basereg, spvar->inst_offset);
- tree->opcode = CEE_RET;
mono_bblock_add_inst (s->cbb, tree);
}
stmt: OP_ENDFILTER (reg) {
- MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
- MONO_EMIT_NEW_UNALU (s, OP_MOVE, X86_EAX, state->left->reg1);
- MONO_EMIT_NEW_LOAD_MEMBASE (s, X86_ESP, spvar->inst_basereg, spvar->inst_offset);
- tree->opcode = CEE_RET;
+ tree->sreg1 = state->left->reg1;
mono_bblock_add_inst (s->cbb, tree);
}
max_len = ((guint8 *)ins_get_spec (ins->opcode))[MONO_INST_LEN];
- if (offset > (cfg->code_size - max_len - 16)) {
+ if (G_UNLIKELY (offset > (cfg->code_size - max_len - 16))) {
cfg->code_size *= 2;
cfg->native_code = g_realloc (cfg->native_code, cfg->code_size);
code = cfg->native_code + offset;
mono_jit_stats.code_reallocs++;
}
- mono_debug_record_line_number (cfg, ins, offset);
+ if (cfg->debug_info)
+ mono_debug_record_line_number (cfg, ins, offset);
switch (ins->opcode) {
case OP_BIGMUL:
/* Restore stack alignment */
amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 8);
break;
+ case OP_START_HANDLER: {
+ MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region);
+ amd64_mov_membase_reg (code, spvar->inst_basereg, spvar->inst_offset, AMD64_RSP, 8);
+ break;
+ }
+ case OP_ENDFINALLY: {
+ MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region);
+ amd64_mov_reg_membase (code, AMD64_RSP, spvar->inst_basereg, spvar->inst_offset, 8);
+ amd64_ret (code);
+ break;
+ }
+ case OP_ENDFILTER: {
+ MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region);
+ amd64_mov_reg_membase (code, AMD64_RSP, spvar->inst_basereg, spvar->inst_offset, 8);
+ /* The local allocator will put the result into RAX */
+ amd64_ret (code);
+ break;
+ }
case OP_LABEL:
ins->inst_c0 = code - cfg->native_code;
CallInfo *cinfo;
gint32 lmf_offset = cfg->arch.lmf_offset;
- cfg->code_size = MAX (((MonoMethodNormal *)method)->header->code_size * 4, 1024);
-
- if (cfg->prof_options & MONO_PROFILE_ENTER_LEAVE)
- cfg->code_size += 512;
+ cfg->code_size = MAX (((MonoMethodNormal *)method)->header->code_size * 4, 10240);
code = cfg->native_code = g_malloc (cfg->code_size);