equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2016, 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. |
125 return _method->code_size(); // fix this |
125 return _method->code_size(); // fix this |
126 //return _method->estimated_inline_cost(_receiverKlass); |
126 //return _method->estimated_inline_cost(_receiverKlass); |
127 } |
127 } |
128 |
128 |
129 int CompiledRFrame::cost() const { |
129 int CompiledRFrame::cost() const { |
130 nmethod* nm = top_method()->code(); |
130 CompiledMethod* nm = top_method()->code(); |
131 if (nm != NULL) { |
131 if (nm != NULL) { |
132 return nm->insts_size(); |
132 return nm->insts_size(); |
133 } else { |
133 } else { |
134 return top_method()->code_size(); |
134 return top_method()->code_size(); |
135 } |
135 } |
137 |
137 |
138 void CompiledRFrame::init() { |
138 void CompiledRFrame::init() { |
139 RegisterMap map(thread(), false); |
139 RegisterMap map(thread(), false); |
140 vframe* vf = vframe::new_vframe(&_fr, &map, thread()); |
140 vframe* vf = vframe::new_vframe(&_fr, &map, thread()); |
141 assert(vf->is_compiled_frame(), "must be compiled"); |
141 assert(vf->is_compiled_frame(), "must be compiled"); |
142 _nm = compiledVFrame::cast(vf)->code(); |
142 _nm = compiledVFrame::cast(vf)->code()->as_nmethod(); |
143 vf = vf->top(); |
143 vf = vf->top(); |
144 _vf = javaVFrame::cast(vf); |
144 _vf = javaVFrame::cast(vf); |
145 _method = CodeCache::find_nmethod(_fr.pc())->method(); |
145 _method = CodeCache::find_nmethod(_fr.pc())->method(); |
146 assert(_method, "should have found a method"); |
146 assert(_method, "should have found a method"); |
147 #ifndef PRODUCT |
147 #ifndef PRODUCT |