Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8311080: [lworld+vector] Fix jdk build failures with different options
Reviewed-by: jbhateja
  • Loading branch information
Xiaohong Gong authored and Jatin Bhateja committed Jul 5, 2023
1 parent d44617c commit bb13513
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 25 deletions.
16 changes: 16 additions & 0 deletions src/hotspot/share/oops/fieldInfo.hpp
Expand Up @@ -31,6 +31,7 @@
#include "utilities/vmEnums.hpp"

class MultiFieldInfo;

static constexpr u4 flag_mask(int pos) {
return (u4)1 << pos;
}
Expand Down Expand Up @@ -231,6 +232,21 @@ class FieldInfo {
void static print_from_growable_array(outputStream* os, GrowableArray<FieldInfo>* array, ConstantPool* cp);
};

class MultiFieldInfo : public MetaspaceObj {
private:
Symbol* _name;
u2 _base_index;
jbyte _multifield_index;
public:
MultiFieldInfo() : _name(nullptr), _base_index(0), _multifield_index(-1) {}
MultiFieldInfo(Symbol* name, u2 base, jbyte index) : _name(name), _base_index(base), _multifield_index(index) {}
Symbol* name() const { return _name; }
u2 base_index() const { return _base_index; }
jbyte multifield_index() const { return _multifield_index; }
FieldInfo base_field_info(InstanceKlass* ik);
void metaspace_pointers_do(MetaspaceClosure* it);
MetaspaceObj::Type type() const { return MultiFieldInfoType; }
};

class FieldInfoStream;

Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/oops/inlineKlass.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2023, 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
Expand Down Expand Up @@ -506,6 +506,7 @@ InlineKlass* InlineKlass::returned_inline_klass(const RegisterMap& map) {

// CDS support

#if INCLUDE_CDS
void InlineKlass::metaspace_pointers_do(MetaspaceClosure* it) {
InstanceKlass::metaspace_pointers_do(it);

Expand Down Expand Up @@ -544,6 +545,7 @@ void InlineKlass::restore_unshareable_info(ClassLoaderData* loader_data, Handle
value_array_klasses()->restore_unshareable_info(ClassLoaderData::the_null_class_loader_data(), Handle(), CHECK);
}
}
#endif

// oop verify

Expand Down
6 changes: 5 additions & 1 deletion src/hotspot/share/oops/inlineKlass.hpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2023, 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
Expand Down Expand Up @@ -133,10 +133,14 @@ class InlineKlass: public InstanceKlass {

int first_field_offset_old();

// CDS support

#if INCLUDE_CDS
virtual void remove_unshareable_info();
virtual void remove_java_mirror();
virtual void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, PackageEntry* pkg_entry, TRAPS);
virtual void metaspace_pointers_do(MetaspaceClosure* it);
#endif

private:
int collect_fields(GrowableArray<SigEntry>* sig, int base_off = 0);
Expand Down
16 changes: 0 additions & 16 deletions src/hotspot/share/oops/instanceKlass.hpp
Expand Up @@ -135,22 +135,6 @@ struct JvmtiCachedClassFileData;

class SigEntry;

class MultiFieldInfo : public MetaspaceObj {
private:
Symbol* _name;
u2 _base_index;
jbyte _multifield_index;
public:
MultiFieldInfo() : _name(nullptr), _base_index(0), _multifield_index(-1) {}
MultiFieldInfo(Symbol* name, u2 base, jbyte index) : _name(name), _base_index(base), _multifield_index(index) {}
Symbol* name() const { return _name; }
u2 base_index() const { return _base_index; }
jbyte multifield_index() const { return _multifield_index; }
FieldInfo base_field_info(InstanceKlass* ik);
void metaspace_pointers_do(MetaspaceClosure* it);
MetaspaceObj::Type type() const { return MultiFieldInfoType; }
};

class InlineKlassFixedBlock : public MetaspaceObj {
Array<SigEntry>** _extended_sig;
Array<VMRegPair>** _return_regs;
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/prims/vectorSupport.cpp
Expand Up @@ -119,6 +119,7 @@ jint VectorSupport::klass2length(InstanceKlass* ik) {
return vlen;
}

#ifdef COMPILER2
Handle VectorSupport::allocate_vector_payload_helper(InstanceKlass* ik, int num_elem, BasicType elem_bt, int larval, TRAPS) {
assert(ik->is_inline_klass(), "");
instanceOop obj = InlineKlass::cast(ik)->allocate_instance(THREAD);
Expand Down Expand Up @@ -327,6 +328,7 @@ instanceOop VectorSupport::allocate_vector(InstanceKlass* ik, frame* fr, Registe
}
return vbox;
}
#endif // COMPILER2

#ifdef COMPILER2
int VectorSupport::vop2ideal(jint id, BasicType bt) {
Expand Down
12 changes: 7 additions & 5 deletions src/hotspot/share/prims/vectorSupport.hpp
Expand Up @@ -38,10 +38,13 @@ extern "C" {

class VectorSupport : AllStatic {
private:

#ifdef COMPILER2
static Handle allocate_vector_payload_helper(InstanceKlass* ik, int num_elem, BasicType elem_bt, int larval, TRAPS);
static Handle allocate_vector_payload(InstanceKlass* ik, int num_elem, BasicType elem_bt, frame* fr, RegisterMap* reg_map, ObjectValue* ov, TRAPS);

static void init_payload_element(typeArrayOop arr, BasicType elem_bt, int index, address addr);
static InstanceKlass* get_vector_payload_klass(BasicType elem_bt, int num_elem);
static Symbol* get_vector_payload_field_signature(BasicType elem_bt, int num_elem);
#endif // COMPILER2

static BasicType klass2bt(InstanceKlass* ik);
static jint klass2length(InstanceKlass* ik);
Expand Down Expand Up @@ -143,11 +146,10 @@ class VectorSupport : AllStatic {

static int vop2ideal(jint vop, BasicType bt);

#ifdef COMPILER2
static instanceOop allocate_vector(InstanceKlass* holder, frame* fr, RegisterMap* reg_map, ObjectValue* sv, TRAPS);
static instanceOop allocate_vector_payload(InstanceKlass* ik, frame* fr, RegisterMap* reg_map, ObjectValue* sv, TRAPS);

static InstanceKlass* get_vector_payload_klass(BasicType elem_bt, int num_elem);
static Symbol* get_vector_payload_field_signature(BasicType elem_bt, int num_elem);
#endif // COMPILER2

static bool is_vector(Klass* klass);
static bool is_vector_payload_mf(Klass* klass);
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/runtime/sharedRuntime.cpp
Expand Up @@ -551,8 +551,8 @@ JRT_LEAF(address, SharedRuntime::exception_handler_for_return_address(JavaThread
return raw_exception_handler_for_return_address(current, return_address);
JRT_END

JRT_LEAF(jint, SharedRuntime::skip_value_scalarization(InlineKlass* klass))
return (jint)VectorSupport::skip_value_scalarization(klass);
JRT_LEAF(int, SharedRuntime::skip_value_scalarization(InlineKlass* klass))
return (int) VectorSupport::skip_value_scalarization(klass);
JRT_END

address SharedRuntime::get_poll_stub(address pc) {
Expand Down

0 comments on commit bb13513

Please sign in to comment.