src/cpu/zero/vm/javaFrameAnchor_zero.hpp

changeset 1860
0c5b3cf3c1f5
parent 1445
354d3184f6b2
child 1867
6cfbdb113e52
     1.1 --- a/src/cpu/zero/vm/javaFrameAnchor_zero.hpp	Thu Apr 29 17:53:58 2010 -0700
     1.2 +++ b/src/cpu/zero/vm/javaFrameAnchor_zero.hpp	Fri Apr 30 04:27:25 2010 -0700
     1.3 @@ -1,6 +1,6 @@
     1.4  /*
     1.5   * Copyright 2003-2005 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 - * Copyright 2007, 2008 Red Hat, Inc.
     1.7 + * Copyright 2007, 2008, 2010 Red Hat, Inc.
     1.8   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.9   *
    1.10   * This code is free software; you can redistribute it and/or modify it
    1.11 @@ -23,21 +23,31 @@
    1.12   *
    1.13   */
    1.14  
    1.15 + private:
    1.16 +  ZeroFrame* volatile _last_Java_fp;
    1.17 +
    1.18   public:
    1.19    // Each arch must define reset, save, restore
    1.20    // These are used by objects that only care about:
    1.21    //  1 - initializing a new state (thread creation, javaCalls)
    1.22    //  2 - saving a current state (javaCalls)
    1.23    //  3 - restoring an old state (javaCalls)
    1.24 +  // Note that whenever _last_Java_sp != NULL other anchor fields
    1.25 +  // must be valid.  The profiler apparently depends on this.
    1.26  
    1.27    void clear() {
    1.28      // clearing _last_Java_sp must be first
    1.29      _last_Java_sp = NULL;
    1.30      // fence?
    1.31 +    _last_Java_fp = NULL;
    1.32      _last_Java_pc = NULL;
    1.33    }
    1.34  
    1.35    void copy(JavaFrameAnchor* src) {
    1.36 +    set(src->_last_Java_sp, src->_last_Java_pc, src->_last_Java_fp);
    1.37 +  }
    1.38 +
    1.39 +  void set(intptr_t* sp, address pc, ZeroFrame* fp) {
    1.40      // In order to make sure the transition state is valid for "this"
    1.41      // We must clear _last_Java_sp before copying the rest of the new
    1.42      // data
    1.43 @@ -46,13 +56,14 @@
    1.44      // previous version (pd_cache_state) don't NULL _last_Java_sp
    1.45      // unless the value is changing
    1.46      //
    1.47 -    if (_last_Java_sp != src->_last_Java_sp)
    1.48 +    if (_last_Java_sp != sp)
    1.49        _last_Java_sp = NULL;
    1.50  
    1.51 -    _last_Java_pc = src->_last_Java_pc;
    1.52 +    _last_Java_fp = fp;
    1.53 +    _last_Java_pc = pc;
    1.54      // Must be last so profiler will always see valid frame if
    1.55      // has_last_frame() is true
    1.56 -    _last_Java_sp = src->_last_Java_sp;
    1.57 +    _last_Java_sp = sp;
    1.58    }
    1.59  
    1.60    bool walkable() {
    1.61 @@ -67,6 +78,6 @@
    1.62      return _last_Java_sp;
    1.63    }
    1.64  
    1.65 -  void set_last_Java_sp(intptr_t* sp) {
    1.66 -    _last_Java_sp = sp;
    1.67 +  ZeroFrame* last_Java_fp() const {
    1.68 +    return _last_Java_fp;
    1.69    }

mercurial