From 7205302f5dc98d83aa65e734d16f62951d85d934 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Thu, 24 Oct 2024 14:33:09 +0530 Subject: [PATCH] LockNode::lock_type() --- src/hotspot/share/opto/callnode.hpp | 29 ++++++++++++++++------------- src/hotspot/share/opto/type.cpp | 3 +++ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/hotspot/share/opto/callnode.hpp b/src/hotspot/share/opto/callnode.hpp index 2d3835b71ad42..c5f2c83ecb50f 100644 --- a/src/hotspot/share/opto/callnode.hpp +++ b/src/hotspot/share/opto/callnode.hpp @@ -1193,19 +1193,22 @@ class LockNode : public AbstractLockNode { public: static const TypeFunc *lock_type() { - // create input type (domain) - const Type **fields = TypeTuple::fields(3); - fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Object to be Locked - fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM; // Address of stack location for lock - fields[TypeFunc::Parms+2] = TypeInt::BOOL; // FastLock - const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+3,fields); - - // create result type (range) - fields = TypeTuple::fields(0); - - const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0,fields); - - return TypeFunc::make(domain,range); + static const TypeFunc *tf = []() -> const TypeFunc* { + // create input type (domain) + const Type **fields = TypeTuple::fields(3); + fields[TypeFunc::Parms + 0] = TypeInstPtr::NOTNULL; // Object to be Locked + fields[TypeFunc::Parms + 1] = TypeRawPtr::BOTTOM; // Address of stack location for lock + fields[TypeFunc::Parms + 2] = TypeInt::BOOL; // FastLock + const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms + 3, fields); + + // create result type (range) + fields = TypeTuple::fields(0); + + const TypeTuple *range = TypeTuple::make(TypeFunc::Parms + 0, fields); + + return TypeFunc::make(domain, range); + }(); + return tf; } virtual int Opcode() const; diff --git a/src/hotspot/share/opto/type.cpp b/src/hotspot/share/opto/type.cpp index 70cd46c900dc2..621aefdbeb3a6 100644 --- a/src/hotspot/share/opto/type.cpp +++ b/src/hotspot/share/opto/type.cpp @@ -35,6 +35,7 @@ #include "oops/instanceMirrorKlass.hpp" #include "oops/objArrayKlass.hpp" #include "oops/typeArrayKlass.hpp" +#include "opto/callnode.hpp" #include "opto/matcher.hpp" #include "opto/node.hpp" #include "opto/opcodes.hpp" @@ -710,6 +711,8 @@ void Type::Initialize_shared(Compile* current) { mreg2type[Op_VecY] = TypeVect::VECTY; mreg2type[Op_VecZ] = TypeVect::VECTZ; + LockNode::lock_type(); + // Restore working type arena. current->set_type_arena(save); current->set_type_dict(nullptr);