comparison src/share/vm/c1/c1_LIRGenerator.hpp @ 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 f95d63e2154a
comparison
equal deleted inserted replaced
1782:f353275af40e 1783:d5d065957597
1 /* 1 /*
2 * Copyright (c) 2005, 2006, 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.
194 194
195 // get a constant into a register and get track of what register was used 195 // get a constant into a register and get track of what register was used
196 LIR_Opr load_constant(Constant* x); 196 LIR_Opr load_constant(Constant* x);
197 LIR_Opr load_constant(LIR_Const* constant); 197 LIR_Opr load_constant(LIR_Const* constant);
198 198
199 // Given an immediate value, return an operand usable in logical ops.
200 LIR_Opr load_immediate(int x, BasicType type);
201
199 void set_result(Value x, LIR_Opr opr) { 202 void set_result(Value x, LIR_Opr opr) {
200 assert(opr->is_valid(), "must set to valid value"); 203 assert(opr->is_valid(), "must set to valid value");
201 assert(x->operand()->is_illegal(), "operand should never change"); 204 assert(x->operand()->is_illegal(), "operand should never change");
202 assert(!opr->is_register() || opr->is_virtual(), "should never set result to a physical register"); 205 assert(!opr->is_register() || opr->is_virtual(), "should never set result to a physical register");
203 x->set_operand(opr); 206 x->set_operand(opr);
211 friend class LIRItem; 214 friend class LIRItem;
212 215
213 LIR_Opr round_item(LIR_Opr opr); 216 LIR_Opr round_item(LIR_Opr opr);
214 LIR_Opr force_to_spill(LIR_Opr value, BasicType t); 217 LIR_Opr force_to_spill(LIR_Opr value, BasicType t);
215 218
216 void profile_branch(If* if_instr, If::Condition cond);
217
218 PhiResolverState& resolver_state() { return _resolver_state; } 219 PhiResolverState& resolver_state() { return _resolver_state; }
219 220
220 void move_to_phi(PhiResolver* resolver, Value cur_val, Value sux_val); 221 void move_to_phi(PhiResolver* resolver, Value cur_val, Value sux_val);
221 void move_to_phi(ValueStack* cur_state); 222 void move_to_phi(ValueStack* cur_state);
222 223
283 void put_Object_unsafe(LIR_Opr src, LIR_Opr offset, LIR_Opr data, BasicType type, bool is_volatile); 284 void put_Object_unsafe(LIR_Opr src, LIR_Opr offset, LIR_Opr data, BasicType type, bool is_volatile);
284 void get_Object_unsafe(LIR_Opr dest, LIR_Opr src, LIR_Opr offset, BasicType type, bool is_volatile); 285 void get_Object_unsafe(LIR_Opr dest, LIR_Opr src, LIR_Opr offset, BasicType type, bool is_volatile);
285 286
286 void arithmetic_call_op (Bytecodes::Code code, LIR_Opr result, LIR_OprList* args); 287 void arithmetic_call_op (Bytecodes::Code code, LIR_Opr result, LIR_OprList* args);
287 288
288 void increment_counter(address counter, int step = 1); 289 void increment_counter(address counter, BasicType type, int step = 1);
289 void increment_counter(LIR_Address* addr, int step = 1); 290 void increment_counter(LIR_Address* addr, int step = 1);
290
291 // increment a counter returning the incremented value
292 LIR_Opr increment_and_return_counter(LIR_Opr base, int offset, int increment);
293 291
294 // is_strictfp is only needed for mul and div (and only generates different code on i486) 292 // is_strictfp is only needed for mul and div (and only generates different code on i486)
295 void arithmetic_op(Bytecodes::Code code, LIR_Opr result, LIR_Opr left, LIR_Opr right, bool is_strictfp, LIR_Opr tmp, CodeEmitInfo* info = NULL); 293 void arithmetic_op(Bytecodes::Code code, LIR_Opr result, LIR_Opr left, LIR_Opr right, bool is_strictfp, LIR_Opr tmp, CodeEmitInfo* info = NULL);
296 // machine dependent. returns true if it emitted code for the multiply 294 // machine dependent. returns true if it emitted code for the multiply
297 bool strength_reduce_multiply(LIR_Opr left, int constant, LIR_Opr result, LIR_Opr tmp); 295 bool strength_reduce_multiply(LIR_Opr left, int constant, LIR_Opr result, LIR_Opr tmp);
345 bool can_inline_as_constant(Value i) const; 343 bool can_inline_as_constant(Value i) const;
346 bool can_inline_as_constant(LIR_Const* c) const; 344 bool can_inline_as_constant(LIR_Const* c) const;
347 bool can_store_as_constant(Value i, BasicType type) const; 345 bool can_store_as_constant(Value i, BasicType type) const;
348 346
349 LIR_Opr safepoint_poll_register(); 347 LIR_Opr safepoint_poll_register();
350 void increment_invocation_counter(CodeEmitInfo* info, bool backedge = false); 348
351 void increment_backedge_counter(CodeEmitInfo* info) { 349 void profile_branch(If* if_instr, If::Condition cond);
352 increment_invocation_counter(info, true); 350 void increment_event_counter_impl(CodeEmitInfo* info,
351 ciMethod *method, int frequency,
352 int bci, bool backedge, bool notify);
353 void increment_event_counter(CodeEmitInfo* info, int bci, bool backedge);
354 void increment_invocation_counter(CodeEmitInfo *info) {
355 if (compilation()->count_invocations()) {
356 increment_event_counter(info, InvocationEntryBci, false);
357 }
358 }
359 void increment_backedge_counter(CodeEmitInfo* info, int bci) {
360 if (compilation()->count_backedges()) {
361 increment_event_counter(info, bci, true);
362 }
353 } 363 }
354 364
355 CodeEmitInfo* state_for(Instruction* x, ValueStack* state, bool ignore_xhandler = false); 365 CodeEmitInfo* state_for(Instruction* x, ValueStack* state, bool ignore_xhandler = false);
356 CodeEmitInfo* state_for(Instruction* x); 366 CodeEmitInfo* state_for(Instruction* x);
357 367
501 virtual void do_UnsafeGetObject(UnsafeGetObject* x); 511 virtual void do_UnsafeGetObject(UnsafeGetObject* x);
502 virtual void do_UnsafePutObject(UnsafePutObject* x); 512 virtual void do_UnsafePutObject(UnsafePutObject* x);
503 virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x); 513 virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x);
504 virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x); 514 virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x);
505 virtual void do_ProfileCall (ProfileCall* x); 515 virtual void do_ProfileCall (ProfileCall* x);
506 virtual void do_ProfileCounter (ProfileCounter* x); 516 virtual void do_ProfileInvoke (ProfileInvoke* x);
507 }; 517 };
508 518
509 519
510 class LIRItem: public CompilationResourceObj { 520 class LIRItem: public CompilationResourceObj {
511 private: 521 private: