Mercurial > hg > graal-jvmci-8
comparison src/share/vm/interpreter/interpreterRuntime.hpp @ 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 | 389049f3f393 |
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. |
38 static Bytecodes::Code code(JavaThread *thread) { | 38 static Bytecodes::Code code(JavaThread *thread) { |
39 // pass method to avoid calling unsafe bcp_to_method (partial fix 4926272) | 39 // pass method to avoid calling unsafe bcp_to_method (partial fix 4926272) |
40 return Bytecodes::code_at(bcp(thread), method(thread)); | 40 return Bytecodes::code_at(bcp(thread), method(thread)); |
41 } | 41 } |
42 static bool already_resolved(JavaThread *thread) { return cache_entry(thread)->is_resolved(code(thread)); } | 42 static bool already_resolved(JavaThread *thread) { return cache_entry(thread)->is_resolved(code(thread)); } |
43 static int one_byte_index(JavaThread *thread) { return bcp(thread)[1]; } | 43 static Bytecode* bytecode(JavaThread *thread) { return Bytecode_at(bcp(thread)); } |
44 static int two_byte_index(JavaThread *thread) { return Bytes::get_Java_u2(bcp(thread) + 1); } | 44 static int get_index_u1(JavaThread *thread, Bytecodes::Code bc) |
45 static int four_byte_index(JavaThread *thread) { return Bytes::get_native_u4(bcp(thread) + 1); } | 45 { return bytecode(thread)->get_index_u1(bc); } |
46 static int get_index_u2(JavaThread *thread, Bytecodes::Code bc) | |
47 { return bytecode(thread)->get_index_u2(bc); } | |
48 static int get_index_u2_cpcache(JavaThread *thread, Bytecodes::Code bc) | |
49 { return bytecode(thread)->get_index_u2_cpcache(bc); } | |
46 static int number_of_dimensions(JavaThread *thread) { return bcp(thread)[3]; } | 50 static int number_of_dimensions(JavaThread *thread) { return bcp(thread)[3]; } |
47 | 51 |
48 static ConstantPoolCacheEntry* cache_entry_at(JavaThread *thread, int i) { return method(thread)->constants()->cache()->entry_at(i); } | 52 static ConstantPoolCacheEntry* cache_entry_at(JavaThread *thread, int i) { return method(thread)->constants()->cache()->entry_at(i); } |
49 static ConstantPoolCacheEntry* cache_entry(JavaThread *thread) { return cache_entry_at(thread, Bytes::get_native_u2(bcp(thread) + 1)); } | 53 static ConstantPoolCacheEntry* cache_entry(JavaThread *thread) { return cache_entry_at(thread, Bytes::get_native_u2(bcp(thread) + 1)); } |
50 static void note_trap(JavaThread *thread, int reason, TRAPS); | 54 static void note_trap(JavaThread *thread, int reason, TRAPS); |