Print this page


Split Close
Expand all
Collapse all
          --- old/src/cpu/sparc/vm/nativeInst_sparc.cpp
          +++ new/src/cpu/sparc/vm/nativeInst_sparc.cpp
   1    1  /*
   2      - * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
        2 + * Copyright 1997-2010 Sun Microsystems, Inc.  All Rights Reserved.
   3    3   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4    4   *
   5    5   * This code is free software; you can redistribute it and/or modify it
   6    6   * under the terms of the GNU General Public License version 2 only, as
   7    7   * published by the Free Software Foundation.
   8    8   *
   9    9   * This code is distributed in the hope that it will be useful, but WITHOUT
  10   10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11   11   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12   12   * version 2 for more details (a copy is included in the LICENSE file that
↓ open down ↓ 301 lines elided ↑ open up ↑
 314  314  
 315  315  void NativeMovConstReg::set_data(intptr_t x) {
 316  316  #ifdef _LP64
 317  317    set_data64_sethi(addr_at(sethi_offset), x);
 318  318  #else
 319  319    set_long_at(sethi_offset, set_data32_sethi(  long_at(sethi_offset), x));
 320  320  #endif
 321  321    set_long_at(add_offset,   set_data32_simm13( long_at(add_offset),   x));
 322  322  
 323  323    // also store the value into an oop_Relocation cell, if any
 324      -  CodeBlob* nm = CodeCache::find_blob(instruction_address());
 325      -  if (nm != NULL) {
      324 +  CodeBlob* cb = CodeCache::find_blob(instruction_address());
      325 +  if (cb != NULL) {
      326 +    nmethod* nm = cb->as_nmethod_or_null();
      327 +    assert(nm, "must be");
 326  328      RelocIterator iter(nm, instruction_address(), next_instruction_address());
 327  329      oop* oop_addr = NULL;
 328  330      while (iter.next()) {
 329  331        if (iter.type() == relocInfo::oop_type) {
 330  332          oop_Relocation *r = iter.oop_reloc();
 331  333          if (oop_addr == NULL) {
 332  334            oop_addr = r->oop_addr();
 333  335            *oop_addr = (oop)x;
 334  336          } else {
 335  337            assert(oop_addr == r->oop_addr(), "must be only one set-oop here");
↓ open down ↓ 87 lines elided ↑ open up ↑
 423  425  
 424  426  void NativeMovConstRegPatching::set_data(int x) {
 425  427  #ifdef _LP64
 426  428    set_data64_sethi(addr_at(sethi_offset), x);
 427  429  #else
 428  430    set_long_at(sethi_offset, set_data32_sethi(long_at(sethi_offset), x));
 429  431  #endif
 430  432    set_long_at(add_offset, set_data32_simm13(long_at(add_offset), x));
 431  433  
 432  434    // also store the value into an oop_Relocation cell, if any
 433      -  CodeBlob* nm = CodeCache::find_blob(instruction_address());
 434      -  if (nm != NULL) {
      435 +  CodeBlob* cb = CodeCache::find_blob(instruction_address());
      436 +  if (cb != NULL) {
      437 +    nmethod* nm = cb->as_nmethod_or_null();
      438 +    assert(nm, "must be");
 435  439      RelocIterator iter(nm, instruction_address(), next_instruction_address());
 436  440      oop* oop_addr = NULL;
 437  441      while (iter.next()) {
 438  442        if (iter.type() == relocInfo::oop_type) {
 439  443          oop_Relocation *r = iter.oop_reloc();
 440  444          if (oop_addr == NULL) {
 441  445            oop_addr = r->oop_addr();
 442  446            *oop_addr = (oop)x;
 443  447          } else {
 444  448            assert(oop_addr == r->oop_addr(), "must be only one set-oop here");
↓ open down ↓ 556 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX