--- a/hotspot/src/share/vm/oops/methodOop.cpp Wed Jan 12 13:59:18 2011 -0800
+++ b/hotspot/src/share/vm/oops/methodOop.cpp Thu Jan 13 22:15:41 2011 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -150,17 +150,6 @@
return -1;
}
-methodOop methodOopDesc::method_from_bcp(address bcp) {
- debug_only(static int count = 0; count++);
- assert(Universe::heap()->is_in_permanent(bcp), "bcp not in perm_gen");
- // TO DO: this may be unsafe in some configurations
- HeapWord* p = Universe::heap()->block_start(bcp);
- assert(Universe::heap()->block_is_obj(p), "must be obj");
- assert(oop(p)->is_constMethod(), "not a method");
- return constMethodOop(p)->method();
-}
-
-
void methodOopDesc::mask_for(int bci, InterpreterOopMap* mask) {
Thread* myThread = Thread::current();
@@ -469,11 +458,10 @@
bool methodOopDesc::is_accessor() const {
if (code_size() != 5) return false;
if (size_of_parameters() != 1) return false;
- methodOop m = (methodOop)this; // pass to code_at() to avoid method_from_bcp
- if (Bytecodes::java_code_at(code_base()+0, m) != Bytecodes::_aload_0 ) return false;
- if (Bytecodes::java_code_at(code_base()+1, m) != Bytecodes::_getfield) return false;
- if (Bytecodes::java_code_at(code_base()+4, m) != Bytecodes::_areturn &&
- Bytecodes::java_code_at(code_base()+4, m) != Bytecodes::_ireturn ) return false;
+ if (java_code_at(0) != Bytecodes::_aload_0 ) return false;
+ if (java_code_at(1) != Bytecodes::_getfield) return false;
+ if (java_code_at(4) != Bytecodes::_areturn &&
+ java_code_at(4) != Bytecodes::_ireturn ) return false;
return true;
}
@@ -1414,7 +1402,7 @@
}
-Bytecodes::Code methodOopDesc::orig_bytecode_at(int bci) {
+Bytecodes::Code methodOopDesc::orig_bytecode_at(int bci) const {
BreakpointInfo* bp = instanceKlass::cast(method_holder())->breakpoints();
for (; bp != NULL; bp = bp->next()) {
if (bp->match(this, bci)) {