src/share/vm/runtime/frame.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/runtime/frame.cpp	Thu Dec  3 11:54:41 2009
--- new/src/share/vm/runtime/frame.cpp	Thu Dec  3 11:54:41 2009

*** 1,7 **** --- 1,7 ---- /* ! * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. ! * Copyright 1997-2009 Sun Microsystems, Inc. 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 769,779 **** --- 769,779 ---- class InterpretedArgumentOopFinder: public SignatureInfo { private: OopClosure* _f; // Closure to invoke int _offset; // TOS-relative offset, decremented with each argument ! bool _is_static; // true if the callee is a static method ! bool _has_receiver; // true if the callee has a receiver frame* _fr; void set(int size, BasicType type) { _offset -= size; if (type == T_OBJECT || type == T_ARRAY) oop_offset_do();
*** 784,808 **** --- 784,807 ---- addr = (oop*)_fr->interpreter_frame_tos_at(_offset); _f->do_oop(addr); } public: ! InterpretedArgumentOopFinder(symbolHandle signature, bool is_static, frame* fr, OopClosure* f) : SignatureInfo(signature) { ! InterpretedArgumentOopFinder(symbolHandle signature, bool has_receiver, frame* fr, OopClosure* f) : SignatureInfo(signature), _has_receiver(has_receiver) { // compute size of arguments ! int args_size = ArgumentSizeComputer(signature).size() + (is_static ? 0 : 1); ! int args_size = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0); assert(!fr->is_interpreted_frame() || args_size <= fr->interpreter_frame_expression_stack_size(), "args cannot be on stack anymore"); // initialize InterpretedArgumentOopFinder _f = f; _fr = fr; _offset = args_size; _is_static = is_static; } void oops_do() { ! if (!_is_static) { ! if (_has_receiver) { --_offset; oop_offset_do(); } iterate_parameters(); }
*** 910,930 **** --- 909,929 ---- } int max_locals = m->is_native() ? m->size_of_parameters() : m->max_locals(); symbolHandle signature; ! bool is_static = false; ! bool has_receiver = false; // Process a callee's arguments if we are at a call site // (i.e., if we are at an invoke bytecode) // This is used sometimes for calling into the VM, not for another // interpreted or compiled frame. if (!m->is_native()) { Bytecode_invoke *call = Bytecode_invoke_at_check(m, bci); if (call != NULL) { signature = symbolHandle(thread, call->signature()); ! is_static = call->is_invokestatic(); ! has_receiver = call->has_receiver(); if (map->include_argument_oops() && interpreter_frame_expression_stack_size() > 0) { ResourceMark rm(thread); // is this right ??? // we are at a call site & the expression stack is not empty // => process callee's arguments
*** 934,944 **** --- 933,943 ---- // cases we empty the expression stack completely be- // fore handling the exception (the exception handling // code in the interpreter calls a blocking runtime // routine which can cause this code to be executed). // (was bug gri 7/27/98) ! oops_interpreted_arguments_do(signature, is_static, f); ! oops_interpreted_arguments_do(signature, has_receiver, f); } } } if (TaggedStackInterpreter) {
*** 948,958 **** --- 947,957 ---- InterpreterOopMap oopmap_mask; OopMapCache::compute_one_oop_map(m, bci, &oopmap_mask); mask = &oopmap_mask; #endif // ASSERT oops_interpreted_locals_do(f, max_locals, mask); ! oops_interpreted_expressions_do(f, signature, is_static, ! oops_interpreted_expressions_do(f, signature, has_receiver, m->max_stack(), max_locals, mask); } else { InterpreterFrameClosure blk(this, max_locals, m->max_stack(), f);
*** 990,1000 **** --- 989,999 ---- } } void frame::oops_interpreted_expressions_do(OopClosure *f, symbolHandle signature, ! bool is_static, ! bool has_receiver, int max_stack, int max_locals, InterpreterOopMap *mask) { // There is no stack no matter what the esp is pointing to (native methods // might look like expression stack is nonempty).
*** 1003,1013 **** --- 1002,1012 ---- // Point the top of the expression stack above arguments to a call so // arguments aren't gc'ed as both stack values for callee and callee // arguments in callee's locals. int args_size = 0; if (!signature.is_null()) { ! args_size = ArgumentSizeComputer(signature).size() + (is_static ? 0 : 1); ! args_size = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0); } intptr_t *tos_addr = interpreter_frame_tos_at(args_size); assert(args_size != 0 || tos_addr == interpreter_frame_tos_address(), "these are same"); intptr_t *frst_expr = interpreter_frame_expression_stack_at(0);
*** 1036,1047 **** --- 1035,1046 ---- #endif // ASSERT } } } ! void frame::oops_interpreted_arguments_do(symbolHandle signature, bool is_static, OopClosure* f) { ! InterpretedArgumentOopFinder finder(signature, is_static, this, f); ! void frame::oops_interpreted_arguments_do(symbolHandle signature, bool has_receiver, OopClosure* f) { ! InterpretedArgumentOopFinder finder(signature, has_receiver, this, f); finder.oops_do(); } void frame::oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* reg_map) { assert(_cb != NULL, "sanity check");
*** 1065,1075 **** --- 1064,1074 ---- class CompiledArgumentOopFinder: public SignatureInfo { protected: OopClosure* _f; int _offset; // the current offset, incremented with each argument ! bool _is_static; // true if the callee is a static method ! bool _has_receiver; // true if the callee has a receiver frame _fr; RegisterMap* _reg_map; int _arg_size; VMRegPair* _regs; // VMReg list of arguments
*** 1085,1122 **** --- 1084,1121 ---- oop *loc = _fr.oopmapreg_to_location(reg, _reg_map); _f->do_oop(loc); } public: ! CompiledArgumentOopFinder(symbolHandle signature, bool is_static, OopClosure* f, frame fr, const RegisterMap* reg_map) ! CompiledArgumentOopFinder(symbolHandle signature, bool has_receiver, OopClosure* f, frame fr, const RegisterMap* reg_map) : SignatureInfo(signature) { // initialize CompiledArgumentOopFinder _f = f; _offset = 0; ! _is_static = is_static; ! _has_receiver = has_receiver; _fr = fr; _reg_map = (RegisterMap*)reg_map; ! _arg_size = ArgumentSizeComputer(signature).size() + (is_static ? 0 : 1); ! _arg_size = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0); int arg_size; ! _regs = SharedRuntime::find_callee_arguments(signature(), is_static, &arg_size); ! _regs = SharedRuntime::find_callee_arguments(signature(), has_receiver, &arg_size); assert(arg_size == _arg_size, "wrong arg size"); } void oops_do() { ! if (!_is_static) { ! if (_has_receiver) { handle_oop_offset(); _offset++; } iterate_parameters(); } }; ! void frame::oops_compiled_arguments_do(symbolHandle signature, bool is_static, const RegisterMap* reg_map, OopClosure* f) { ! void frame::oops_compiled_arguments_do(symbolHandle signature, bool has_receiver, const RegisterMap* reg_map, OopClosure* f) { ResourceMark rm; ! CompiledArgumentOopFinder finder(signature, is_static, f, *this, reg_map); ! CompiledArgumentOopFinder finder(signature, has_receiver, f, *this, reg_map); finder.oops_do(); } // Get receiver out of callers frame, i.e. find parameter 0 in callers

src/share/vm/runtime/frame.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File