Skip to content

Commit

Permalink
LockNode::lock_type()
Browse files Browse the repository at this point in the history
  • Loading branch information
offamitkumar committed Oct 29, 2024
1 parent f7a61fc commit 7205302
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/hotspot/share/opto/callnode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/hotspot/share/opto/type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7205302

Please sign in to comment.