summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-04-12 19:13:34 +0000
committeralex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-04-12 19:13:34 +0000
commitcd166b4fd8dcd38f4db6e2b2667e9e6e76796f02 (patch)
tree9ce2a1d7d2d3bb686404242fde2cbc33f8a83553
parent3a428704779ca24f2a916f6ffa1c01692d49b31a (diff)
downloadATCD-cd166b4fd8dcd38f4db6e2b2667e9e6e76796f02.tar.gz
Committing the changes for related to removing <strlen> calculation on
operation names from the critical path. This was earlier committed, but reverted because of fear.
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp2
-rw-r--r--TAO/tao/Operation_Table.cpp23
-rw-r--r--TAO/tao/Operation_Table.h18
-rw-r--r--TAO/tao/Servant_Base.cpp5
-rw-r--r--TAO/tao/Servant_Base.h3
-rw-r--r--TAO/tao/Server_Request.cpp17
-rw-r--r--TAO/tao/Server_Request.h10
-rw-r--r--TAO/tao/Server_Request.i14
8 files changed, 64 insertions, 28 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
index 8fb1cdf5067..6c665b55f4d 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
@@ -280,7 +280,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node)
*os << "const char *opname = req.operation (); // retrieve operation name"
<< be_nl;
*os << "// find the skeleton corresponding to this opname" << be_nl;
- *os << "if (this->_find (opname, skel) == -1)" << be_nl;
+ *os << "if (this->_find (opname, skel, req.operation_length ()) == -1)" << be_nl;
*os << "{" << be_idt_nl;
*os << "ACE_ERROR ((LM_ERROR, \"Bad operation <%s>\\n\", opname));" << be_nl;
*os << "ACE_THROW (CORBA_BAD_OPERATION (CORBA::COMPLETED_NO));"
diff --git a/TAO/tao/Operation_Table.cpp b/TAO/tao/Operation_Table.cpp
index bfe2b0d1791..ef7ebeecc97 100644
--- a/TAO/tao/Operation_Table.cpp
+++ b/TAO/tao/Operation_Table.cpp
@@ -104,8 +104,10 @@ TAO_Dynamic_Hash_OpTable::bind (const char *opname,
int
TAO_Dynamic_Hash_OpTable::find (const char *opname,
- TAO_Skeleton& skel_ptr)
+ TAO_Skeleton& skel_ptr,
+ const unsigned int length)
{
+ ACE_UNUSED_ARG (length);
ACE_FUNCTION_TIMEPROBE (TAO_DYNAMIC_HASH_OPTABLE_FIND_START);
return this->hash_.find ((const char *)opname, skel_ptr);
@@ -132,8 +134,10 @@ TAO_Linear_Search_OpTable::bind (const char *opname,
int
TAO_Linear_Search_OpTable::find (const char *opname,
- TAO_Skeleton& skelfunc)
+ TAO_Skeleton& skelfunc,
+ const unsigned int length)
{
+ ACE_UNUSED_ARG (length);
ACE_FUNCTION_TIMEPROBE (TAO_LINEAR_SEARCH_OPTABLE_FIND_START);
const TAO_operation_db_entry *entry = lookup (opname);
@@ -194,8 +198,11 @@ TAO_Active_Demux_OpTable::bind (const char *opname,
int
TAO_Active_Demux_OpTable::find (const char *opname,
- TAO_Skeleton& skel_ptr)
+ TAO_Skeleton& skel_ptr,
+ const unsigned int length)
{
+ ACE_UNUSED_ARG (length);
+
ACE_FUNCTION_TIMEPROBE (TAO_ACTIVE_DEMUX_OPTABLE_FIND_START);
CORBA::ULong i = ACE_OS::atoi (opname);
@@ -231,12 +238,13 @@ TAO_Perfect_Hash_OpTable::~TAO_Perfect_Hash_OpTable (void)
int
TAO_Perfect_Hash_OpTable::find (const char *opname,
- TAO_Skeleton &skelfunc)
+ TAO_Skeleton &skelfunc,
+ const unsigned int length)
{
ACE_FUNCTION_TIMEPROBE (TAO_PERFECT_HASH_OPTABLE_FIND_START);
-
+
const TAO_operation_db_entry *entry = lookup (opname,
- ACE_OS::strlen (opname));
+ length);
if (entry == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"TAO_Perfect_Hash_Table:find failed\n"),
@@ -273,7 +281,8 @@ TAO_Binary_Search_OpTable::~TAO_Binary_Search_OpTable (void)
int
TAO_Binary_Search_OpTable::find (const char *opname,
- TAO_Skeleton &skelfunc)
+ TAO_Skeleton &skelfunc,
+ const unsigned int length)
{
ACE_FUNCTION_TIMEPROBE (TAO_BINARY_SEARCH_OPTABLE_FIND_START);
diff --git a/TAO/tao/Operation_Table.h b/TAO/tao/Operation_Table.h
index 39fc644d3e7..916c74d0849 100644
--- a/TAO/tao/Operation_Table.h
+++ b/TAO/tao/Operation_Table.h
@@ -43,7 +43,8 @@ class TAO_Export TAO_Operation_Table
// operation names.
public:
virtual int find (const char *opname,
- TAO_Skeleton &skelfunc) = 0;
+ TAO_Skeleton &skelfunc,
+ const unsigned int length = 0) = 0;
// Uses <{opname}> to look up the skeleton function and pass it back
// in <{skelfunc}>. Returns non-negative integer on success, or -1
// on failure.
@@ -141,7 +142,8 @@ public:
// <{opname}>. Returns -1 on failure, 0 on success, 1 on duplicate.
virtual int find (const char *opname,
- TAO_Skeleton &skelfunc);
+ TAO_Skeleton &skelfunc,
+ const unsigned int length = 0);
// Uses <{opname}> to look up the skeleton function and pass it back
// in <{skelfunc}>. Returns non-negative integer on success, or -1
// on failure.
@@ -172,7 +174,8 @@ public:
// Destructor.
virtual int find (const char *opname,
- TAO_Skeleton &skel_ptr);
+ TAO_Skeleton &skel_ptr,
+ const unsigned int length = 0);
// Uses <{opname}> to look up the skeleton function and pass it back
// in <{skelfunc}>. Returns non-negative integer on success, or -1
// on failure.
@@ -218,7 +221,8 @@ public:
// destructor.
virtual int find (const char *opname,
- TAO_Skeleton &skel_ptr);
+ TAO_Skeleton &skel_ptr,
+ const unsigned int length = 0);
// Uses <{opname}> to look up the skeleton function and pass it back
// in <{skelfunc}>. Returns non-negative integer on success, or -1
// on failure.
@@ -259,7 +263,8 @@ public:
// Do nothing destrctor.
virtual int find (const char *opname,
- TAO_Skeleton &skelfunc);
+ TAO_Skeleton &skelfunc,
+ const unsigned int length = 0);
// Uses <{opname}> to look up the skeleton function and pass it back
// in <{skelfunc}>. Returns non-negative integer on success, or -1
// on failure.
@@ -297,7 +302,8 @@ public:
// Do nothing destrctor.
virtual int find (const char *opname,
- TAO_Skeleton &skelfunc);
+ TAO_Skeleton &skelfunc,
+ const unsigned int length = 0);
// Uses <{opname}> to look up the skeleton function and pass it back
// in <{skelfunc}>. Returns non-negative integer on success, or -1
// on failure.
diff --git a/TAO/tao/Servant_Base.cpp b/TAO/tao/Servant_Base.cpp
index fe90e7fbe17..0beb4b36d89 100644
--- a/TAO/tao/Servant_Base.cpp
+++ b/TAO/tao/Servant_Base.cpp
@@ -72,10 +72,11 @@ TAO_ServantBase::_is_a (const char* logical_type_id,
int
TAO_ServantBase::_find (const char *opname,
- TAO_Skeleton& skelfunc)
+ TAO_Skeleton& skelfunc,
+ const unsigned int length)
{
ACE_FUNCTION_TIMEPROBE (TAO_SERVANT_BASE_FIND_START);
- return optable_->find (opname, skelfunc);
+ return optable_->find (opname, skelfunc, length);
}
int
diff --git a/TAO/tao/Servant_Base.h b/TAO/tao/Servant_Base.h
index d1fd396a1b6..2b6cb2e72cb 100644
--- a/TAO/tao/Servant_Base.h
+++ b/TAO/tao/Servant_Base.h
@@ -71,7 +71,8 @@ protected:
// <request>.
virtual int _find (const char *opname,
- TAO_Skeleton &skelfunc);
+ TAO_Skeleton &skelfunc,
+ const unsigned int length = 0);
// Find an operation in the operation table.
virtual int _bind (const char *opname,
diff --git a/TAO/tao/Server_Request.cpp b/TAO/tao/Server_Request.cpp
index cd4b94b667b..95aceb59a51 100644
--- a/TAO/tao/Server_Request.cpp
+++ b/TAO/tao/Server_Request.cpp
@@ -44,8 +44,7 @@ IIOP_ServerRequest::IIOP_ServerRequest (TAO_InputCDR &input,
TAO_OutputCDR &output,
TAO_ORB_Core *orb_core,
CORBA::Environment &env)
- : operation_ (0),
- incoming_ (&input),
+ : incoming_ (&input),
outgoing_ (&output),
response_expected_ (0),
@@ -109,7 +108,10 @@ IIOP_ServerRequest::parse_header_std (CORBA::Environment &ACE_TRY_ENV)
hdr_status = hdr_status && input.read_long (length);
if (hdr_status)
{
- this->operation_ = input.rd_ptr ();
+ // Do not include NULL character at the end.
+ this->operation_.set (input.rd_ptr (),
+ length - 1,
+ 0);
hdr_status = input.skip_bytes (length);
}
@@ -153,8 +155,11 @@ IIOP_ServerRequest::parse_header_lite (CORBA::Environment &ACE_TRY_ENV)
CORBA::Long length;
hdr_status = hdr_status && input.read_long (length);
if (hdr_status)
- {
- this->operation_ = input.rd_ptr ();
+ {
+ // Do not include NULL character at the end.
+ this->operation_.set (input.rd_ptr (),
+ length - 1,
+ 0);
hdr_status = input.skip_bytes (length);
}
@@ -178,7 +183,7 @@ IIOP_ServerRequest::parse_header (CORBA::Environment &env)
IIOP_ServerRequest::IIOP_ServerRequest (CORBA::ULong &request_id,
CORBA::Boolean &response_expected,
TAO_ObjectKey &object_key,
- char* operation,
+ const ACE_CString &operation,
TAO_OutputCDR &output,
TAO_ORB_Core *orb_core,
CORBA::Environment &)
diff --git a/TAO/tao/Server_Request.h b/TAO/tao/Server_Request.h
index 7a72c875e11..e6f7088431c 100644
--- a/TAO/tao/Server_Request.h
+++ b/TAO/tao/Server_Request.h
@@ -151,6 +151,9 @@ public:
virtual const char *operation (void) const = 0;
// get the operation name
+ virtual unsigned int operation_length (void) const = 0;
+ // get the length of the operation name
+
virtual void init_reply (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()) = 0;
// Start a Reply message.
@@ -206,7 +209,7 @@ public:
IIOP_ServerRequest (CORBA::ULong &request_id,
CORBA::Boolean &response_expected,
TAO_ObjectKey &object_key,
- char* operation,
+ const ACE_CString &operation,
TAO_OutputCDR &output,
TAO_ORB_Core *orb_core,
CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ());
@@ -237,6 +240,9 @@ public:
const char *operation (void) const;
// return the operation name
+ unsigned int operation_length (void) const;
+ // return the legnth of the operation
+
// CORBA::Context_ptr ctx (void);
// return the context pointer
@@ -313,7 +319,7 @@ private:
// store the result on this object.
private:
- char* operation_;
+ ACE_CString operation_;
// Operation name.
CORBA::Object_var forward_location_;
diff --git a/TAO/tao/Server_Request.i b/TAO/tao/Server_Request.i
index 119e5d6cee7..345a30bf693 100644
--- a/TAO/tao/Server_Request.i
+++ b/TAO/tao/Server_Request.i
@@ -45,10 +45,18 @@ IIOP_ServerRequest::outgoing (void)
}
// Invocation attributes.
+
ACE_INLINE const char *
IIOP_ServerRequest::operation (void) const
{
- return this->operation_;
+ return this->operation_.c_str ();
+}
+
+// get the length of the operation name.
+ACE_INLINE unsigned int
+IIOP_ServerRequest::operation_length (void) const
+{
+ return this->operation_.length ();
}
#if 0
@@ -66,7 +74,7 @@ IIOP_ServerRequest::response_expected (void) const
return this->response_expected_;
}
-ACE_INLINE CORBA::Principal_ptr
+ACE_INLINE CORBA::Principal_ptr
IIOP_ServerRequest::principal (void) const
{
return this->requesting_principal_;
@@ -84,7 +92,7 @@ IIOP_ServerRequest::service_info (void) const
return this->service_info_;
}
-ACE_INLINE CORBA::ULong
+ACE_INLINE CORBA::ULong
IIOP_ServerRequest::request_id (void)
{
return this->request_id_;