Mercurial > hg > truffle
comparison src/share/vm/c1/c1_LIRGenerator.cpp @ 2181:d25d4ca69222
Merge.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Wed, 16 Feb 2011 13:47:20 +0100 |
parents | 91fe28b03d6a aa4b04b68652 |
children | 0654ee04b214 |
comparison
equal
deleted
inserted
replaced
2108:50b45e2d9725 | 2181:d25d4ca69222 |
---|---|
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. |
1988 off.load_item(); | 1988 off.load_item(); |
1989 src.load_item(); | 1989 src.load_item(); |
1990 | 1990 |
1991 LIR_Opr reg = reg = rlock_result(x, x->basic_type()); | 1991 LIR_Opr reg = reg = rlock_result(x, x->basic_type()); |
1992 | 1992 |
1993 get_Object_unsafe(reg, src.result(), off.result(), type, x->is_volatile()); | |
1993 if (x->is_volatile() && os::is_MP()) __ membar_acquire(); | 1994 if (x->is_volatile() && os::is_MP()) __ membar_acquire(); |
1994 get_Object_unsafe(reg, src.result(), off.result(), type, x->is_volatile()); | |
1995 if (x->is_volatile() && os::is_MP()) __ membar(); | |
1996 } | 1995 } |
1997 | 1996 |
1998 | 1997 |
1999 void LIRGenerator::do_UnsafePutObject(UnsafePutObject* x) { | 1998 void LIRGenerator::do_UnsafePutObject(UnsafePutObject* x) { |
2000 BasicType type = x->basic_type(); | 1999 BasicType type = x->basic_type(); |
2012 | 2011 |
2013 set_no_result(x); | 2012 set_no_result(x); |
2014 | 2013 |
2015 if (x->is_volatile() && os::is_MP()) __ membar_release(); | 2014 if (x->is_volatile() && os::is_MP()) __ membar_release(); |
2016 put_Object_unsafe(src.result(), off.result(), data.result(), type, x->is_volatile()); | 2015 put_Object_unsafe(src.result(), off.result(), data.result(), type, x->is_volatile()); |
2016 if (x->is_volatile() && os::is_MP()) __ membar(); | |
2017 } | 2017 } |
2018 | 2018 |
2019 | 2019 |
2020 void LIRGenerator::do_UnsafePrefetch(UnsafePrefetch* x, bool is_store) { | 2020 void LIRGenerator::do_UnsafePrefetch(UnsafePrefetch* x, bool is_store) { |
2021 LIRItem src(x->object(), this); | 2021 LIRItem src(x->object(), this); |
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; |