Mercurial > hg > truffle
comparison src/share/vm/graal/graalCompiler.hpp @ 10567:7cd21876c116
Revert bytecode indexes back to Java endianess.
author | twisti |
---|---|
date | Thu, 27 Jun 2013 22:18:52 -0700 |
parents | 4720f96a15b7 |
children | 359f7e70ae7f |
comparison
equal
deleted
inserted
replaced
10566:a6632ef9c84d | 10567:7cd21876c116 |
---|---|
83 | 83 |
84 static BasicType kindToBasicType(jchar ch); | 84 static BasicType kindToBasicType(jchar ch); |
85 | 85 |
86 static int to_cp_index_u2(int index) { | 86 static int to_cp_index_u2(int index) { |
87 // Tag. | 87 // Tag. |
88 return to_index_u2(index) + ConstantPool::CPCACHE_INDEX_TAG; | 88 return index + ConstantPool::CPCACHE_INDEX_TAG; |
89 } | |
90 | |
91 static int to_index_u2(int index) { | |
92 // Swap. | |
93 return ((index & 0xFF) << 8) | (index >> 8); | |
94 } | |
95 | |
96 static int to_index_u4(int index) { | |
97 // Swap. | |
98 return ((index & 0xFF) << 24) | ((index & 0xFF00) << 8) | ((index & 0xFF0000) >> 8) | ((index & 0xFF000000) >> 24); | |
99 } | 89 } |
100 | 90 |
101 static int to_cp_index(int raw_index, Bytecodes::Code bc) { | 91 static int to_cp_index(int raw_index, Bytecodes::Code bc) { |
102 int cp_index; | 92 int cp_index; |
103 if (bc == Bytecodes::_invokedynamic) { | 93 if (bc == Bytecodes::_invokedynamic) { |
104 cp_index = to_index_u4(raw_index); | 94 cp_index = raw_index; |
105 assert(ConstantPool::is_invokedynamic_index(cp_index), "not an invokedynamic constant pool index"); | 95 assert(ConstantPool::is_invokedynamic_index(cp_index), "not an invokedynamic constant pool index"); |
106 } else { | 96 } else { |
107 assert(bc == Bytecodes::_getfield || bc == Bytecodes::_putfield || | 97 assert(bc == Bytecodes::_getfield || bc == Bytecodes::_putfield || |
108 bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic || | 98 bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic || |
109 bc == Bytecodes::_invokeinterface || bc == Bytecodes::_invokevirtual || | 99 bc == Bytecodes::_invokeinterface || bc == Bytecodes::_invokevirtual || |