Mercurial > hg > graal-jvmci-8
comparison src/share/vm/oops/constantPoolOop.cpp @ 1565:ab102d5d923e
6939207: refactor constant pool index processing
Summary: Factored cleanup of instruction decode which prepares for enhanced ldc semantics.
Reviewed-by: twisti
author | jrose |
---|---|
date | Sun, 23 May 2010 01:38:26 -0700 |
parents | 4ce7240d622c |
children | e9ff18c4ace7 |
comparison
equal
deleted
inserted
replaced
1564:61b2245abf36 | 1565:ab102d5d923e |
---|---|
1 /* | 1 /* |
2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright 1997-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. |
295 } | 295 } |
296 | 296 |
297 | 297 |
298 | 298 |
299 int constantPoolOopDesc::remap_instruction_operand_from_cache(int operand) { | 299 int constantPoolOopDesc::remap_instruction_operand_from_cache(int operand) { |
300 // Operand was fetched by a stream using get_Java_u2, yet was stored | 300 int cpc_index = operand; |
301 // by Rewriter::rewrite_member_reference in native order. | 301 DEBUG_ONLY(cpc_index -= CPCACHE_INDEX_TAG); |
302 // So now we have to fix the damage by swapping back to native order. | 302 assert((int)(u2)cpc_index == cpc_index, "clean u2"); |
303 assert((int)(u2)operand == operand, "clean u2"); | |
304 int cpc_index = Bytes::swap_u2(operand); | |
305 int member_index = cache()->entry_at(cpc_index)->constant_pool_index(); | 303 int member_index = cache()->entry_at(cpc_index)->constant_pool_index(); |
306 return member_index; | 304 return member_index; |
307 } | 305 } |
308 | 306 |
309 | 307 |