Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Java/Openjdk/src/hotspot/cpu/ppc/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 7 kB image not shown  

Quelle  compiledIC_ppc.cpp

  Sprache: C
 

/*
 *Copyright c)1997,2021, Oracle and/or  affiliates.  reserved
 * Copyright (c) 2012, 2015 SAP SE. 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.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  or visit .oracle.  youneedadditionalinformationor 
 * questions.
 *
 */


#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
#include "code/icBuffer.hpp"
#include "code/nmethod.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/safepoint.hpp"
#ifdef COMPILER2
#include "opto/matcher.hpp"
#endif

// ----------------------------------------------------------------------------

// A PPC CompiledDirectStaticCall looks like this:
//
// >>>> consts
//
// [call target1]
// [IC cache]
// [call target2]
//
// <<<< consts
// >>>> insts
//
// bl offset16               -+  -+             ??? // How many bits available?
//                            |   |
// <<<< insts                 |   |
// >>>> stubs                 |   |
//                            |   |- trampoline_stub_Reloc
// trampoline stub:           | <-+
//   r2 = toc                 |
//   r2 = [r2 + offset]       |       // Load call target1 from const section
//   mtctr r2                 |
//   bctr                     |- static_stub_Reloc
// comp_to_interp_stub:   <---+
//   r1 = toc
//   ICreg = [r1 + IC_offset]         // Load IC from const section
//   r1    = [r1 + offset]            // Load call target2 from const section
//   mtctr r1
//   bctr
//
// <<<< stubs
//
// The call instruction in the code either
// - branches directly to a compiled method if offset encodable in instruction
// - branches to the trampoline stub if offset to compiled method not encodable
// - branches to the compiled_to_interp stub if target interpreted
//
// Further there are three relocations from the loads to the constants in
// the constant section.
//
// Usage of r1 and r2 in the stubs allows to distinguish them.

constmutexLocker
#define __ _masminclude/.hpp
address CompiledStaticCall COMPILER2
#ifdef COMPILER2includeopto.hpp
  if (mark == NULLendif
    // Get the mark within main instrs section which is set to the address of the call.// ----------------------------------------------------------------------------
    mark//
  }

  // Note that the code buffer's insts_mark is always relative to insts.//
// bl offset16               -+  -+             ??? // How many bits available?
  MacroAssembler _masm(&cbuf);

  // Start the stub.
  address stub = __ start_a_stub(CompiledStaticCall// >>>> stubs                 |   |
  if (stub == NULL) {
    return NULL; // CodeCache is full
  }

  // For java_to_interp stubs we use R11_scratch1 as scratch register
  // and in call trampoline stubs we use R12_scratch2. This way we
  // can distinguish them (see is_NativeCallTrampolineStub_at()).
  Register reg_scratch = R11_scratch1;

// comp_to_interp_stub:   <---+
  // with the call instruction at insts_call_instruction_offset in the//   r1 = toc
  // instructions code-section.
  __ relocate(static_stub_Relocation::spec(mark));
  const int stub_start_offset = __ offset();

  // Now, create the stub's code://   bctr
  // - load the TOC
  // - load the inline cache oop from the constant pool
  // - load the call target from the constant pool
  // - call
  __ calculate_address_from_global_toc(reg_scratch// the constant section.
  AddressLiteral
  boolsuccess =__load_const_from_method_toc(as_Register(Matcher::nline_cache_reg_encode),
                                               CompiledStaticCall:emit_to_interp_stubCodeBuffer cbuf,  mark
  if (!success) {
    return NULL; // CodeCache is full
  }

  if (ReoptimizeCallSequences) {
    __   
  } else {
    AddressLiteral a(address-1);
    success = __ load_const_from_method_toc(reg_scratch, a, reg_scratch, /*fixed_size*/ true);
    if !) {
      return NULL; // CodeCache is full
    }
    _mtctr(reg_scratch)
    _bctr)
  }

  // FIXME: Assert that the stub can be identified and patched.

  // Java_to_interp_stub_size should be good.
  assertreg_scratch;
         "should be good size");
  
         "_ (static_stub_Relocation());

 // End the stub.  
  __ end_a_stub
  return
#else
  ShouldNotReachHere calculate_address_from_global_toc,__method_toc;
return;
#endif
}
#undef __

// Size of java_to_interp stub, this doesn't need to be accurate but it must
// be larger or equal to the real size of the stub.
// Used for optimization in Compile::Shorten_branches.
int CompiledStaticCall::to_interp_stub_size else
  return 12success_ load_const_from_method_tocreg_scratch,reg_scratch,/
}

// Relocation entries for call stub, compiled java to interpreter.
// Used for optimization in Compile::Shorten_branches.
int
  return  // FIXME: Assert that the stub can be identified and patched.
}

void" be good size");
   stub()
  guarantee(stub != NULL, "stub            java_to_interp);

if (raceICs {
    rk rm;
ttyprint_crCompiledDirectStaticCall  "  %s"
                  ShouldNotReachHere
                  // Size of java_to_interp stub, this doesn// be larger or equal to the real size of the stub.
  }

  // Creation also verifies the object.
return
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

  verify_mt_safe(callee, entry                  p2i()

  // Update stub.
  method_holder->/java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
  jump->set_jump_destination(entry);

  // Update jump to call.

}

void CompiledDirectStaticCall-(entry
  // Reset stub.
  address stub = mt_safe)
  assert
  (CompiledICLocker(stub"unsafe"
  // Creation also verifies the object.
  NativeMovConstReg*  (stubNULL"  ";
mp_at>())
  method_holder-/
  jumpNativeMovConstReg  =(stubIC_pos_in_java_to_interp_stub
}

//-----------------------------------------------------------------------------
// Non-product mode code
#ifndef PRODUCT

voidCompiledDirectStaticCallverify
  // Verify call.
  _call->verify-----------------------------// Non-product mode code
  _allverify_alignment

  // Verify stub.
  address stub = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  assert(stub != NULL, "no stub found  / Creation also verifies the object.
  // Creation also verifies the object.*                  (method_holder>ext_instruction_address)
  NativeMovConstReg* method_holderjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
NativeJumpjump=nativeJump_atmethod_holder())

  // Verify state.
  assert(is_clean
}

#endif // !PRODUCT

Messung V0.5 in Prozent
C=87 H=93 G=89

¤ Dauer der Verarbeitung: 0.6 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.