comparison src/share/vm/c1/c1_LIRGenerator.cpp @ 1339:09ac706c2623

Merge
author asaha
date Wed, 24 Mar 2010 17:16:33 -0700
parents 6deeaebad47a
children 3cf667df43ef
comparison
equal deleted inserted replaced
1338:f5dd08ad65df 1339:09ac706c2623
1 /* 1 /*
2 * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 2005-2010 Sun Microsystems, Inc. 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.
1763 (x->exception()->as_NewInstance() == NULL && x->exception()->as_ExceptionObject() == NULL)) { 1763 (x->exception()->as_NewInstance() == NULL && x->exception()->as_ExceptionObject() == NULL)) {
1764 // if the exception object wasn't created using new then it might be null. 1764 // if the exception object wasn't created using new then it might be null.
1765 __ null_check(exception_opr, new CodeEmitInfo(info, true)); 1765 __ null_check(exception_opr, new CodeEmitInfo(info, true));
1766 } 1766 }
1767 1767
1768 if (compilation()->env()->jvmti_can_post_exceptions() && 1768 if (compilation()->env()->jvmti_can_post_on_exceptions() &&
1769 !block()->is_set(BlockBegin::default_exception_handler_flag)) { 1769 !block()->is_set(BlockBegin::default_exception_handler_flag)) {
1770 // we need to go through the exception lookup path to get JVMTI 1770 // we need to go through the exception lookup path to get JVMTI
1771 // notification done 1771 // notification done
1772 unwind = false; 1772 unwind = false;
1773 } 1773 }
1853 if (index_op->is_constant()) { 1853 if (index_op->is_constant()) {
1854 assert(log2_scale == 0, "must not have a scale"); 1854 assert(log2_scale == 0, "must not have a scale");
1855 addr = new LIR_Address(base_op, index_op->as_jint(), dst_type); 1855 addr = new LIR_Address(base_op, index_op->as_jint(), dst_type);
1856 } else { 1856 } else {
1857 #ifdef X86 1857 #ifdef X86
1858 #ifdef _LP64
1859 if (!index_op->is_illegal() && index_op->type() == T_INT) {
1860 LIR_Opr tmp = new_pointer_register();
1861 __ convert(Bytecodes::_i2l, index_op, tmp);
1862 index_op = tmp;
1863 }
1864 #endif
1858 addr = new LIR_Address(base_op, index_op, LIR_Address::Scale(log2_scale), 0, dst_type); 1865 addr = new LIR_Address(base_op, index_op, LIR_Address::Scale(log2_scale), 0, dst_type);
1859 #else 1866 #else
1860 if (index_op->is_illegal() || log2_scale == 0) { 1867 if (index_op->is_illegal() || log2_scale == 0) {
1868 #ifdef _LP64
1869 if (!index_op->is_illegal() && index_op->type() == T_INT) {
1870 LIR_Opr tmp = new_pointer_register();
1871 __ convert(Bytecodes::_i2l, index_op, tmp);
1872 index_op = tmp;
1873 }
1874 #endif
1861 addr = new LIR_Address(base_op, index_op, dst_type); 1875 addr = new LIR_Address(base_op, index_op, dst_type);
1862 } else { 1876 } else {
1863 LIR_Opr tmp = new_register(T_INT); 1877 LIR_Opr tmp = new_pointer_register();
1864 __ shift_left(index_op, log2_scale, tmp); 1878 __ shift_left(index_op, log2_scale, tmp);
1865 addr = new LIR_Address(base_op, tmp, dst_type); 1879 addr = new LIR_Address(base_op, tmp, dst_type);
1866 } 1880 }
1867 #endif 1881 #endif
1868 } 1882 }
1913 #endif 1927 #endif
1914 1928
1915 LIR_Opr index_op = idx.result(); 1929 LIR_Opr index_op = idx.result();
1916 if (log2_scale != 0) { 1930 if (log2_scale != 0) {
1917 // temporary fix (platform dependent code without shift on Intel would be better) 1931 // temporary fix (platform dependent code without shift on Intel would be better)
1918 index_op = new_register(T_INT); 1932 index_op = new_pointer_register();
1919 __ move(idx.result(), index_op); 1933 #ifdef _LP64
1934 if(idx.result()->type() == T_INT) {
1935 __ convert(Bytecodes::_i2l, idx.result(), index_op);
1936 } else {
1937 #endif
1938 __ move(idx.result(), index_op);
1939 #ifdef _LP64
1940 }
1941 #endif
1920 __ shift_left(index_op, log2_scale, index_op); 1942 __ shift_left(index_op, log2_scale, index_op);
1921 } 1943 }
1944 #ifdef _LP64
1945 else if(!index_op->is_illegal() && index_op->type() == T_INT) {
1946 LIR_Opr tmp = new_pointer_register();
1947 __ convert(Bytecodes::_i2l, index_op, tmp);
1948 index_op = tmp;
1949 }
1950 #endif
1922 1951
1923 LIR_Address* addr = new LIR_Address(base_op, index_op, x->basic_type()); 1952 LIR_Address* addr = new LIR_Address(base_op, index_op, x->basic_type());
1924 __ move(value.result(), addr); 1953 __ move(value.result(), addr);
1925 } 1954 }
1926 1955