mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
6976186: integrate Shark HotSpot changes
Shark is a JIT compiler for Zero that uses the LLVM compiler infrastructure. Reviewed-by: kvn, twisti
This commit is contained in:
parent
c9ac8cc788
commit
d7310fb0f7
67 changed files with 12200 additions and 40 deletions
|
@ -254,6 +254,7 @@ Deoptimization::UnrollBlock* Deoptimization::fetch_unroll_info_helper(JavaThread
|
|||
|
||||
}
|
||||
|
||||
#ifndef SHARK
|
||||
// Compute the caller frame based on the sender sp of stub_frame and stored frame sizes info.
|
||||
CodeBlob* cb = stub_frame.cb();
|
||||
// Verify we have the right vframeArray
|
||||
|
@ -270,6 +271,10 @@ Deoptimization::UnrollBlock* Deoptimization::fetch_unroll_info_helper(JavaThread
|
|||
assert(cb->is_deoptimization_stub() || cb->is_uncommon_trap_stub(), "just checking");
|
||||
Events::log("fetch unroll sp " INTPTR_FORMAT, unpack_sp);
|
||||
#endif
|
||||
#else
|
||||
intptr_t* unpack_sp = stub_frame.sender(&dummy_map).unextended_sp();
|
||||
#endif // !SHARK
|
||||
|
||||
// This is a guarantee instead of an assert because if vframe doesn't match
|
||||
// we will unpack the wrong deoptimized frame and wind up in strange places
|
||||
// where it will be very difficult to figure out what went wrong. Better
|
||||
|
@ -380,7 +385,9 @@ Deoptimization::UnrollBlock* Deoptimization::fetch_unroll_info_helper(JavaThread
|
|||
|
||||
frame_pcs[0] = deopt_sender.raw_pc();
|
||||
|
||||
#ifndef SHARK
|
||||
assert(CodeCache::find_blob_unsafe(frame_pcs[0]) != NULL, "bad pc");
|
||||
#endif // SHARK
|
||||
|
||||
UnrollBlock* info = new UnrollBlock(array->frame_size() * BytesPerWord,
|
||||
caller_adjustment * BytesPerWord,
|
||||
|
@ -1073,7 +1080,7 @@ JRT_LEAF(void, Deoptimization::popframe_preserve_args(JavaThread* thread, int by
|
|||
JRT_END
|
||||
|
||||
|
||||
#ifdef COMPILER2
|
||||
#if defined(COMPILER2) || defined(SHARK)
|
||||
void Deoptimization::load_class_by_index(constantPoolHandle constant_pool, int index, TRAPS) {
|
||||
// in case of an unresolved klass entry, load the class.
|
||||
if (constant_pool->tag_at(index).is_unresolved_klass()) {
|
||||
|
@ -1835,7 +1842,7 @@ void Deoptimization::print_statistics() {
|
|||
if (xtty != NULL) xtty->tail("statistics");
|
||||
}
|
||||
}
|
||||
#else // COMPILER2
|
||||
#else // COMPILER2 || SHARK
|
||||
|
||||
|
||||
// Stubs for C1 only system.
|
||||
|
@ -1871,4 +1878,4 @@ const char* Deoptimization::format_trap_state(char* buf, size_t buflen,
|
|||
return buf;
|
||||
}
|
||||
|
||||
#endif // COMPILER2
|
||||
#endif // COMPILER2 || SHARK
|
||||
|
|
|
@ -1100,6 +1100,10 @@ void frame::oops_do_internal(OopClosure* f, CodeBlobClosure* cf, RegisterMap* ma
|
|||
oops_entry_do(f, map);
|
||||
} else if (CodeCache::contains(pc())) {
|
||||
oops_code_blob_do(f, cf, map);
|
||||
#ifdef SHARK
|
||||
} else if (is_fake_stub_frame()) {
|
||||
// nothing to do
|
||||
#endif // SHARK
|
||||
} else {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. 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
|
||||
|
@ -181,6 +181,18 @@ void Flag::print_as_flag(outputStream* st) {
|
|||
#define C2_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, "{C2 notproduct}", DEFAULT },
|
||||
#endif
|
||||
|
||||
#define SHARK_PRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, "{Shark product}", DEFAULT },
|
||||
#define SHARK_PD_PRODUCT_FLAG_STRUCT(type, name, doc) { #type, XSTR(name), &name, "{Shark pd product}", DEFAULT },
|
||||
#define SHARK_DIAGNOSTIC_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, "{Shark diagnostic}", DEFAULT },
|
||||
#ifdef PRODUCT
|
||||
#define SHARK_DEVELOP_FLAG_STRUCT(type, name, value, doc) /* flag is constant */
|
||||
#define SHARK_PD_DEVELOP_FLAG_STRUCT(type, name, doc) /* flag is constant */
|
||||
#define SHARK_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc)
|
||||
#else
|
||||
#define SHARK_DEVELOP_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, "{Shark}", DEFAULT },
|
||||
#define SHARK_PD_DEVELOP_FLAG_STRUCT(type, name, doc) { #type, XSTR(name), &name, "{Shark pd}", DEFAULT },
|
||||
#define SHARK_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, "{Shark notproduct}", DEFAULT },
|
||||
#endif
|
||||
|
||||
static Flag flagTable[] = {
|
||||
RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_STRUCT, RUNTIME_PD_DEVELOP_FLAG_STRUCT, RUNTIME_PRODUCT_FLAG_STRUCT, RUNTIME_PD_PRODUCT_FLAG_STRUCT, RUNTIME_DIAGNOSTIC_FLAG_STRUCT, RUNTIME_EXPERIMENTAL_FLAG_STRUCT, RUNTIME_NOTPRODUCT_FLAG_STRUCT, RUNTIME_MANAGEABLE_FLAG_STRUCT, RUNTIME_PRODUCT_RW_FLAG_STRUCT, RUNTIME_LP64_PRODUCT_FLAG_STRUCT)
|
||||
|
@ -193,6 +205,9 @@ static Flag flagTable[] = {
|
|||
#endif
|
||||
#ifdef COMPILER2
|
||||
C2_FLAGS(C2_DEVELOP_FLAG_STRUCT, C2_PD_DEVELOP_FLAG_STRUCT, C2_PRODUCT_FLAG_STRUCT, C2_PD_PRODUCT_FLAG_STRUCT, C2_DIAGNOSTIC_FLAG_STRUCT, C2_EXPERIMENTAL_FLAG_STRUCT, C2_NOTPRODUCT_FLAG_STRUCT)
|
||||
#endif
|
||||
#ifdef SHARK
|
||||
SHARK_FLAGS(SHARK_DEVELOP_FLAG_STRUCT, SHARK_PD_DEVELOP_FLAG_STRUCT, SHARK_PRODUCT_FLAG_STRUCT, SHARK_PD_PRODUCT_FLAG_STRUCT, SHARK_DIAGNOSTIC_FLAG_STRUCT, SHARK_NOTPRODUCT_FLAG_STRUCT)
|
||||
#endif
|
||||
{0, NULL, NULL}
|
||||
};
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#if !defined(COMPILER1) && !defined(COMPILER2)
|
||||
#if !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK)
|
||||
define_pd_global(bool, BackgroundCompilation, false);
|
||||
define_pd_global(bool, UseTLAB, false);
|
||||
define_pd_global(bool, CICompileOSR, false);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. 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
|
||||
|
@ -95,7 +95,11 @@ void Abstract_VM_Version::initialize() {
|
|||
#define VMTYPE "Server"
|
||||
#else // TIERED
|
||||
#ifdef ZERO
|
||||
#ifdef SHARK
|
||||
#define VMTYPE "Shark"
|
||||
#else // SHARK
|
||||
#define VMTYPE "Zero"
|
||||
#endif // SHARK
|
||||
#else // ZERO
|
||||
#define VMTYPE COMPILER1_PRESENT("Client") \
|
||||
COMPILER2_PRESENT("Server")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue