Mercurial > hg > graal-jvmci-8
comparison src/share/vm/c1/c1_LIR.cpp @ 17937:78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
8043029: Change 8037816 breaks HS build with older GCC versions which don't support diagnostic pragmas
8043164: Format warning in traceStream.hpp
Summary: Backport of main fix + two corrections, enables clang compilation, turns on format attributes, corrects/mutes warnings
Reviewed-by: kvn, coleenp, iveresov, twisti
author | drchase |
---|---|
date | Thu, 22 May 2014 15:52:41 -0400 |
parents | 9acbfe04b5c3 |
children | 15766b73dc1d |
comparison
equal
deleted
inserted
replaced
17935:7384f6a12fc1 | 17937:78bbf4d43a14 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2000, 2014, 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. |
1561 } else if (is_double_stack()) { | 1561 } else if (is_double_stack()) { |
1562 out->print("dbl_stack:%d",double_stack_ix()); | 1562 out->print("dbl_stack:%d",double_stack_ix()); |
1563 } else if (is_virtual()) { | 1563 } else if (is_virtual()) { |
1564 out->print("R%d", vreg_number()); | 1564 out->print("R%d", vreg_number()); |
1565 } else if (is_single_cpu()) { | 1565 } else if (is_single_cpu()) { |
1566 out->print(as_register()->name()); | 1566 out->print("%s", as_register()->name()); |
1567 } else if (is_double_cpu()) { | 1567 } else if (is_double_cpu()) { |
1568 out->print(as_register_hi()->name()); | 1568 out->print("%s", as_register_hi()->name()); |
1569 out->print(as_register_lo()->name()); | 1569 out->print("%s", as_register_lo()->name()); |
1570 #if defined(X86) | 1570 #if defined(X86) |
1571 } else if (is_single_xmm()) { | 1571 } else if (is_single_xmm()) { |
1572 out->print(as_xmm_float_reg()->name()); | 1572 out->print("%s", as_xmm_float_reg()->name()); |
1573 } else if (is_double_xmm()) { | 1573 } else if (is_double_xmm()) { |
1574 out->print(as_xmm_double_reg()->name()); | 1574 out->print("%s", as_xmm_double_reg()->name()); |
1575 } else if (is_single_fpu()) { | 1575 } else if (is_single_fpu()) { |
1576 out->print("fpu%d", fpu_regnr()); | 1576 out->print("fpu%d", fpu_regnr()); |
1577 } else if (is_double_fpu()) { | 1577 } else if (is_double_fpu()) { |
1578 out->print("fpu%d", fpu_regnrLo()); | 1578 out->print("fpu%d", fpu_regnrLo()); |
1579 #elif defined(ARM) | 1579 #elif defined(ARM) |
1581 out->print("s%d", fpu_regnr()); | 1581 out->print("s%d", fpu_regnr()); |
1582 } else if (is_double_fpu()) { | 1582 } else if (is_double_fpu()) { |
1583 out->print("d%d", fpu_regnrLo() >> 1); | 1583 out->print("d%d", fpu_regnrLo() >> 1); |
1584 #else | 1584 #else |
1585 } else if (is_single_fpu()) { | 1585 } else if (is_single_fpu()) { |
1586 out->print(as_float_reg()->name()); | 1586 out->print("%s", as_float_reg()->name()); |
1587 } else if (is_double_fpu()) { | 1587 } else if (is_double_fpu()) { |
1588 out->print(as_double_reg()->name()); | 1588 out->print("%s", as_double_reg()->name()); |
1589 #endif | 1589 #endif |
1590 | 1590 |
1591 } else if (is_illegal()) { | 1591 } else if (is_illegal()) { |
1592 out->print("-"); | 1592 out->print("-"); |
1593 } else { | 1593 } else { |
1609 case T_ADDRESS:out->print("address:%d",as_jint()); break; | 1609 case T_ADDRESS:out->print("address:%d",as_jint()); break; |
1610 case T_INT: out->print("int:%d", as_jint()); break; | 1610 case T_INT: out->print("int:%d", as_jint()); break; |
1611 case T_LONG: out->print("lng:" JLONG_FORMAT, as_jlong()); break; | 1611 case T_LONG: out->print("lng:" JLONG_FORMAT, as_jlong()); break; |
1612 case T_FLOAT: out->print("flt:%f", as_jfloat()); break; | 1612 case T_FLOAT: out->print("flt:%f", as_jfloat()); break; |
1613 case T_DOUBLE: out->print("dbl:%f", as_jdouble()); break; | 1613 case T_DOUBLE: out->print("dbl:%f", as_jdouble()); break; |
1614 case T_OBJECT: out->print("obj:0x%x", as_jobject()); break; | 1614 case T_OBJECT: out->print("obj:" INTPTR_FORMAT, p2i(as_jobject())); break; |
1615 case T_METADATA: out->print("metadata:0x%x", as_metadata());break; | 1615 case T_METADATA: out->print("metadata:" INTPTR_FORMAT, p2i(as_metadata()));break; |
1616 default: out->print("%3d:0x%x",type(), as_jdouble()); break; | 1616 default: out->print("%3d:0x" UINT64_FORMAT_X, type(), (uint64_t)as_jlong()); break; |
1617 } | 1617 } |
1618 } | 1618 } |
1619 | 1619 |
1620 // LIR_Address | 1620 // LIR_Address |
1621 void LIR_Address::print_value_on(outputStream* out) const { | 1621 void LIR_Address::print_value_on(outputStream* out) const { |
1627 case times_2: out->print(" * 2"); break; | 1627 case times_2: out->print(" * 2"); break; |
1628 case times_4: out->print(" * 4"); break; | 1628 case times_4: out->print(" * 4"); break; |
1629 case times_8: out->print(" * 8"); break; | 1629 case times_8: out->print(" * 8"); break; |
1630 } | 1630 } |
1631 } | 1631 } |
1632 out->print(" Disp: %d", _disp); | 1632 out->print(" Disp: " INTX_FORMAT, _disp); |
1633 } | 1633 } |
1634 | 1634 |
1635 // debug output of block header without InstructionPrinter | 1635 // debug output of block header without InstructionPrinter |
1636 // (because phi functions are not necessary for LIR) | 1636 // (because phi functions are not necessary for LIR) |
1637 static void print_block(BlockBegin* x) { | 1637 static void print_block(BlockBegin* x) { |
1701 if (id() != -1 || PrintCFGToFile) { | 1701 if (id() != -1 || PrintCFGToFile) { |
1702 out->print("%4d ", id()); | 1702 out->print("%4d ", id()); |
1703 } else { | 1703 } else { |
1704 out->print(" "); | 1704 out->print(" "); |
1705 } | 1705 } |
1706 out->print(name()); out->print(" "); | 1706 out->print("%s ", name()); |
1707 print_instr(out); | 1707 print_instr(out); |
1708 if (info() != NULL) out->print(" [bci:%d]", info()->stack()->bci()); | 1708 if (info() != NULL) out->print(" [bci:%d]", info()->stack()->bci()); |
1709 #ifdef ASSERT | 1709 #ifdef ASSERT |
1710 if (Verbose && _file != NULL) { | 1710 if (Verbose && _file != NULL) { |
1711 out->print(" (%s:%d)", _file, _line); | 1711 out->print(" (%s:%d)", _file, _line); |
1831 } | 1831 } |
1832 | 1832 |
1833 // LIR_OpJavaCall | 1833 // LIR_OpJavaCall |
1834 void LIR_OpJavaCall::print_instr(outputStream* out) const { | 1834 void LIR_OpJavaCall::print_instr(outputStream* out) const { |
1835 out->print("call: "); | 1835 out->print("call: "); |
1836 out->print("[addr: 0x%x]", address()); | 1836 out->print("[addr: " INTPTR_FORMAT "]", p2i(address())); |
1837 if (receiver()->is_valid()) { | 1837 if (receiver()->is_valid()) { |
1838 out->print(" [recv: "); receiver()->print(out); out->print("]"); | 1838 out->print(" [recv: "); receiver()->print(out); out->print("]"); |
1839 } | 1839 } |
1840 if (result_opr()->is_valid()) { | 1840 if (result_opr()->is_valid()) { |
1841 out->print(" [result: "); result_opr()->print(out); out->print("]"); | 1841 out->print(" [result: "); result_opr()->print(out); out->print("]"); |
1842 } | 1842 } |
1843 } | 1843 } |
1844 | 1844 |
1845 // LIR_OpLabel | 1845 // LIR_OpLabel |
1846 void LIR_OpLabel::print_instr(outputStream* out) const { | 1846 void LIR_OpLabel::print_instr(outputStream* out) const { |
1847 out->print("[label:0x%x]", _label); | 1847 out->print("[label:" INTPTR_FORMAT "]", p2i(_label)); |
1848 } | 1848 } |
1849 | 1849 |
1850 // LIR_OpArrayCopy | 1850 // LIR_OpArrayCopy |
1851 void LIR_OpArrayCopy::print_instr(outputStream* out) const { | 1851 void LIR_OpArrayCopy::print_instr(outputStream* out) const { |
1852 src()->print(out); out->print(" "); | 1852 src()->print(out); out->print(" "); |
1909 | 1909 |
1910 | 1910 |
1911 // LIR_Op1 | 1911 // LIR_Op1 |
1912 void LIR_OpRTCall::print_instr(outputStream* out) const { | 1912 void LIR_OpRTCall::print_instr(outputStream* out) const { |
1913 intx a = (intx)addr(); | 1913 intx a = (intx)addr(); |
1914 out->print(Runtime1::name_for_address(addr())); | 1914 out->print("%s", Runtime1::name_for_address(addr())); |
1915 out->print(" "); | 1915 out->print(" "); |
1916 tmp()->print(out); | 1916 tmp()->print(out); |
1917 } | 1917 } |
1918 | 1918 |
1919 void LIR_Op1::print_patch_code(outputStream* out, LIR_PatchCode code) { | 1919 void LIR_Op1::print_patch_code(outputStream* out, LIR_PatchCode code) { |
1932 if (block() != NULL) { | 1932 if (block() != NULL) { |
1933 out->print("[B%d] ", block()->block_id()); | 1933 out->print("[B%d] ", block()->block_id()); |
1934 } else if (stub() != NULL) { | 1934 } else if (stub() != NULL) { |
1935 out->print("["); | 1935 out->print("["); |
1936 stub()->print_name(out); | 1936 stub()->print_name(out); |
1937 out->print(": 0x%x]", stub()); | 1937 out->print(": " INTPTR_FORMAT "]", p2i(stub())); |
1938 if (stub()->info() != NULL) out->print(" [bci:%d]", stub()->info()->stack()->bci()); | 1938 if (stub()->info() != NULL) out->print(" [bci:%d]", stub()->info()->stack()->bci()); |
1939 } else { | 1939 } else { |
1940 out->print("[label:0x%x] ", label()); | 1940 out->print("[label:" INTPTR_FORMAT "] ", p2i(label())); |
1941 } | 1941 } |
1942 if (ublock() != NULL) { | 1942 if (ublock() != NULL) { |
1943 out->print("unordered: [B%d] ", ublock()->block_id()); | 1943 out->print("unordered: [B%d] ", ublock()->block_id()); |
1944 } | 1944 } |
1945 } | 1945 } |
2002 tmp2()->print(out); out->print(" "); | 2002 tmp2()->print(out); out->print(" "); |
2003 tmp3()->print(out); out->print(" "); | 2003 tmp3()->print(out); out->print(" "); |
2004 tmp4()->print(out); out->print(" "); | 2004 tmp4()->print(out); out->print(" "); |
2005 out->print("[hdr:%d]", header_size()); out->print(" "); | 2005 out->print("[hdr:%d]", header_size()); out->print(" "); |
2006 out->print("[obj:%d]", object_size()); out->print(" "); | 2006 out->print("[obj:%d]", object_size()); out->print(" "); |
2007 out->print("[lbl:0x%x]", stub()->entry()); | 2007 out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry())); |
2008 } | 2008 } |
2009 | 2009 |
2010 void LIR_OpRoundFP::print_instr(outputStream* out) const { | 2010 void LIR_OpRoundFP::print_instr(outputStream* out) const { |
2011 _opr->print(out); out->print(" "); | 2011 _opr->print(out); out->print(" "); |
2012 tmp()->print(out); out->print(" "); | 2012 tmp()->print(out); out->print(" "); |
2035 tmp1()->print(out); out->print(" "); | 2035 tmp1()->print(out); out->print(" "); |
2036 tmp2()->print(out); out->print(" "); | 2036 tmp2()->print(out); out->print(" "); |
2037 tmp3()->print(out); out->print(" "); | 2037 tmp3()->print(out); out->print(" "); |
2038 tmp4()->print(out); out->print(" "); | 2038 tmp4()->print(out); out->print(" "); |
2039 out->print("[type:0x%x]", type()); out->print(" "); | 2039 out->print("[type:0x%x]", type()); out->print(" "); |
2040 out->print("[label:0x%x]", stub()->entry()); | 2040 out->print("[label:" INTPTR_FORMAT "]", p2i(stub()->entry())); |
2041 } | 2041 } |
2042 | 2042 |
2043 | 2043 |
2044 void LIR_OpTypeCheck::print_instr(outputStream* out) const { | 2044 void LIR_OpTypeCheck::print_instr(outputStream* out) const { |
2045 object()->print(out); out->print(" "); | 2045 object()->print(out); out->print(" "); |
2072 obj_opr()->print(out); out->print(" "); | 2072 obj_opr()->print(out); out->print(" "); |
2073 lock_opr()->print(out); out->print(" "); | 2073 lock_opr()->print(out); out->print(" "); |
2074 if (_scratch->is_valid()) { | 2074 if (_scratch->is_valid()) { |
2075 _scratch->print(out); out->print(" "); | 2075 _scratch->print(out); out->print(" "); |
2076 } | 2076 } |
2077 out->print("[lbl:0x%x]", stub()->entry()); | 2077 out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry())); |
2078 } | 2078 } |
2079 | 2079 |
2080 #ifdef ASSERT | 2080 #ifdef ASSERT |
2081 void LIR_OpAssert::print_instr(outputStream* out) const { | 2081 void LIR_OpAssert::print_instr(outputStream* out) const { |
2082 print_condition(out, condition()); out->print(" "); | 2082 print_condition(out, condition()); out->print(" "); |
2083 in_opr1()->print(out); out->print(" "); | 2083 in_opr1()->print(out); out->print(" "); |
2084 in_opr2()->print(out); out->print(", \""); | 2084 in_opr2()->print(out); out->print(", \""); |
2085 out->print(msg()); out->print("\""); | 2085 out->print("%s", msg()); out->print("\""); |
2086 } | 2086 } |
2087 #endif | 2087 #endif |
2088 | 2088 |
2089 | 2089 |
2090 void LIR_OpDelay::print_instr(outputStream* out) const { | 2090 void LIR_OpDelay::print_instr(outputStream* out) const { |