Mercurial > hg > truffle
comparison src/share/vm/oops/methodOop.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 | 3582bf76420e |
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. |
194 | 194 |
195 // Static routine in the situations we don't have a methodOop | 195 // Static routine in the situations we don't have a methodOop |
196 static char* name_and_sig_as_C_string(Klass* klass, symbolOop method_name, symbolOop signature); | 196 static char* name_and_sig_as_C_string(Klass* klass, symbolOop method_name, symbolOop signature); |
197 static char* name_and_sig_as_C_string(Klass* klass, symbolOop method_name, symbolOop signature, char* buf, int size); | 197 static char* name_and_sig_as_C_string(Klass* klass, symbolOop method_name, symbolOop signature, char* buf, int size); |
198 | 198 |
199 Bytecodes::Code java_code_at(int bci) const { | |
200 return Bytecodes::java_code_at(this, bcp_from(bci)); | |
201 } | |
202 Bytecodes::Code code_at(int bci) const { | |
203 return Bytecodes::code_at(this, bcp_from(bci)); | |
204 } | |
205 | |
199 // JVMTI breakpoints | 206 // JVMTI breakpoints |
200 Bytecodes::Code orig_bytecode_at(int bci); | 207 Bytecodes::Code orig_bytecode_at(int bci) const; |
201 void set_orig_bytecode_at(int bci, Bytecodes::Code code); | 208 void set_orig_bytecode_at(int bci, Bytecodes::Code code); |
202 void set_breakpoint(int bci); | 209 void set_breakpoint(int bci); |
203 void clear_breakpoint(int bci); | 210 void clear_breakpoint(int bci); |
204 void clear_all_breakpoints(); | 211 void clear_all_breakpoints(); |
205 // Tracking number of breakpoints, for fullspeed debugging. | 212 // Tracking number of breakpoints, for fullspeed debugging. |
652 | 659 |
653 // Background compilation support | 660 // Background compilation support |
654 bool queued_for_compilation() const { return access_flags().queued_for_compilation(); } | 661 bool queued_for_compilation() const { return access_flags().queued_for_compilation(); } |
655 void set_queued_for_compilation() { _access_flags.set_queued_for_compilation(); } | 662 void set_queued_for_compilation() { _access_flags.set_queued_for_compilation(); } |
656 void clear_queued_for_compilation() { _access_flags.clear_queued_for_compilation(); } | 663 void clear_queued_for_compilation() { _access_flags.clear_queued_for_compilation(); } |
657 | |
658 static methodOop method_from_bcp(address bcp); | |
659 | 664 |
660 // Resolve all classes in signature, return 'true' if successful | 665 // Resolve all classes in signature, return 'true' if successful |
661 static bool load_signature_classes(methodHandle m, TRAPS); | 666 static bool load_signature_classes(methodHandle m, TRAPS); |
662 | 667 |
663 // Return if true if not all classes references in signature, including return type, has been loaded | 668 // Return if true if not all classes references in signature, including return type, has been loaded |
785 | 790 |
786 BreakpointInfo* next() const { return _next; } | 791 BreakpointInfo* next() const { return _next; } |
787 void set_next(BreakpointInfo* n) { _next = n; } | 792 void set_next(BreakpointInfo* n) { _next = n; } |
788 | 793 |
789 // helps for searchers | 794 // helps for searchers |
790 bool match(methodOop m, int bci) { | 795 bool match(const methodOopDesc* m, int bci) { |
791 return bci == _bci && match(m); | 796 return bci == _bci && match(m); |
792 } | 797 } |
793 | 798 |
794 bool match(methodOop m) { | 799 bool match(const methodOopDesc* m) { |
795 return _name_index == m->name_index() && | 800 return _name_index == m->name_index() && |
796 _signature_index == m->signature_index(); | 801 _signature_index == m->signature_index(); |
797 } | 802 } |
798 | 803 |
799 void set(methodOop method); | 804 void set(methodOop method); |