0N/A/*
2273N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
1879N/A#include "precompiled.hpp"
1879N/A#include "classfile/javaClasses.hpp"
1879N/A#include "classfile/systemDictionary.hpp"
1879N/A#include "classfile/vmSymbols.hpp"
1879N/A#include "code/codeCache.hpp"
1879N/A#include "code/debugInfoRec.hpp"
1879N/A#include "code/nmethod.hpp"
1879N/A#include "code/pcDesc.hpp"
1879N/A#include "code/scopeDesc.hpp"
1879N/A#include "interpreter/interpreter.hpp"
1879N/A#include "interpreter/oopMapCache.hpp"
1879N/A#include "memory/resourceArea.hpp"
1879N/A#include "oops/instanceKlass.hpp"
1879N/A#include "oops/oop.inline.hpp"
1879N/A#include "runtime/handles.inline.hpp"
1879N/A#include "runtime/objectMonitor.hpp"
1879N/A#include "runtime/objectMonitor.inline.hpp"
1879N/A#include "runtime/signature.hpp"
1879N/A#include "runtime/stubRoutines.hpp"
1879N/A#include "runtime/synchronizer.hpp"
1879N/A#include "runtime/vframe.hpp"
1879N/A#include "runtime/vframeArray.hpp"
1879N/A#include "runtime/vframe_hp.hpp"
0N/A
0N/Avframe::vframe(const frame* fr, const RegisterMap* reg_map, JavaThread* thread)
0N/A: _reg_map(reg_map), _thread(thread) {
0N/A assert(fr != NULL, "must have frame");
0N/A _fr = *fr;
0N/A}
0N/A
0N/Avframe::vframe(const frame* fr, JavaThread* thread)
0N/A: _reg_map(thread), _thread(thread) {
0N/A assert(fr != NULL, "must have frame");
0N/A _fr = *fr;
0N/A}
0N/A
0N/Avframe* vframe::new_vframe(const frame* f, const RegisterMap* reg_map, JavaThread* thread) {
0N/A // Interpreter frame
0N/A if (f->is_interpreted_frame()) {
0N/A return new interpretedVFrame(f, reg_map, thread);
0N/A }
0N/A
0N/A // Compiled frame
0N/A CodeBlob* cb = f->cb();
0N/A if (cb != NULL) {
0N/A if (cb->is_nmethod()) {
0N/A nmethod* nm = (nmethod*)cb;
0N/A return new compiledVFrame(f, reg_map, thread, nm);
0N/A }
0N/A
0N/A if (f->is_runtime_frame()) {
0N/A // Skip this frame and try again.
0N/A RegisterMap temp_map = *reg_map;
0N/A frame s = f->sender(&temp_map);
0N/A return new_vframe(&s, &temp_map, thread);
0N/A }
0N/A }
0N/A
0N/A // External frame
0N/A return new externalVFrame(f, reg_map, thread);
0N/A}
0N/A
0N/Avframe* vframe::sender() const {
0N/A RegisterMap temp_map = *register_map();
0N/A assert(is_top(), "just checking");
0N/A if (_fr.is_entry_frame() && _fr.is_first_frame()) return NULL;
0N/A frame s = _fr.real_sender(&temp_map);
0N/A if (s.is_first_frame()) return NULL;
0N/A return vframe::new_vframe(&s, &temp_map, thread());
0N/A}
0N/A
0N/Avframe* vframe::top() const {
0N/A vframe* vf = (vframe*) this;
0N/A while (!vf->is_top()) vf = vf->sender();
0N/A return vf;
0N/A}
0N/A
0N/A
0N/AjavaVFrame* vframe::java_sender() const {
0N/A vframe* f = sender();
0N/A while (f != NULL) {
0N/A if (f->is_java_frame()) return javaVFrame::cast(f);
0N/A f = f->sender();
0N/A }
0N/A return NULL;
0N/A}
0N/A
0N/A// ------------- javaVFrame --------------
0N/A
0N/AGrowableArray<MonitorInfo*>* javaVFrame::locked_monitors() {
0N/A assert(SafepointSynchronize::is_at_safepoint() || JavaThread::current() == thread(),
0N/A "must be at safepoint or it's a java frame of the current thread");
0N/A
0N/A GrowableArray<MonitorInfo*>* mons = monitors();
0N/A GrowableArray<MonitorInfo*>* result = new GrowableArray<MonitorInfo*>(mons->length());
0N/A if (mons->is_empty()) return result;
0N/A
0N/A bool found_first_monitor = false;
0N/A ObjectMonitor *pending_monitor = thread()->current_pending_monitor();
0N/A ObjectMonitor *waiting_monitor = thread()->current_waiting_monitor();
1467N/A oop pending_obj = (pending_monitor != NULL ? (oop) pending_monitor->object() : (oop) NULL);
1467N/A oop waiting_obj = (waiting_monitor != NULL ? (oop) waiting_monitor->object() : (oop) NULL);
0N/A
0N/A for (int index = (mons->length()-1); index >= 0; index--) {
0N/A MonitorInfo* monitor = mons->at(index);
818N/A if (monitor->eliminated() && is_compiled_frame()) continue; // skip eliminated monitor
0N/A oop obj = monitor->owner();
0N/A if (obj == NULL) continue; // skip unowned monitor
0N/A //
0N/A // Skip the monitor that the thread is blocked to enter or waiting on
0N/A //
0N/A if (!found_first_monitor && (obj == pending_obj || obj == waiting_obj)) {
0N/A continue;
0N/A }
0N/A found_first_monitor = true;
0N/A result->append(monitor);
0N/A }
0N/A return result;
0N/A}
0N/A
0N/Astatic void print_locked_object_class_name(outputStream* st, Handle obj, const char* lock_state) {
0N/A if (obj.not_null()) {
0N/A st->print("\t- %s <" INTPTR_FORMAT "> ", lock_state, (address)obj());
1142N/A if (obj->klass() == SystemDictionary::Class_klass()) {
0N/A klassOop target_klass = java_lang_Class::as_klassOop(obj());
0N/A st->print_cr("(a java.lang.Class for %s)", instanceKlass::cast(target_klass)->external_name());
0N/A } else {
0N/A Klass* k = Klass::cast(obj->klass());
0N/A st->print_cr("(a %s)", k->external_name());
0N/A }
0N/A }
0N/A}
0N/A
0N/Avoid javaVFrame::print_lock_info_on(outputStream* st, int frame_count) {
0N/A ResourceMark rm;
0N/A
0N/A // If this is the first frame, and java.lang.Object.wait(...) then print out the receiver.
0N/A if (frame_count == 0) {
0N/A if (method()->name() == vmSymbols::wait_name() &&
0N/A instanceKlass::cast(method()->method_holder())->name() == vmSymbols::java_lang_Object()) {
0N/A StackValueCollection* locs = locals();
0N/A if (!locs->is_empty()) {
0N/A StackValue* sv = locs->at(0);
0N/A if (sv->type() == T_OBJECT) {
0N/A Handle o = locs->at(0)->get_obj();
0N/A print_locked_object_class_name(st, o, "waiting on");
0N/A }
0N/A }
0N/A } else if (thread()->current_park_blocker() != NULL) {
0N/A oop obj = thread()->current_park_blocker();
0N/A Klass* k = Klass::cast(obj->klass());
0N/A st->print_cr("\t- %s <" INTPTR_FORMAT "> (a %s)", "parking to wait for ", (address)obj, k->external_name());
0N/A }
0N/A }
0N/A
0N/A
0N/A // Print out all monitors that we have locked or are trying to lock
0N/A GrowableArray<MonitorInfo*>* mons = monitors();
0N/A if (!mons->is_empty()) {
0N/A bool found_first_monitor = false;
0N/A for (int index = (mons->length()-1); index >= 0; index--) {
0N/A MonitorInfo* monitor = mons->at(index);
818N/A if (monitor->eliminated() && is_compiled_frame()) { // Eliminated in compiled code
818N/A if (monitor->owner_is_scalar_replaced()) {
818N/A Klass* k = Klass::cast(monitor->owner_klass());
818N/A st->print("\t- eliminated <owner is scalar replaced> (a %s)", k->external_name());
818N/A } else {
818N/A oop obj = monitor->owner();
818N/A if (obj != NULL) {
818N/A print_locked_object_class_name(st, obj, "eliminated");
818N/A }
818N/A }
818N/A continue;
818N/A }
0N/A if (monitor->owner() != NULL) {
0N/A
0N/A // First, assume we have the monitor locked. If we haven't found an
0N/A // owned monitor before and this is the first frame, then we need to
0N/A // see if we have completed the lock or we are blocked trying to
0N/A // acquire it - we can only be blocked if the monitor is inflated
0N/A
0N/A const char *lock_state = "locked"; // assume we have the monitor locked
0N/A if (!found_first_monitor && frame_count == 0) {
818N/A markOop mark = monitor->owner()->mark();
818N/A if (mark->has_monitor() &&
818N/A mark->monitor() == thread()->current_pending_monitor()) {
0N/A lock_state = "waiting to lock";
818N/A }
0N/A }
0N/A
0N/A found_first_monitor = true;
0N/A print_locked_object_class_name(st, monitor->owner(), lock_state);
0N/A }
0N/A }
0N/A }
0N/A}
0N/A
0N/A// ------------- interpretedVFrame --------------
0N/A
0N/Au_char* interpretedVFrame::bcp() const {
0N/A return fr().interpreter_frame_bcp();
0N/A}
0N/A
0N/Avoid interpretedVFrame::set_bcp(u_char* bcp) {
0N/A fr().interpreter_frame_set_bcp(bcp);
0N/A}
0N/A
0N/Aintptr_t* interpretedVFrame::locals_addr_at(int offset) const {
0N/A assert(fr().is_interpreted_frame(), "frame should be an interpreted frame");
0N/A return fr().interpreter_frame_local_at(offset);
0N/A}
0N/A
0N/A
0N/AGrowableArray<MonitorInfo*>* interpretedVFrame::monitors() const {
0N/A GrowableArray<MonitorInfo*>* result = new GrowableArray<MonitorInfo*>(5);
0N/A for (BasicObjectLock* current = (fr().previous_monitor_in_interpreter_frame(fr().interpreter_frame_monitor_begin()));
0N/A current >= fr().interpreter_frame_monitor_end();
0N/A current = fr().previous_monitor_in_interpreter_frame(current)) {
818N/A result->push(new MonitorInfo(current->obj(), current->lock(), false, false));
0N/A }
0N/A return result;
0N/A}
0N/A
0N/Aint interpretedVFrame::bci() const {
0N/A return method()->bci_from(bcp());
0N/A}
0N/A
0N/AmethodOop interpretedVFrame::method() const {
0N/A return fr().interpreter_frame_method();
0N/A}
0N/A
0N/AStackValueCollection* interpretedVFrame::locals() const {
0N/A int length = method()->max_locals();
0N/A
0N/A if (method()->is_native()) {
0N/A // If the method is native, max_locals is not telling the truth.
0N/A // maxlocals then equals the size of parameters
0N/A length = method()->size_of_parameters();
0N/A }
0N/A
0N/A StackValueCollection* result = new StackValueCollection(length);
0N/A
0N/A // Get oopmap describing oops and int for current bci
1426N/A InterpreterOopMap oop_mask;
1426N/A if (TraceDeoptimization && Verbose) {
1426N/A methodHandle m_h(thread(), method());
1426N/A OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask);
0N/A } else {
1426N/A method()->mask_for(bci(), &oop_mask);
1426N/A }
1426N/A // handle locals
1426N/A for(int i=0; i < length; i++) {
1426N/A // Find stack location
1426N/A intptr_t *addr = locals_addr_at(i);
0N/A
1426N/A // Depending on oop/int put it in the right package
1426N/A StackValue *sv;
1426N/A if (oop_mask.is_oop(i)) {
1426N/A // oop value
1426N/A Handle h(*(oop *)addr);
1426N/A sv = new StackValue(h);
1426N/A } else {
1426N/A // integer
1426N/A sv = new StackValue(*addr);
0N/A }
1426N/A assert(sv != NULL, "sanity check");
1426N/A result->add(sv);
0N/A }
0N/A return result;
0N/A}
0N/A
0N/Avoid interpretedVFrame::set_locals(StackValueCollection* values) const {
0N/A if (values == NULL || values->size() == 0) return;
0N/A
0N/A int length = method()->max_locals();
0N/A if (method()->is_native()) {
0N/A // If the method is native, max_locals is not telling the truth.
0N/A // maxlocals then equals the size of parameters
0N/A length = method()->size_of_parameters();
0N/A }
0N/A
0N/A assert(length == values->size(), "Mismatch between actual stack format and supplied data");
0N/A
0N/A // handle locals
0N/A for (int i = 0; i < length; i++) {
0N/A // Find stack location
0N/A intptr_t *addr = locals_addr_at(i);
0N/A
0N/A // Depending on oop/int put it in the right package
0N/A StackValue *sv = values->at(i);
0N/A assert(sv != NULL, "sanity check");
0N/A if (sv->type() == T_OBJECT) {
0N/A *(oop *) addr = (sv->get_obj())();
0N/A } else { // integer
0N/A *addr = sv->get_int();
0N/A }
0N/A }
0N/A}
0N/A
0N/AStackValueCollection* interpretedVFrame::expressions() const {
0N/A int length = fr().interpreter_frame_expression_stack_size();
0N/A if (method()->is_native()) {
0N/A // If the method is native, there is no expression stack
0N/A length = 0;
0N/A }
0N/A
0N/A int nof_locals = method()->max_locals();
0N/A StackValueCollection* result = new StackValueCollection(length);
0N/A
1426N/A InterpreterOopMap oop_mask;
1426N/A // Get oopmap describing oops and int for current bci
1426N/A if (TraceDeoptimization && Verbose) {
1426N/A methodHandle m_h(method());
1426N/A OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask);
0N/A } else {
1426N/A method()->mask_for(bci(), &oop_mask);
1426N/A }
1426N/A // handle expressions
1426N/A for(int i=0; i < length; i++) {
1426N/A // Find stack location
1426N/A intptr_t *addr = fr().interpreter_frame_expression_stack_at(i);
0N/A
1426N/A // Depending on oop/int put it in the right package
1426N/A StackValue *sv;
1426N/A if (oop_mask.is_oop(i + nof_locals)) {
1426N/A // oop value
1426N/A Handle h(*(oop *)addr);
1426N/A sv = new StackValue(h);
1426N/A } else {
1426N/A // integer
1426N/A sv = new StackValue(*addr);
0N/A }
1426N/A assert(sv != NULL, "sanity check");
1426N/A result->add(sv);
0N/A }
0N/A return result;
0N/A}
0N/A
0N/A
0N/A// ------------- cChunk --------------
0N/A
0N/AentryVFrame::entryVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread)
0N/A: externalVFrame(fr, reg_map, thread) {}
0N/A
0N/A
0N/Avoid vframeStreamCommon::found_bad_method_frame() {
0N/A // 6379830 Cut point for an assertion that occasionally fires when
0N/A // we are using the performance analyzer.
0N/A // Disable this assert when testing the analyzer with fastdebug.
0N/A // -XX:SuppressErrorAt=vframe.cpp:XXX (XXX=following line number)
0N/A assert(false, "invalid bci or invalid scope desc");
0N/A}
0N/A
0N/A// top-frame will be skipped
0N/AvframeStream::vframeStream(JavaThread* thread, frame top_frame,
0N/A bool stop_at_java_call_stub) : vframeStreamCommon(thread) {
0N/A _stop_at_java_call_stub = stop_at_java_call_stub;
0N/A
0N/A // skip top frame, as it may not be at safepoint
0N/A _frame = top_frame.sender(&_reg_map);
0N/A while (!fill_from_frame()) {
0N/A _frame = _frame.sender(&_reg_map);
0N/A }
0N/A}
0N/A
0N/A
0N/A// Step back n frames, skip any pseudo frames in between.
0N/A// This function is used in Class.forName, Class.newInstance, Method.Invoke,
0N/A// AccessController.doPrivileged.
0N/A//
0N/A// NOTE that in JDK 1.4 this has been exposed to Java as
0N/A// sun.reflect.Reflection.getCallerClass(), which can be inlined.
0N/A// Inlined versions must match this routine's logic.
0N/A// Native method prefixing logic does not need to match since
0N/A// the method names don't match and inlining will not occur.
0N/A// See, for example,
0N/A// Parse::inline_native_Reflection_getCallerClass in
0N/A// opto/library_call.cpp.
0N/Avoid vframeStreamCommon::security_get_caller_frame(int depth) {
0N/A bool use_new_reflection = JDK_Version::is_gte_jdk14x_version() && UseNewReflection;
0N/A
0N/A while (!at_end()) {
0N/A if (Universe::reflect_invoke_cache()->is_same_method(method())) {
0N/A // This is Method.invoke() -- skip it
0N/A } else if (use_new_reflection &&
0N/A Klass::cast(method()->method_holder())
1142N/A ->is_subclass_of(SystemDictionary::reflect_MethodAccessorImpl_klass())) {
0N/A // This is an auxilary frame -- skip it
3932N/A } else if (method()->is_method_handle_intrinsic() ||
3932N/A method()->is_compiled_lambda_form()) {
3932N/A // This is an internal adapter frame for method handles -- skip it
0N/A } else {
0N/A // This is non-excluded frame, we need to count it against the depth
0N/A if (depth-- <= 0) {
0N/A // we have reached the desired depth, we are done
0N/A break;
0N/A }
0N/A }
0N/A if (method()->is_prefixed_native()) {
0N/A skip_prefixed_method_and_wrappers();
0N/A } else {
0N/A next();
0N/A }
0N/A }
0N/A}
0N/A
0N/A
0N/Avoid vframeStreamCommon::skip_prefixed_method_and_wrappers() {
0N/A ResourceMark rm;
0N/A HandleMark hm;
0N/A
0N/A int method_prefix_count = 0;
0N/A char** method_prefixes = JvmtiExport::get_all_native_method_prefixes(&method_prefix_count);
0N/A KlassHandle prefixed_klass(method()->method_holder());
0N/A const char* prefixed_name = method()->name()->as_C_string();
0N/A size_t prefixed_name_len = strlen(prefixed_name);
0N/A int prefix_index = method_prefix_count-1;
0N/A
0N/A while (!at_end()) {
0N/A next();
0N/A if (method()->method_holder() != prefixed_klass()) {
0N/A break; // classes don't match, can't be a wrapper
0N/A }
0N/A const char* name = method()->name()->as_C_string();
0N/A size_t name_len = strlen(name);
0N/A size_t prefix_len = prefixed_name_len - name_len;
0N/A if (prefix_len <= 0 || strcmp(name, prefixed_name + prefix_len) != 0) {
0N/A break; // prefixed name isn't prefixed version of method name, can't be a wrapper
0N/A }
0N/A for (; prefix_index >= 0; --prefix_index) {
0N/A const char* possible_prefix = method_prefixes[prefix_index];
0N/A size_t possible_prefix_len = strlen(possible_prefix);
0N/A if (possible_prefix_len == prefix_len &&
0N/A strncmp(possible_prefix, prefixed_name, prefix_len) == 0) {
0N/A break; // matching prefix found
0N/A }
0N/A }
0N/A if (prefix_index < 0) {
0N/A break; // didn't find the prefix, can't be a wrapper
0N/A }
0N/A prefixed_name = name;
0N/A prefixed_name_len = name_len;
0N/A }
0N/A}
0N/A
0N/A
0N/Avoid vframeStreamCommon::skip_reflection_related_frames() {
0N/A while (!at_end() &&
0N/A (JDK_Version::is_gte_jdk14x_version() && UseNewReflection &&
1142N/A (Klass::cast(method()->method_holder())->is_subclass_of(SystemDictionary::reflect_MethodAccessorImpl_klass()) ||
1142N/A Klass::cast(method()->method_holder())->is_subclass_of(SystemDictionary::reflect_ConstructorAccessorImpl_klass())))) {
0N/A next();
0N/A }
0N/A}
0N/A
0N/A
0N/A#ifndef PRODUCT
0N/Avoid vframe::print() {
0N/A if (WizardMode) _fr.print_value_on(tty,NULL);
0N/A}
0N/A
0N/A
0N/Avoid vframe::print_value() const {
0N/A ((vframe*)this)->print();
0N/A}
0N/A
0N/A
0N/Avoid entryVFrame::print_value() const {
0N/A ((entryVFrame*)this)->print();
0N/A}
0N/A
0N/Avoid entryVFrame::print() {
0N/A vframe::print();
0N/A tty->print_cr("C Chunk inbetween Java");
0N/A tty->print_cr("C link " INTPTR_FORMAT, _fr.link());
0N/A}
0N/A
0N/A
0N/A// ------------- javaVFrame --------------
0N/A
0N/Astatic void print_stack_values(const char* title, StackValueCollection* values) {
0N/A if (values->is_empty()) return;
0N/A tty->print_cr("\t%s:", title);
0N/A values->print();
0N/A}
0N/A
0N/A
0N/Avoid javaVFrame::print() {
0N/A ResourceMark rm;
0N/A vframe::print();
0N/A tty->print("\t");
0N/A method()->print_value();
0N/A tty->cr();
0N/A tty->print_cr("\tbci: %d", bci());
0N/A
0N/A print_stack_values("locals", locals());
0N/A print_stack_values("expressions", expressions());
0N/A
0N/A GrowableArray<MonitorInfo*>* list = monitors();
0N/A if (list->is_empty()) return;
0N/A tty->print_cr("\tmonitor list:");
0N/A for (int index = (list->length()-1); index >= 0; index--) {
0N/A MonitorInfo* monitor = list->at(index);
818N/A tty->print("\t obj\t");
818N/A if (monitor->owner_is_scalar_replaced()) {
818N/A Klass* k = Klass::cast(monitor->owner_klass());
818N/A tty->print("( is scalar replaced %s)", k->external_name());
818N/A } else if (monitor->owner() == NULL) {
818N/A tty->print("( null )");
818N/A } else {
818N/A monitor->owner()->print_value();
818N/A tty->print("(" INTPTR_FORMAT ")", (address)monitor->owner());
818N/A }
818N/A if (monitor->eliminated() && is_compiled_frame())
818N/A tty->print(" ( lock is eliminated )");
0N/A tty->cr();
0N/A tty->print("\t ");
0N/A monitor->lock()->print_on(tty);
0N/A tty->cr();
0N/A }
0N/A}
0N/A
0N/A
0N/Avoid javaVFrame::print_value() const {
0N/A methodOop m = method();
0N/A klassOop k = m->method_holder();
0N/A tty->print_cr("frame( sp=" INTPTR_FORMAT ", unextended_sp=" INTPTR_FORMAT ", fp=" INTPTR_FORMAT ", pc=" INTPTR_FORMAT ")",
0N/A _fr.sp(), _fr.unextended_sp(), _fr.fp(), _fr.pc());
0N/A tty->print("%s.%s", Klass::cast(k)->internal_name(), m->name()->as_C_string());
0N/A
0N/A if (!m->is_native()) {
2062N/A Symbol* source_name = instanceKlass::cast(k)->source_file_name();
0N/A int line_number = m->line_number_from_bci(bci());
0N/A if (source_name != NULL && (line_number != -1)) {
0N/A tty->print("(%s:%d)", source_name->as_C_string(), line_number);
0N/A }
0N/A } else {
0N/A tty->print("(Native Method)");
0N/A }
0N/A // Check frame size and print warning if it looks suspiciously large
0N/A if (fr().sp() != NULL) {
793N/A RegisterMap map = *register_map();
793N/A uint size = fr().frame_size(&map);
0N/A#ifdef _LP64
0N/A if (size > 8*K) warning("SUSPICIOUSLY LARGE FRAME (%d)", size);
0N/A#else
0N/A if (size > 4*K) warning("SUSPICIOUSLY LARGE FRAME (%d)", size);
0N/A#endif
0N/A }
0N/A}
0N/A
0N/A
0N/Abool javaVFrame::structural_compare(javaVFrame* other) {
0N/A // Check static part
0N/A if (method() != other->method()) return false;
0N/A if (bci() != other->bci()) return false;
0N/A
0N/A // Check locals
0N/A StackValueCollection *locs = locals();
0N/A StackValueCollection *other_locs = other->locals();
0N/A assert(locs->size() == other_locs->size(), "sanity check");
0N/A int i;
0N/A for(i = 0; i < locs->size(); i++) {
0N/A // it might happen the compiler reports a conflict and
0N/A // the interpreter reports a bogus int.
0N/A if ( is_compiled_frame() && locs->at(i)->type() == T_CONFLICT) continue;
0N/A if (other->is_compiled_frame() && other_locs->at(i)->type() == T_CONFLICT) continue;
0N/A
0N/A if (!locs->at(i)->equal(other_locs->at(i)))
0N/A return false;
0N/A }
0N/A
0N/A // Check expressions
0N/A StackValueCollection* exprs = expressions();
0N/A StackValueCollection* other_exprs = other->expressions();
0N/A assert(exprs->size() == other_exprs->size(), "sanity check");
0N/A for(i = 0; i < exprs->size(); i++) {
0N/A if (!exprs->at(i)->equal(other_exprs->at(i)))
0N/A return false;
0N/A }
0N/A
0N/A return true;
0N/A}
0N/A
0N/A
0N/Avoid javaVFrame::print_activation(int index) const {
0N/A // frame number and method
0N/A tty->print("%2d - ", index);
0N/A ((vframe*)this)->print_value();
0N/A tty->cr();
0N/A
0N/A if (WizardMode) {
0N/A ((vframe*)this)->print();
0N/A tty->cr();
0N/A }
0N/A}
0N/A
0N/A
0N/Avoid javaVFrame::verify() const {
0N/A}
0N/A
0N/A
0N/Avoid interpretedVFrame::verify() const {
0N/A}
0N/A
0N/A
0N/A// ------------- externalVFrame --------------
0N/A
0N/Avoid externalVFrame::print() {
0N/A _fr.print_value_on(tty,NULL);
0N/A}
0N/A
0N/A
0N/Avoid externalVFrame::print_value() const {
0N/A ((vframe*)this)->print();
0N/A}
0N/A#endif // PRODUCT