src/cpu/x86/vm/frame_x86.inline.hpp

changeset 1635
ba263cfb7611
parent 1572
97125851f396
child 1636
24128c2ffa87
     1.1 --- a/src/cpu/x86/vm/frame_x86.inline.hpp	Thu Jan 28 20:41:37 2010 -0800
     1.2 +++ b/src/cpu/x86/vm/frame_x86.inline.hpp	Fri Jan 29 12:13:05 2010 +0100
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 + * Copyright 1997-2010 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 @@ -35,32 +35,35 @@
    1.11    _deopt_state = unknown;
    1.12  }
    1.13  
    1.14 -inline frame:: frame(intptr_t* sp, intptr_t* fp, address pc) {
    1.15 +inline frame::frame(intptr_t* sp, intptr_t* fp, address pc) {
    1.16    _sp = sp;
    1.17    _unextended_sp = sp;
    1.18    _fp = fp;
    1.19    _pc = pc;
    1.20    assert(pc != NULL, "no pc?");
    1.21    _cb = CodeCache::find_blob(pc);
    1.22 -  _deopt_state = not_deoptimized;
    1.23 -  if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) {
    1.24 -    _pc = (((nmethod*)_cb)->get_original_pc(this));
    1.25 +
    1.26 +  address original_pc = nmethod::get_deopt_original_pc(this);
    1.27 +  if (original_pc != NULL) {
    1.28 +    _pc = original_pc;
    1.29      _deopt_state = is_deoptimized;
    1.30    } else {
    1.31      _deopt_state = not_deoptimized;
    1.32    }
    1.33  }
    1.34  
    1.35 -inline frame:: frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc) {
    1.36 +inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc) {
    1.37    _sp = sp;
    1.38    _unextended_sp = unextended_sp;
    1.39    _fp = fp;
    1.40    _pc = pc;
    1.41    assert(pc != NULL, "no pc?");
    1.42    _cb = CodeCache::find_blob(pc);
    1.43 -  _deopt_state = not_deoptimized;
    1.44 -  if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) {
    1.45 -    _pc = (((nmethod*)_cb)->get_original_pc(this));
    1.46 +
    1.47 +  address original_pc = nmethod::get_deopt_original_pc(this);
    1.48 +  if (original_pc != NULL) {
    1.49 +    _pc = original_pc;
    1.50 +    assert(((nmethod*)_cb)->code_contains(_pc), "original PC must be in nmethod");
    1.51      _deopt_state = is_deoptimized;
    1.52    } else {
    1.53      _deopt_state = not_deoptimized;
    1.54 @@ -86,9 +89,9 @@
    1.55  
    1.56    _cb = CodeCache::find_blob(_pc);
    1.57  
    1.58 -  _deopt_state = not_deoptimized;
    1.59 -  if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) {
    1.60 -    _pc = (((nmethod*)_cb)->get_original_pc(this));
    1.61 +  address original_pc = nmethod::get_deopt_original_pc(this);
    1.62 +  if (original_pc != NULL) {
    1.63 +    _pc = original_pc;
    1.64      _deopt_state = is_deoptimized;
    1.65    } else {
    1.66      _deopt_state = not_deoptimized;

mercurial