#include <RoutineClass.hpp>
Static Public Member Functions | |
static RoutineClass * | restore (RexxBuffer *, char *, size_t length) |
static RoutineClass * | restore (const char *data, size_t length) |
static RoutineClass * | restore (RexxString *fileName, RexxBuffer *buffer) |
static RoutineClass * | restoreFromMacroSpace (RexxString *name) |
static RoutineClass * | restore (RexxBuffer *buffer) |
static RoutineClass * | restore (RXSTRING *inData, RexxString *name) |
static RoutineClass * | fromFile (RexxString *filename) |
static RoutineClass * | newRoutineObject (RexxString *, RexxObject *, RexxObject *, RexxSource *s, bool isBlock) |
static RoutineClass * | newRoutineObject (RexxString *, RexxArray *, RexxObject *) |
static RoutineClass * | processInstore (PRXSTRING instore, RexxString *name) |
static void | createInstance () |
Static Public Member Functions inherited from RexxObject | |
static void | decodeMessageName (RexxObject *target, RexxObject *message, RexxString *&messageName, RexxObject *&startScope) |
static void | createInstance () |
Static Public Member Functions inherited from RexxInternalObject | |
static size_t | getObjectHeaderSize () |
Static Public Attributes | |
static RexxClass * | classInstance = OREF_NULL |
Static Public Attributes inherited from RexxObject | |
static PCPPM | operatorMethods [] |
static RexxClass * | classInstance = OREF_NULL |
Additional Inherited Members | |
Public Attributes inherited from RexxInternalObject | |
ObjectHeader | header |
RexxBehaviour * | behaviour |
Protected Member Functions inherited from RexxVirtualBase | |
virtual | ~RexxVirtualBase () |
virtual void | baseVirtual () |
Protected Attributes inherited from BaseExecutable | |
RexxString * | executableName |
BaseCode * | code |
Definition at line 49 of file RoutineClass.hpp.
RoutineClass::RoutineClass | ( | RexxString * | name, |
BaseCode * | codeObj | ||
) |
Initialize a Routine object from a generated code object. Generally used for routines generated from ::ROUTINE directives.
name | The routine name. |
codeObj | The associated code object. |
Definition at line 90 of file RoutineClass.cpp.
References BaseExecutable::code, BaseExecutable::executableName, and OrefSet.
Referenced by fromFile(), newFileRexx(), newRoutineObject(), and processInstore().
RoutineClass::RoutineClass | ( | RexxString * | name | ) |
Initialize a RoutineClass object from a file source.
name | The routine name (and the resolved name of the file). |
Definition at line 102 of file RoutineClass.cpp.
References BaseExecutable::code, BaseExecutable::executableName, RexxSource::generateCode(), and OrefSet.
RoutineClass::RoutineClass | ( | RexxString * | name, |
RexxBuffer * | s | ||
) |
Initialize a Routine object using a buffered source.
name | The name of the routine. |
source | the source buffer. |
Definition at line 124 of file RoutineClass.cpp.
References BaseExecutable::code, BaseExecutable::executableName, RexxSource::generateCode(), and OrefSet.
RoutineClass::RoutineClass | ( | RexxString * | name, |
const char * | data, | ||
size_t | length | ||
) |
Initialize a Routine object using directly provided source.
name | The name of the routine. |
data | The source data buffer pointer. |
length | the length of the source buffer. |
Definition at line 147 of file RoutineClass.cpp.
References BaseExecutable::code, BaseExecutable::executableName, RexxSource::generateCode(), and OrefSet.
RoutineClass::RoutineClass | ( | RexxString * | name, |
RexxArray * | s, | ||
size_t | startLine = 0 , |
||
RexxString * | programName = OREF_NULL |
||
) |
Initialize a Routine object using an array source.
name | The name of the routine. |
source | the source buffer. |
Definition at line 169 of file RoutineClass.cpp.
References RexxSource::adjustLine(), BaseExecutable::code, BaseExecutable::executableName, RexxSource::generateCode(), OrefSet, and RexxArray::size().
|
inline |
Definition at line 59 of file RoutineClass.hpp.
void RoutineClass::call | ( | RexxActivity * | activity, |
RexxString * | msgname, | ||
RexxObject ** | argPtr, | ||
size_t | argcount, | ||
size_t | named_argcount, | ||
ProtectedObject & | result | ||
) |
Definition at line 221 of file RoutineClass.cpp.
References BaseCode::call(), and BaseExecutable::code.
void RoutineClass::call | ( | RexxActivity * | activity, |
RexxString * | msgname, | ||
RexxObject ** | argPtr, | ||
size_t | argcount, | ||
size_t | named_argcount, | ||
RexxString * | calltype, | ||
RexxString * | environment, | ||
int | context, | ||
ProtectedObject & | result | ||
) |
Definition at line 238 of file RoutineClass.cpp.
References BaseCode::call(), and BaseExecutable::code.
Referenced by RexxActivation::callExternalRexx(), RexxActivation::callMacroSpaceFunction(), RexxExpressionFunction::evaluate(), RexxInstructionCall::execute(), RexxActivation::externalCall(), RexxSource::install(), CallRoutineDispatcher::run(), InterpreterInstance::runRequires(), and RexxInstructionCall::trap().
RexxObject * RoutineClass::callRexx | ( | RexxObject ** | args, |
size_t | count, | ||
size_t | named_count | ||
) |
Call a routine object from Rexx-level code.
args | The call arguments. |
count | The count of arguments. |
Definition at line 266 of file RoutineClass.cpp.
References BaseCode::call(), BaseExecutable::code, ActivityManager::currentActivity, and BaseExecutable::executableName.
Referenced by RexxMemory::createImage().
RexxObject * RoutineClass::callWithRexx | ( | RexxArray * | args, |
RexxObject ** | named_arglist, | ||
size_t | named_argcount | ||
) |
Call a routine object from Rexx-level code.
args | The call arguments. |
Definition at line 282 of file RoutineClass.cpp.
References RexxDirectory::appendAllIndexesItemsTo(), ARG_ONE, arrayArgument(), BaseCode::call(), BaseExecutable::code, RexxArray::copy(), ActivityManager::currentActivity, RexxArray::data(), Error_Execution_user_defined, BaseExecutable::executableName, RexxDirectory::items(), NamedArguments::match(), OREF_NULL, reportException(), RexxObject::requestDirectory(), RexxArray::size(), and TheNilObject.
Referenced by RexxMemory::createImage().
|
static |
Create initial class object at bootstrap time.
Definition at line 77 of file RoutineClass.cpp.
References CLASS_CREATE.
Referenced by RexxMemory::createImage().
void RoutineClass::execute | ( | RexxObject * | , |
RexxObject * | |||
) |
|
virtual |
Reimplemented from RexxVirtualBase.
Definition at line 206 of file RoutineClass.cpp.
References cleanUpFlatten, flatten_reference, and setUpFlatten.
|
static |
Retrieve a routine object from a file. This will first attempt to restore a previously translated image, then will try to translate the source if that fails.
filename | The target file name. |
Definition at line 923 of file RoutineClass.cpp.
References Error_Program_unreadable_name, RexxString::getStringData(), OREF_NULL, SystemInterpreter::readProgram(), reportException(), restore(), and RoutineClass().
Referenced by RexxActivation::callExternalRexx(), PackageManager::getRequiresFile(), RexxStartDispatcher::run(), and CallProgramDispatcher::run().
|
virtual |
Reimplemented from RexxVirtualBase.
Definition at line 186 of file RoutineClass.cpp.
References BaseExecutable::code, BaseExecutable::executableName, and memory_mark.
|
virtual |
Reimplemented from RexxVirtualBase.
Definition at line 196 of file RoutineClass.cpp.
References BaseExecutable::code, BaseExecutable::executableName, and memory_mark_general.
RoutineClass * RoutineClass::loadExternalRoutine | ( | RexxString * | name, |
RexxString * | descriptor | ||
) |
Create a routine from an external library source.
name | The routine name. |
Definition at line 953 of file RoutineClass.cpp.
References Error_Translation_bad_external, RexxArray::get(), RexxString::getLength(), RexxString::getStringData(), PackageManager::loadRoutine(), OREF_NULL, reportException(), RexxArray::size(), stringArgument(), TheNilObject, and StringUtil::words().
Referenced by RexxMemory::createImage().
RoutineClass * RoutineClass::newFileRexx | ( | RexxString * | filename | ) |
Definition at line 678 of file RoutineClass.cpp.
References ARG_ONE, RexxClass::checkAbstract(), RexxClass::getInstanceBehaviour(), RexxInternalObject::hasUninit(), RexxClass::hasUninitDefined(), RoutineClass(), RexxObject::sendMessage(), RexxInternalObject::setBehaviour(), and stringArgument().
Referenced by RexxMemory::createImage().
RoutineClass * RoutineClass::newRexx | ( | RexxObject ** | init_args, |
size_t | argCount, | ||
size_t | named_argCount | ||
) |
Definition at line 602 of file RoutineClass.cpp.
References ARG_ONE, ARG_TWO, RexxClass::checkAbstract(), Error_Incorrect_method_argType, Error_Logical_value_logical_list, RexxClass::getInstanceBehaviour(), RexxInternalObject::hasUninit(), RexxClass::hasUninitDefined(), IntegerThree, IntegerTwo, isOfClass, new_string(), newRoutineObject(), OREF_NULL, RexxClass::processNewArgs(), reportException(), requiredArgument(), RexxObject::sendMessage(), RexxInternalObject::setBehaviour(), stringArgument(), and RexxObject::truthValue().
Referenced by RexxMemory::createImage().
|
static |
Construct a Routine using different forms of in-memory source file.
pgmname | The name of the program. |
source | The program source. This can be a string or an array of strings. |
position | The argument position used for error reporting. |
parentSource | A parent source context used to provide additional class and routine definitions. |
Definition at line 556 of file RoutineClass.cpp.
References Error_Incorrect_method_no_method, Error_Incorrect_method_noarray, Error_Incorrect_method_nostring_inarray, RexxArray::get(), RexxArray::getDimension(), IntegerTwo, RexxObject::makeString(), RexxArray::put(), reportException(), RexxObject::requestArray(), RoutineClass(), RexxArray::size(), BaseExecutable::source(), and TheNilObject.
|
static |
Construct a Routine using different forms of in-memory source file.
pgmname | The name of the program. |
source | The program source. This can be a string or an array of strings. |
position | The argument position used for error reporting. |
parentSource | A parent source context used to provide additional class and routine definitions. |
Definition at line 459 of file RoutineClass.cpp.
References ActivityManager::currentActivity, Error_Incorrect_method_no_method, Error_Incorrect_method_noarray, Error_Incorrect_method_nostring_inarray, RexxArray::get(), RexxActivity::getCurrentRexxFrame(), RexxArray::getDimension(), RexxSource::getProgramName(), BaseExecutable::getSourceObject(), RexxActivation::getSourceObject(), RexxSource::inheritSourceContext(), IntegerTwo, RexxObject::makeString(), RexxArray::makeString(), new_array(), OREF_NULL, RexxArray::put(), reportException(), RexxObject::requestArray(), RoutineClass(), RexxSource::setIsBlock(), RexxArray::size(), BaseExecutable::source(), and TheNilObject.
Referenced by newRexx().
|
inline |
Definition at line 53 of file RoutineClass.hpp.
void * RoutineClass::operator new | ( | size_t | size | ) |
Definition at line 436 of file RoutineClass.cpp.
References new_object(), and T_Routine.
|
static |
Definition at line 731 of file RoutineClass.cpp.
References RexxBuffer::getData(), BaseExecutable::getSourceObject(), RexxString::getStringData(), new_buffer(), OREF_NULL, restore(), restoreFromMacroSpace(), RexxQueryMacro(), RoutineClass(), save(), and RexxSource::setBufferedSource().
Referenced by RexxStartDispatcher::run(), TranslateDispatcher::run(), and TranslateInstoreDispatcher::run().
|
static |
Restore a saved routine directly from character data.
data | The data pointer. |
length | the data length. |
Definition at line 791 of file RoutineClass.cpp.
References RexxBuffer::getData(), new_buffer(), and restore().
|
static |
Definition at line 800 of file RoutineClass.cpp.
References RexxEnvelope::getReceiver(), and RexxEnvelope::puff().
Referenced by fromFile(), RexxActivation::getMacroCode(), processInstore(), restore(), and restoreFromMacroSpace().
|
static |
|
static |
Restore a program from a simple buffer.
buffer | The source buffer. |
Definition at line 828 of file RoutineClass.cpp.
References Error_Program_unreadable_version, RexxBuffer::getData(), RexxBufferBase::getDataLength(), ProgramMetaData::getImageData(), ProgramMetaData::getImageSize(), BaseExecutable::getSourceObject(), OREF_NULL, reportException(), restore(), RexxSource::setProgramName(), Utilities::strnchr(), and ProgramMetaData::validate().
|
static |
Restore a routine object from a previously saved instore buffer.
inData | The input data (in RXSTRING form). |
Definition at line 871 of file RoutineClass.cpp.
References Error_Program_unreadable_version, ProgramMetaData::extractBufferData(), RexxBuffer::getData(), ProgramMetaData::getImageSize(), BaseExecutable::getSourceObject(), OREF_NULL, reportException(), restore(), RexxSource::setProgramName(), _RXSTRING::strlength, Utilities::strnchr(), _RXSTRING::strptr, and ProgramMetaData::validate().
|
static |
Create a routine from a macrospace source.
name | The name of the macrospace item. |
Definition at line 716 of file RoutineClass.cpp.
References RexxString::getStringData(), MAKERXSTRING, SystemInterpreter::releaseResultMemory(), restore(), RexxResolveMacroFunction(), and _RXSTRING::strptr.
Referenced by processInstore().
void RoutineClass::runProgram | ( | RexxActivity * | activity, |
RexxObject ** | arguments, | ||
size_t | argCount, | ||
size_t | named_argCount, | ||
ProtectedObject & | result | ||
) |
Definition at line 349 of file RoutineClass.cpp.
References BaseCode::call(), BaseExecutable::code, BaseExecutable::executableName, InterpreterInstance::getDefaultEnvironment(), RexxActivity::getInstance(), and PROGRAMCALL.
void RoutineClass::runProgram | ( | RexxActivity * | activity, |
RexxString * | calltype, | ||
RexxString * | environment, | ||
RexxObject ** | arguments, | ||
size_t | argCount, | ||
size_t | named_argCount, | ||
ProtectedObject & | result | ||
) |
Definition at line 332 of file RoutineClass.cpp.
References BaseCode::call(), BaseExecutable::code, BaseExecutable::executableName, and PROGRAMCALL.
Referenced by RexxStartDispatcher::run(), and CallProgramDispatcher::run().
RexxBuffer * RoutineClass::save | ( | ) |
Definition at line 374 of file RoutineClass.cpp.
References RexxEnvelope::pack().
Referenced by processInstore(), TranslateDispatcher::run(), and save().
void RoutineClass::save | ( | const char * | filename | ) |
Save a routine to a target file.
filename | The name of the file (fully resolved already). |
Definition at line 410 of file RoutineClass.cpp.
References Error_Program_unreadable_output_error, RexxBufferBase::getDataLength(), reportException(), save(), and ProgramMetaData::write().
void RoutineClass::save | ( | PRXSTRING | outBuffer | ) |
Save a routine into an externalized buffer form in an RXSTRING.
outBuffer | The target output RXSTRING. |
Definition at line 393 of file RoutineClass.cpp.
References ProgramMetaData::getDataSize(), save(), _RXSTRING::strlength, and _RXSTRING::strptr.
RexxObject * RoutineClass::setSecurityManager | ( | RexxObject * | manager | ) |
Definition at line 364 of file RoutineClass.cpp.
References BaseExecutable::code, and BaseCode::setSecurityManager().
Referenced by RexxMemory::createImage(), PackageManager::getMacroSpaceRequires(), and PackageManager::getRequiresFile().
Definition at line 97 of file RoutineClass.hpp.