summaryrefslogtreecommitdiff
path: root/indra/lscript/lscript_execute.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/lscript/lscript_execute.h')
-rw-r--r--indra/lscript/lscript_execute.h45
1 files changed, 23 insertions, 22 deletions
diff --git a/indra/lscript/lscript_execute.h b/indra/lscript/lscript_execute.h
index 271b53aae1..2f67e77c93 100644
--- a/indra/lscript/lscript_execute.h
+++ b/indra/lscript/lscript_execute.h
@@ -370,7 +370,7 @@ public:
LLScriptExecute();
virtual ~LLScriptExecute() {;}
- virtual S32 getVersion() = 0;
+ virtual S32 getVersion() const = 0;
virtual void deleteAllEvents() = 0;
virtual void addEvent(LLScriptDataCollection* event) = 0;
virtual U32 getEventCount() = 0;
@@ -384,12 +384,12 @@ public:
virtual void setSleep(F32 value) = 0;
virtual F32 getEnergy() const = 0;
virtual void setEnergy(F32 value) = 0;
- virtual U64 getCurrentEvents(S32 version) = 0;
- virtual void setCurrentEvents(U64 value, S32 version) = 0;
- virtual U64 getEventHandlers(S32 version) = 0;
- virtual void setEventHandlers(U64 value, S32 version) = 0;
- virtual U64 getCurrentHandler(S32 version) = 0;
- virtual void setCurrentHandler(U64 value, S32 version) = 0;
+ virtual U64 getCurrentEvents() = 0;
+ virtual void setCurrentEvents(U64 value) = 0;
+ virtual U64 getEventHandlers() = 0;
+ virtual void setEventHandlers(U64 value) = 0;
+ virtual U64 getCurrentHandler() = 0;
+ virtual void setCurrentHandler(U64 value) = 0;
virtual BOOL isFinished() const = 0;
virtual BOOL isStateChangePending() const = 0;
virtual S32 writeState(U8 **dest, U32 header_size, U32 footer_size) = 0; // Allocate memory for header, state and footer return size of state.
@@ -409,17 +409,17 @@ public:
// Run handler for event for a maximum of time_slice seconds.
// Updates current handler and current events registers.
- virtual void callEventHandler(LSCRIPTStateEventType event, S32 major_version, const LLUUID &id, F32 time_slice) = 0;;
+ virtual void callEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice) = 0;;
// Run handler for next queued event for maximum of time_slice seconds.
// Updates current handler and current events registers.
// Removes processed event from queue.
- virtual void callNextQueuedEventHandler(U64 event_register, S32 major_version, const LLUUID &id, F32 time_slice) = 0;
+ virtual void callNextQueuedEventHandler(U64 event_register, const LLUUID &id, F32 time_slice) = 0;
// Run handler for event for a maximum of time_slice seconds.
// Updates current handler and current events registers.
// Removes processed event from queue.
- virtual void callQueuedEventHandler(LSCRIPTStateEventType event, S32 major_version, const LLUUID &id, F32 time_slice) = 0;
+ virtual void callQueuedEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice) = 0;
// Switch to next state.
// Returns new set of handled events.
@@ -428,14 +428,14 @@ public:
// Returns time taken.
virtual F32 runQuanta(BOOL b_print, const LLUUID &id,
const char **errorstr,
- BOOL &state_transition, F32 quanta,
+ F32 quanta,
U32& events_processed, LLTimer& timer);
// Run smallest possible amount of code: an instruction for LSL2, a segment
// between save tests for Mono
void runInstructions(BOOL b_print, const LLUUID &id,
const char **errorstr,
- BOOL &state_transition, U32& events_processed,
+ U32& events_processed,
F32 quanta);
bool isYieldDue() const;
@@ -461,7 +461,7 @@ public:
LLScriptExecuteLSL2(const U8* bytecode, U32 bytecode_size);
virtual ~LLScriptExecuteLSL2();
- virtual S32 getVersion() {return get_register(mBuffer, LREG_VN);}
+ virtual S32 getVersion() const {return get_register(mBuffer, LREG_VN);}
virtual void deleteAllEvents() {mEventData.mEventDataList.deleteAllData();}
virtual void addEvent(LLScriptDataCollection* event);
virtual U32 getEventCount() {return mEventData.mEventDataList.getLength();}
@@ -475,12 +475,12 @@ public:
virtual void setSleep(F32 value);
virtual F32 getEnergy() const;
virtual void setEnergy(F32 value);
- virtual U64 getCurrentEvents(S32 version) {return get_event_register(mBuffer, LREG_CE, version);}
- virtual void setCurrentEvents(U64 value, S32 version) {return set_event_register(mBuffer, LREG_CE, value, version);}
- virtual U64 getEventHandlers(S32 version) {return get_event_register(mBuffer, LREG_ER, version);}
- virtual void setEventHandlers(U64 value, S32 version) {set_event_register(mBuffer, LREG_ER, value, version);}
- virtual U64 getCurrentHandler(S32 version);
- virtual void setCurrentHandler(U64 value, S32 version) {return set_event_register(mBuffer, LREG_IE, value, version);}
+ virtual U64 getCurrentEvents() {return get_event_register(mBuffer, LREG_CE, getMajorVersion());}
+ virtual void setCurrentEvents(U64 value) {return set_event_register(mBuffer, LREG_CE, value, getMajorVersion());}
+ virtual U64 getEventHandlers() {return get_event_register(mBuffer, LREG_ER, getMajorVersion());}
+ virtual void setEventHandlers(U64 value) {set_event_register(mBuffer, LREG_ER, value, getMajorVersion());}
+ virtual U64 getCurrentHandler();
+ virtual void setCurrentHandler(U64 value) {return set_event_register(mBuffer, LREG_IE, value, getMajorVersion());}
virtual BOOL isFinished() const {return get_register(mBuffer, LREG_IP) == 0;}
virtual BOOL isStateChangePending() const {return get_register(mBuffer, LREG_CS) != get_register(mBuffer, LREG_NS);}
virtual S32 writeState(U8 **dest, U32 header_size, U32 footer_size); // Not including Events.
@@ -500,17 +500,17 @@ public:
// Run handler for event for a maximum of time_slice seconds.
// Updates current handler and current events registers.
- virtual void callEventHandler(LSCRIPTStateEventType event, S32 major_version, const LLUUID &id, F32 time_slice);
+ virtual void callEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice);
// Run handler for next queued event for maximum of time_slice seconds.
// Updates current handler and current events registers.
// Removes processed event from queue.
- virtual void callNextQueuedEventHandler(U64 event_register, S32 major_version, const LLUUID &id, F32 time_slice);
+ virtual void callNextQueuedEventHandler(U64 event_register, const LLUUID &id, F32 time_slice);
// Run handler for event for a maximum of time_slice seconds.
// Updates current handler and current events registers.
// Removes processed event from queue.
- virtual void callQueuedEventHandler(LSCRIPTStateEventType event, S32 major_version, const LLUUID &id, F32 time_slice);
+ virtual void callQueuedEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice);
// Switch to next state.
// Returns new set of handled events.
@@ -527,6 +527,7 @@ public:
U32 mBytecodeSize;
private:
+ S32 getMajorVersion() const;
void recordBoundaryError( const LLUUID &id );
void setStateEventOpcoodeStartSafely( S32 state, LSCRIPTStateEventType event, const LLUUID &id );