Mercurial > hg > graal-jvmci-8
comparison src/share/vm/interpreter/interpreterRuntime.hpp @ 2142:8012aa3ccede
4926272: methodOopDesc::method_from_bcp is unsafe
Reviewed-by: coleenp, jrose, kvn, dcubed
author | never |
---|---|
date | Thu, 13 Jan 2011 22:15:41 -0800 |
parents | f95d63e2154a |
children | 633a44a9fc45 |
comparison
equal
deleted
inserted
replaced
2130:34d64ad817f4 | 2142:8012aa3ccede |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2011, 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. |
56 static address bcp(JavaThread *thread) { return last_frame(thread).interpreter_frame_bcp(); } | 56 static address bcp(JavaThread *thread) { return last_frame(thread).interpreter_frame_bcp(); } |
57 static int bci(JavaThread *thread) { return last_frame(thread).interpreter_frame_bci(); } | 57 static int bci(JavaThread *thread) { return last_frame(thread).interpreter_frame_bci(); } |
58 static void set_bcp_and_mdp(address bcp, JavaThread*thread); | 58 static void set_bcp_and_mdp(address bcp, JavaThread*thread); |
59 static Bytecodes::Code code(JavaThread *thread) { | 59 static Bytecodes::Code code(JavaThread *thread) { |
60 // pass method to avoid calling unsafe bcp_to_method (partial fix 4926272) | 60 // pass method to avoid calling unsafe bcp_to_method (partial fix 4926272) |
61 return Bytecodes::code_at(bcp(thread), method(thread)); | 61 return Bytecodes::code_at(method(thread), bcp(thread)); |
62 } | 62 } |
63 static bool already_resolved(JavaThread *thread) { return cache_entry(thread)->is_resolved(code(thread)); } | 63 static bool already_resolved(JavaThread *thread) { return cache_entry(thread)->is_resolved(code(thread)); } |
64 static Bytecode* bytecode(JavaThread *thread) { return Bytecode_at(bcp(thread)); } | 64 static Bytecode bytecode(JavaThread *thread) { return Bytecode(method(thread), bcp(thread)); } |
65 static int get_index_u1(JavaThread *thread, Bytecodes::Code bc) | 65 static int get_index_u1(JavaThread *thread, Bytecodes::Code bc) |
66 { return bytecode(thread)->get_index_u1(bc); } | 66 { return bytecode(thread).get_index_u1(bc); } |
67 static int get_index_u2(JavaThread *thread, Bytecodes::Code bc) | 67 static int get_index_u2(JavaThread *thread, Bytecodes::Code bc) |
68 { return bytecode(thread)->get_index_u2(bc); } | 68 { return bytecode(thread).get_index_u2(bc); } |
69 static int get_index_u2_cpcache(JavaThread *thread, Bytecodes::Code bc) | 69 static int get_index_u2_cpcache(JavaThread *thread, Bytecodes::Code bc) |
70 { return bytecode(thread)->get_index_u2_cpcache(bc); } | 70 { return bytecode(thread).get_index_u2_cpcache(bc); } |
71 static int number_of_dimensions(JavaThread *thread) { return bcp(thread)[3]; } | 71 static int number_of_dimensions(JavaThread *thread) { return bcp(thread)[3]; } |
72 | 72 |
73 static ConstantPoolCacheEntry* cache_entry_at(JavaThread *thread, int i) { return method(thread)->constants()->cache()->entry_at(i); } | 73 static ConstantPoolCacheEntry* cache_entry_at(JavaThread *thread, int i) { return method(thread)->constants()->cache()->entry_at(i); } |
74 static ConstantPoolCacheEntry* cache_entry(JavaThread *thread) { return cache_entry_at(thread, Bytes::get_native_u2(bcp(thread) + 1)); } | 74 static ConstantPoolCacheEntry* cache_entry(JavaThread *thread) { return cache_entry_at(thread, Bytes::get_native_u2(bcp(thread) + 1)); } |
75 static void note_trap(JavaThread *thread, int reason, TRAPS); | 75 static void note_trap(JavaThread *thread, int reason, TRAPS); |