src/share/vm/runtime/frame.cpp

changeset 1579
9b9c1ee9b3f6
parent 1554
547f81740344
parent 1573
dd57230ba8fe
child 1635
ba263cfb7611
     1.1 --- a/src/share/vm/runtime/frame.cpp	Wed Dec 23 03:12:16 2009 -0800
     1.2 +++ b/src/share/vm/runtime/frame.cpp	Wed Jan 06 22:21:39 2010 -0800
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 + * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -769,9 +769,9 @@
    1.11  
    1.12  class InterpretedArgumentOopFinder: public SignatureInfo {
    1.13   private:
    1.14 -  OopClosure* _f;      // Closure to invoke
    1.15 -  int    _offset;      // TOS-relative offset, decremented with each argument
    1.16 -  bool   _is_static;   // true if the callee is a static method
    1.17 +  OopClosure* _f;        // Closure to invoke
    1.18 +  int    _offset;        // TOS-relative offset, decremented with each argument
    1.19 +  bool   _has_receiver;  // true if the callee has a receiver
    1.20    frame* _fr;
    1.21  
    1.22    void set(int size, BasicType type) {
    1.23 @@ -786,9 +786,9 @@
    1.24    }
    1.25  
    1.26   public:
    1.27 -  InterpretedArgumentOopFinder(symbolHandle signature, bool is_static, frame* fr, OopClosure* f) : SignatureInfo(signature) {
    1.28 +  InterpretedArgumentOopFinder(symbolHandle signature, bool has_receiver, frame* fr, OopClosure* f) : SignatureInfo(signature), _has_receiver(has_receiver) {
    1.29      // compute size of arguments
    1.30 -    int args_size = ArgumentSizeComputer(signature).size() + (is_static ? 0 : 1);
    1.31 +    int args_size = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0);
    1.32      assert(!fr->is_interpreted_frame() ||
    1.33             args_size <= fr->interpreter_frame_expression_stack_size(),
    1.34              "args cannot be on stack anymore");
    1.35 @@ -796,11 +796,10 @@
    1.36      _f         = f;
    1.37      _fr        = fr;
    1.38      _offset    = args_size;
    1.39 -    _is_static = is_static;
    1.40    }
    1.41  
    1.42    void oops_do() {
    1.43 -    if (!_is_static) {
    1.44 +    if (_has_receiver) {
    1.45        --_offset;
    1.46        oop_offset_do();
    1.47      }
    1.48 @@ -912,7 +911,7 @@
    1.49    int max_locals = m->is_native() ? m->size_of_parameters() : m->max_locals();
    1.50  
    1.51    symbolHandle signature;
    1.52 -  bool is_static = false;
    1.53 +  bool has_receiver = false;
    1.54  
    1.55    // Process a callee's arguments if we are at a call site
    1.56    // (i.e., if we are at an invoke bytecode)
    1.57 @@ -922,7 +921,7 @@
    1.58      Bytecode_invoke *call = Bytecode_invoke_at_check(m, bci);
    1.59      if (call != NULL) {
    1.60        signature = symbolHandle(thread, call->signature());
    1.61 -      is_static = call->is_invokestatic();
    1.62 +      has_receiver = call->has_receiver();
    1.63        if (map->include_argument_oops() &&
    1.64            interpreter_frame_expression_stack_size() > 0) {
    1.65          ResourceMark rm(thread);  // is this right ???
    1.66 @@ -936,7 +935,7 @@
    1.67          //       code in the interpreter calls a blocking runtime
    1.68          //       routine which can cause this code to be executed).
    1.69          //       (was bug gri 7/27/98)
    1.70 -        oops_interpreted_arguments_do(signature, is_static, f);
    1.71 +        oops_interpreted_arguments_do(signature, has_receiver, f);
    1.72        }
    1.73      }
    1.74    }
    1.75 @@ -950,7 +949,7 @@
    1.76      mask = &oopmap_mask;
    1.77  #endif // ASSERT
    1.78      oops_interpreted_locals_do(f, max_locals, mask);
    1.79 -    oops_interpreted_expressions_do(f, signature, is_static,
    1.80 +    oops_interpreted_expressions_do(f, signature, has_receiver,
    1.81                                      m->max_stack(),
    1.82                                      max_locals, mask);
    1.83    } else {
    1.84 @@ -992,7 +991,7 @@
    1.85  
    1.86  void frame::oops_interpreted_expressions_do(OopClosure *f,
    1.87                                        symbolHandle signature,
    1.88 -                                      bool is_static,
    1.89 +                                      bool has_receiver,
    1.90                                        int max_stack,
    1.91                                        int max_locals,
    1.92                                        InterpreterOopMap *mask) {
    1.93 @@ -1005,7 +1004,7 @@
    1.94    // arguments in callee's locals.
    1.95    int args_size = 0;
    1.96    if (!signature.is_null()) {
    1.97 -    args_size = ArgumentSizeComputer(signature).size() + (is_static ? 0 : 1);
    1.98 +    args_size = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0);
    1.99    }
   1.100  
   1.101    intptr_t *tos_addr = interpreter_frame_tos_at(args_size);
   1.102 @@ -1038,8 +1037,8 @@
   1.103    }
   1.104  }
   1.105  
   1.106 -void frame::oops_interpreted_arguments_do(symbolHandle signature, bool is_static, OopClosure* f) {
   1.107 -  InterpretedArgumentOopFinder finder(signature, is_static, this, f);
   1.108 +void frame::oops_interpreted_arguments_do(symbolHandle signature, bool has_receiver, OopClosure* f) {
   1.109 +  InterpretedArgumentOopFinder finder(signature, has_receiver, this, f);
   1.110    finder.oops_do();
   1.111  }
   1.112  
   1.113 @@ -1066,8 +1065,8 @@
   1.114  class CompiledArgumentOopFinder: public SignatureInfo {
   1.115   protected:
   1.116    OopClosure*     _f;
   1.117 -  int             _offset;      // the current offset, incremented with each argument
   1.118 -  bool            _is_static;   // true if the callee is a static method
   1.119 +  int             _offset;        // the current offset, incremented with each argument
   1.120 +  bool            _has_receiver;  // true if the callee has a receiver
   1.121    frame           _fr;
   1.122    RegisterMap*    _reg_map;
   1.123    int             _arg_size;
   1.124 @@ -1087,24 +1086,24 @@
   1.125    }
   1.126  
   1.127   public:
   1.128 -  CompiledArgumentOopFinder(symbolHandle signature, bool is_static, OopClosure* f, frame fr,  const RegisterMap* reg_map)
   1.129 +  CompiledArgumentOopFinder(symbolHandle signature, bool has_receiver, OopClosure* f, frame fr,  const RegisterMap* reg_map)
   1.130      : SignatureInfo(signature) {
   1.131  
   1.132      // initialize CompiledArgumentOopFinder
   1.133      _f         = f;
   1.134      _offset    = 0;
   1.135 -    _is_static = is_static;
   1.136 +    _has_receiver = has_receiver;
   1.137      _fr        = fr;
   1.138      _reg_map   = (RegisterMap*)reg_map;
   1.139 -    _arg_size  = ArgumentSizeComputer(signature).size() + (is_static ? 0 : 1);
   1.140 +    _arg_size  = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0);
   1.141  
   1.142      int arg_size;
   1.143 -    _regs = SharedRuntime::find_callee_arguments(signature(), is_static, &arg_size);
   1.144 +    _regs = SharedRuntime::find_callee_arguments(signature(), has_receiver, &arg_size);
   1.145      assert(arg_size == _arg_size, "wrong arg size");
   1.146    }
   1.147  
   1.148    void oops_do() {
   1.149 -    if (!_is_static) {
   1.150 +    if (_has_receiver) {
   1.151        handle_oop_offset();
   1.152        _offset++;
   1.153      }
   1.154 @@ -1112,9 +1111,9 @@
   1.155    }
   1.156  };
   1.157  
   1.158 -void frame::oops_compiled_arguments_do(symbolHandle signature, bool is_static, const RegisterMap* reg_map, OopClosure* f) {
   1.159 +void frame::oops_compiled_arguments_do(symbolHandle signature, bool has_receiver, const RegisterMap* reg_map, OopClosure* f) {
   1.160    ResourceMark rm;
   1.161 -  CompiledArgumentOopFinder finder(signature, is_static, f, *this, reg_map);
   1.162 +  CompiledArgumentOopFinder finder(signature, has_receiver, f, *this, reg_map);
   1.163    finder.oops_do();
   1.164  }
   1.165  

mercurial