diff options
Diffstat (limited to 'linden/indra/lscript/lscript_execute.h')
-rw-r--r-- | linden/indra/lscript/lscript_execute.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/linden/indra/lscript/lscript_execute.h b/linden/indra/lscript/lscript_execute.h index cfea328..9a631c4 100644 --- a/linden/indra/lscript/lscript_execute.h +++ b/linden/indra/lscript/lscript_execute.h | |||
@@ -17,7 +17,8 @@ | |||
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | 22 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
@@ -402,6 +403,8 @@ public: | |||
402 | virtual U32 getBytecodeSize() const = 0; | 403 | virtual U32 getBytecodeSize() const = 0; |
403 | virtual bool isMono() const = 0; | 404 | virtual bool isMono() const = 0; |
404 | virtual void error() {;} // Processing that must be performed when error flag is set and so run is not called. | 405 | virtual void error() {;} // Processing that must be performed when error flag is set and so run is not called. |
406 | |||
407 | virtual U32 getUsedMemory() = 0; | ||
405 | 408 | ||
406 | // Run current event handler for a maximum of time_slice seconds. | 409 | // Run current event handler for a maximum of time_slice seconds. |
407 | // Updates current handler and current events registers. | 410 | // Updates current handler and current events registers. |
@@ -431,6 +434,13 @@ public: | |||
431 | F32 quanta, | 434 | F32 quanta, |
432 | U32& events_processed, LLTimer& timer); | 435 | U32& events_processed, LLTimer& timer); |
433 | 436 | ||
437 | // NOTE: babbage: this must be used on occasions where another script may already be executing. Only 2 levels of nesting are allowed. | ||
438 | // Provided to support bizarre detach behaviour only. Do not use. | ||
439 | virtual F32 runNested(BOOL b_print, const LLUUID &id, | ||
440 | const char **errorstr, | ||
441 | F32 quanta, | ||
442 | U32& events_processed, LLTimer& timer); | ||
443 | |||
434 | // Run smallest possible amount of code: an instruction for LSL2, a segment | 444 | // Run smallest possible amount of code: an instruction for LSL2, a segment |
435 | // between save tests for Mono | 445 | // between save tests for Mono |
436 | void runInstructions(BOOL b_print, const LLUUID &id, | 446 | void runInstructions(BOOL b_print, const LLUUID &id, |
@@ -449,9 +459,16 @@ public: | |||
449 | // Called when the script is scheduled to be stopped from newsim/LLScriptData | 459 | // Called when the script is scheduled to be stopped from newsim/LLScriptData |
450 | virtual void stopRunning() = 0; | 460 | virtual void stopRunning() = 0; |
451 | 461 | ||
462 | // A timer is regularly checked to see if script takes too long, but we | ||
463 | // don't do it every opcode due to performance hits. | ||
464 | static void setTimerCheckSkip( S32 value ) { sTimerCheckSkip = value; } | ||
465 | static S32 getTimerCheckSkip() { return sTimerCheckSkip; } | ||
466 | |||
452 | private: | 467 | private: |
453 | 468 | ||
454 | BOOL mReset; | 469 | BOOL mReset; |
470 | |||
471 | static S32 sTimerCheckSkip; // Number of times to skip the timer check for performance reasons | ||
455 | }; | 472 | }; |
456 | 473 | ||
457 | class LLScriptExecuteLSL2 : public LLScriptExecute | 474 | class LLScriptExecuteLSL2 : public LLScriptExecute |
@@ -493,7 +510,7 @@ public: | |||
493 | virtual const U8* getBytecode() const {return mBytecode;} | 510 | virtual const U8* getBytecode() const {return mBytecode;} |
494 | virtual U32 getBytecodeSize() const {return mBytecodeSize;} | 511 | virtual U32 getBytecodeSize() const {return mBytecodeSize;} |
495 | virtual bool isMono() const {return false;} | 512 | virtual bool isMono() const {return false;} |
496 | 513 | virtual U32 getUsedMemory(); | |
497 | // Run current event handler for a maximum of time_slice seconds. | 514 | // Run current event handler for a maximum of time_slice seconds. |
498 | // Updates current handler and current events registers. | 515 | // Updates current handler and current events registers. |
499 | virtual void resumeEventHandler(BOOL b_print, const LLUUID &id, F32 time_slice); | 516 | virtual void resumeEventHandler(BOOL b_print, const LLUUID &id, F32 time_slice); |