hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
changeset 8066 919e5489b292
parent 7895 e71bad345f3a
parent 8065 7ca689ce3d32
child 8671 13ffa40a2f0a
equal deleted inserted replaced
8064:309d15dfd9ae 8066:919e5489b292
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2011, 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.
  2739     __ branch(lir_cond_equal, T_INT, overflow);
  2739     __ branch(lir_cond_equal, T_INT, overflow);
  2740     __ branch_destination(overflow->continuation());
  2740     __ branch_destination(overflow->continuation());
  2741   }
  2741   }
  2742 }
  2742 }
  2743 
  2743 
       
  2744 void LIRGenerator::do_RuntimeCall(RuntimeCall* x) {
       
  2745   LIR_OprList* args = new LIR_OprList(x->number_of_arguments());
       
  2746   BasicTypeList* signature = new BasicTypeList(x->number_of_arguments());
       
  2747 
       
  2748   if (x->pass_thread()) {
       
  2749     signature->append(T_ADDRESS);
       
  2750     args->append(getThreadPointer());
       
  2751   }
       
  2752 
       
  2753   for (int i = 0; i < x->number_of_arguments(); i++) {
       
  2754     Value a = x->argument_at(i);
       
  2755     LIRItem* item = new LIRItem(a, this);
       
  2756     item->load_item();
       
  2757     args->append(item->result());
       
  2758     signature->append(as_BasicType(a->type()));
       
  2759   }
       
  2760 
       
  2761   LIR_Opr result = call_runtime(signature, args, x->entry(), x->type(), NULL);
       
  2762   if (x->type() == voidType) {
       
  2763     set_no_result(x);
       
  2764   } else {
       
  2765     __ move(result, rlock_result(x));
       
  2766   }
       
  2767 }
       
  2768 
  2744 LIR_Opr LIRGenerator::call_runtime(Value arg1, address entry, ValueType* result_type, CodeEmitInfo* info) {
  2769 LIR_Opr LIRGenerator::call_runtime(Value arg1, address entry, ValueType* result_type, CodeEmitInfo* info) {
  2745   LIRItemList args(1);
  2770   LIRItemList args(1);
  2746   LIRItem value(arg1, this);
  2771   LIRItem value(arg1, this);
  2747   args.append(&value);
  2772   args.append(&value);
  2748   BasicTypeList signature;
  2773   BasicTypeList signature;