Mercurial > hg > graal-compiler
comparison src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @ 1783:d5d065957597
6953144: Tiered compilation
Summary: Infrastructure for tiered compilation support (interpreter + c1 + c2) for 32 and 64 bit. Simple tiered policy implementation.
Reviewed-by: kvn, never, phh, twisti
author | iveresov |
---|---|
date | Fri, 03 Sep 2010 17:51:07 -0700 |
parents | 126ea7725993 |
children | 3a294e483abc |
comparison
equal
deleted
inserted
replaced
1782:f353275af40e | 1783:d5d065957597 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
180 return addr; | 180 return addr; |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 | 184 |
185 void LIRGenerator::increment_counter(address counter, int step) { | 185 LIR_Opr LIRGenerator::load_immediate(int x, BasicType type) { |
186 LIR_Opr r; | |
187 if (type == T_LONG) { | |
188 r = LIR_OprFact::longConst(x); | |
189 } else if (type == T_INT) { | |
190 r = LIR_OprFact::intConst(x); | |
191 } else { | |
192 ShouldNotReachHere(); | |
193 } | |
194 return r; | |
195 } | |
196 | |
197 void LIRGenerator::increment_counter(address counter, BasicType type, int step) { | |
186 LIR_Opr pointer = new_pointer_register(); | 198 LIR_Opr pointer = new_pointer_register(); |
187 __ move(LIR_OprFact::intptrConst(counter), pointer); | 199 __ move(LIR_OprFact::intptrConst(counter), pointer); |
188 LIR_Address* addr = new LIR_Address(pointer, T_INT); | 200 LIR_Address* addr = new LIR_Address(pointer, type); |
189 increment_counter(addr, step); | 201 increment_counter(addr, step); |
190 } | 202 } |
191 | 203 |
192 | 204 |
193 void LIRGenerator::increment_counter(LIR_Address* addr, int step) { | 205 void LIRGenerator::increment_counter(LIR_Address* addr, int step) { |
194 __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr); | 206 __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr); |
195 } | 207 } |
196 | |
197 | 208 |
198 void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) { | 209 void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) { |
199 __ cmp_mem_int(condition, base, disp, c, info); | 210 __ cmp_mem_int(condition, base, disp, c, info); |
200 } | 211 } |
201 | 212 |
1186 } | 1197 } |
1187 | 1198 |
1188 // add safepoint before generating condition code so it can be recomputed | 1199 // add safepoint before generating condition code so it can be recomputed |
1189 if (x->is_safepoint()) { | 1200 if (x->is_safepoint()) { |
1190 // increment backedge counter if needed | 1201 // increment backedge counter if needed |
1191 increment_backedge_counter(state_for(x, x->state_before())); | 1202 increment_backedge_counter(state_for(x, x->state_before()), x->profiled_bci()); |
1192 | |
1193 __ safepoint(LIR_OprFact::illegalOpr, state_for(x, x->state_before())); | 1203 __ safepoint(LIR_OprFact::illegalOpr, state_for(x, x->state_before())); |
1194 } | 1204 } |
1195 set_no_result(x); | 1205 set_no_result(x); |
1196 | 1206 |
1197 LIR_Opr left = xin->result(); | 1207 LIR_Opr left = xin->result(); |
1198 LIR_Opr right = yin->result(); | 1208 LIR_Opr right = yin->result(); |
1199 __ cmp(lir_cond(cond), left, right); | 1209 __ cmp(lir_cond(cond), left, right); |
1210 // Generate branch profiling. Profiling code doesn't kill flags. | |
1200 profile_branch(x, cond); | 1211 profile_branch(x, cond); |
1201 move_to_phi(x->state()); | 1212 move_to_phi(x->state()); |
1202 if (x->x()->type()->is_float_kind()) { | 1213 if (x->x()->type()->is_float_kind()) { |
1203 __ branch(lir_cond(cond), right->type(), x->tsux(), x->usux()); | 1214 __ branch(lir_cond(cond), right->type(), x->tsux(), x->usux()); |
1204 } else { | 1215 } else { |