lscript_byteconvert.h File Reference

Shared code for compiler and assembler for LSL. More...

#include "stdtypes.h"
#include "v3math.h"
#include "llquaternion.h"
#include "lscript_byteformat.h"
#include "lluuid.h"

Include dependency graph for lscript_byteconvert.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void reset_hp_to_safe_spot (const U8 *buffer)
void set_fault (const U8 *stream, LSCRIPTRunTimeFaults fault)
S32 bytestream2integer (const U8 *stream, S32 &offset)
U32 bytestream2unsigned_integer (const U8 *stream, S32 &offset)
U64 bytestream2u64 (const U8 *stream, S32 &offset)
void integer2bytestream (U8 *stream, S32 &offset, S32 integer)
void unsigned_integer2bytestream (U8 *stream, S32 &offset, U32 integer)
void u642bytestream (U8 *stream, S32 &offset, U64 integer)
S16 bytestream2s16 (const U8 *stream, S32 &offset)
void s162bytestream (U8 *stream, S32 &offset, S16 integer)
U16 bytestream2u16 (const U8 *stream, S32 &offset)
void u162bytestream (U8 *stream, S32 &offset, U16 integer)
F32 bytestream2float (const U8 *stream, S32 &offset)
void float2bytestream (U8 *stream, S32 &offset, F32 floatingpoint)
void bytestream_int2float (U8 *stream, S32 &offset)
void bytestream2char (char *buffer, const U8 *stream, S32 &offset)
void char2bytestream (U8 *stream, S32 &offset, char *buffer)
U8 bytestream2byte (const U8 *stream, S32 &offset)
void byte2bytestream (U8 *stream, S32 &offset, U8 byte)
void bytestream2bytestream (U8 *dest, S32 &dest_offset, const U8 *src, S32 &src_offset, S32 count)
void uuid2bytestream (U8 *stream, S32 &offset, const LLUUID &uuid)
void bytestream2uuid (U8 *stream, S32 &offset, LLUUID &uuid)
void bytestream2vector (LLVector3 &vector, const U8 *stream, S32 &offset)
void vector2bytestream (U8 *stream, S32 &offset, LLVector3 &vector)
void bytestream2quaternion (LLQuaternion &quat, const U8 *stream, S32 &offset)
void quaternion2bytestream (U8 *stream, S32 &offset, LLQuaternion &quat)
S32 get_register (const U8 *stream, LSCRIPTRegisters reg)
F32 get_register_fp (U8 *stream, LSCRIPTRegisters reg)
U64 get_register_u64 (U8 *stream, LSCRIPTRegisters reg)
U64 get_event_register (U8 *stream, LSCRIPTRegisters reg, S32 major_version)
void set_register (U8 *stream, LSCRIPTRegisters reg, S32 value)
void set_register_fp (U8 *stream, LSCRIPTRegisters reg, F32 value)
void set_register_u64 (U8 *stream, LSCRIPTRegisters reg, U64 value)
void set_event_register (U8 *stream, LSCRIPTRegisters reg, U64 value, S32 major_version)
F32 add_register_fp (U8 *stream, LSCRIPTRegisters reg, F32 value)
void lsa_print_heap (U8 *buffer)
BOOL set_ip (U8 *stream, S32 ip)
BOOL set_bp (U8 *stream, S32 bp)
BOOL set_sp (U8 *stream, S32 sp)
void lscript_push (U8 *stream, U8 value)
void lscript_push (U8 *stream, S32 value)
void lscript_push (U8 *stream, F32 value)
void lscript_push (U8 *stream, LLVector3 &value)
void lscript_push (U8 *stream, LLQuaternion &value)
void lscript_pusharg (U8 *stream, S32 arg)
void lscript_poparg (U8 *stream, S32 arg)
U8 lscript_pop_char (U8 *stream)
S32 lscript_pop_int (U8 *stream)
F32 lscript_pop_float (U8 *stream)
void lscript_pop_vector (U8 *stream, LLVector3 &value)
void lscript_pop_quaternion (U8 *stream, LLQuaternion &value)
void lscript_pusharge (U8 *stream, S32 value)
BOOL lscript_check_local (U8 *stream, S32 &address, S32 size)
BOOL lscript_check_global (U8 *stream, S32 &address, S32 size)
void lscript_local_store (U8 *stream, S32 address, S32 value)
void lscript_local_store (U8 *stream, S32 address, F32 value)
void lscript_local_store (U8 *stream, S32 address, LLVector3 value)
void lscript_local_store (U8 *stream, S32 address, LLQuaternion value)
void lscript_global_store (U8 *stream, S32 address, S32 value)
void lscript_global_store (U8 *stream, S32 address, F32 value)
void lscript_global_store (U8 *stream, S32 address, LLVector3 value)
void lscript_global_store (U8 *stream, S32 address, LLQuaternion value)
S32 lscript_local_get (U8 *stream, S32 address)
void lscript_local_get (U8 *stream, S32 address, F32 &value)
void lscript_local_get (U8 *stream, S32 address, LLVector3 &value)
void lscript_local_get (U8 *stream, S32 address, LLQuaternion &value)
S32 lscript_global_get (U8 *stream, S32 address)
void lscript_global_get (U8 *stream, S32 address, F32 &value)
void lscript_global_get (U8 *stream, S32 address, LLVector3 &value)
void lscript_global_get (U8 *stream, S32 address, LLQuaternion &value)
S32 get_state_event_opcoode_start (U8 *stream, S32 state, LSCRIPTStateEventType event)
U64 get_handled_events (U8 *stream, S32 state)
S32 get_event_stack_size (U8 *stream, S32 state, LSCRIPTStateEventType event)
LSCRIPTStateEventType return_first_event (S32 event)
BOOL safe_instruction_check_address (U8 *stream, S32 offset, S32 size)
BOOL safe_heap_check_address (U8 *stream, S32 offset, S32 size)
U8 safe_instruction_bytestream2byte (U8 *stream, S32 &offset)
void safe_instruction_byte2bytestream (U8 *stream, S32 &offset, U8 byte)
S32 safe_instruction_bytestream2integer (U8 *stream, S32 &offset)
void safe_instruction_integer2bytestream (U8 *stream, S32 &offset, S32 value)
U16 safe_instruction_bytestream2u16 (U8 *stream, S32 &offset)
void safe_instruction_u162bytestream (U8 *stream, S32 &offset, U16 value)
F32 safe_instruction_bytestream2float (U8 *stream, S32 &offset)
void safe_instruction_float2bytestream (U8 *stream, S32 &offset, F32 value)
void safe_instruction_bytestream2char (char *buffer, U8 *stream, S32 &offset)
void safe_instruction_bytestream_count_char (U8 *stream, S32 &offset)
void safe_heap_bytestream_count_char (U8 *stream, S32 &offset)
void safe_instruction_char2bytestream (U8 *stream, S32 &offset, char *buffer)
void safe_instruction_bytestream2vector (LLVector3 &value, U8 *stream, S32 &offset)
void safe_instruction_vector2bytestream (U8 *stream, S32 &offset, LLVector3 &value)
void safe_instruction_bytestream2quaternion (LLQuaternion &value, U8 *stream, S32 &offset)
void safe_instruction_quaternion2bytestream (U8 *stream, S32 &offset, LLQuaternion &value)
static LSCRIPTType char2type (char type)


Detailed Description

Shared code for compiler and assembler for LSL.

LicenseInfo
firstyear=2002&license=viewergpl

Copyright (c) 2002-2007, Linden Research, Inc.

Second Life Viewer Source Code The source code in this file ("Source Code") is provided by Linden Lab to you under the terms of the GNU General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other License"), formally executed by you and Linden Lab. Terms of the GPL can be found in doc/GPL-license.txt in this distribution, or online at http://secondlife.com/developers/opensource/gplv2

There are special exceptions to the terms and conditions of the GPL as it is applied to this Source Code. View the full text of the exception in the file doc/FLOSS-exception.txt in this software distribution, or online at http://secondlife.com/developers/opensource/flossexception

By copying, modifying or distributing this software, you acknowledge that you have read and understood your obligations described above, and agree to abide by those obligations.

ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE. $/LicenseInfo$

Definition in file lscript_byteconvert.h.


Function Documentation

F32 add_register_fp ( U8 stream,
LSCRIPTRegisters  reg,
F32  value 
) [inline]

Definition at line 374 of file lscript_byteconvert.h.

References bytestream2float(), float2bytestream(), gLSCRIPTRegisterAddresses, llfinite, LSRF_MATH, S32, and set_fault().

Referenced by LLScriptExecute::run(), run_calllib(), and run_calllib_two_byte().

void byte2bytestream ( U8 stream,
S32 offset,
U8  byte 
) [inline]

Definition at line 182 of file lscript_byteconvert.h.

Referenced by alloc_entry2bytestream(), and lsa_create_data_block().

U8 bytestream2byte ( const U8 stream,
S32 offset 
) [inline]

Definition at line 177 of file lscript_byteconvert.h.

Referenced by bytestream2alloc_entry().

void bytestream2bytestream ( U8 dest,
S32 dest_offset,
const U8 src,
S32 src_offset,
S32  count 
) [inline]

Definition at line 187 of file lscript_byteconvert.h.

void bytestream2char ( char *  buffer,
const U8 stream,
S32 offset 
) [inline]

Definition at line 165 of file lscript_byteconvert.h.

Referenced by LLScriptLibData::LLScriptLibData(), lsa_fprint_heap(), lsa_get_data(), lsa_print_heap(), lscript_pop_variable(), lscript_stacktol_pop_variable(), print_pushargs(), LLScriptLSOParse::printGlobalFunctions(), LLScriptLSOParse::printGlobals(), LLScriptLSOParse::printStates(), run_cast(), run_jumpif(), run_jumpnif(), run_print(), and LLScriptLibData::set().

F32 bytestream2float ( const U8 stream,
S32 offset 
) [inline]

Definition at line 134 of file lscript_byteconvert.h.

References bytestream2integer(), llfinite, LSRF_MATH, S32, and set_fault().

Referenced by add_register_fp(), get_register_fp(), LLScriptLibData::LLScriptLibData(), lsa_fprint_heap(), lsa_get_data(), lsa_print_heap(), lscript_global_get(), lscript_local_get(), lscript_pop_float(), print_pushargf(), LLScriptLSOParse::printGlobals(), safe_instruction_bytestream2float(), and LLScriptLibData::set().

S32 bytestream2integer ( const U8 stream,
S32 offset 
) [inline]

Definition at line 49 of file lscript_byteconvert.h.

Referenced by bytestream2alloc_entry(), bytestream2float(), bytestream2quaternion(), bytestream2vector(), bytestream_int2float(), get_event_register(), get_event_stack_size(), get_handled_events(), get_register(), get_state_event_opcoode_start(), LLScriptDataCollection::LLScriptDataCollection(), LLScriptEventData::LLScriptEventData(), LLScriptExecute::LLScriptExecute(), LLScriptLibData::LLScriptLibData(), LLScriptLSOParse::LLScriptLSOParse(), lsa_decrease_ref_count(), lsa_fprint_heap(), lsa_get_data(), lsa_get_list_ptr(), lsa_print_heap(), lscript_global_get(), lscript_local_get(), lscript_pop_int(), print_call(), print_jump(), print_jumpif(), print_jumpnif(), print_loadglp(), print_loadgp(), print_loadgqp(), print_loadgsp(), print_loadgvp(), print_loadlp(), print_loadp(), print_loadqp(), print_loadsp(), print_loadvp(), print_poparg(), print_push(), print_pusharge(), print_pushargi(), print_pushg(), print_pushgl(), print_pushgq(), print_pushgs(), print_pushgv(), print_pushl(), print_pushq(), print_pushs(), print_pushv(), print_stacktol(), print_stacktos(), print_state(), print_store(), print_storeg(), print_storegl(), print_storegq(), print_storegs(), print_storegv(), print_storel(), print_storeq(), print_stores(), print_storev(), LLScriptLSOParse::printGlobalFunctions(), LLScriptLSOParse::printGlobals(), LLScriptLSOParse::printStates(), run_call(), run_dup(), run_dupl(), run_dups(), run_store(), run_storeg(), run_storegl(), run_storegs(), run_storel(), run_stores(), safe_instruction_bytestream2integer(), LLScriptLibData::set(), and LLScriptEventData::set().

void bytestream2quaternion ( LLQuaternion quat,
const U8 stream,
S32 offset 
) [inline]

Definition at line 250 of file lscript_byteconvert.h.

References bytestream2integer(), llfinite, LSRF_MATH, LLQuaternion::mQ, S32, set_fault(), VS, VX, VY, and VZ.

Referenced by LLScriptLibData::LLScriptLibData(), lsa_fprint_heap(), lsa_get_data(), lsa_print_heap(), lscript_global_get(), lscript_local_get(), lscript_pop_quaternion(), print_pushargq(), LLScriptLSOParse::printGlobals(), LLScriptSAQuaternion::recurse(), run_dupq(), run_storegq(), run_storeq(), safe_instruction_bytestream2quaternion(), and LLScriptLibData::set().

S16 bytestream2s16 ( const U8 stream,
S32 offset 
) [inline]

Definition at line 104 of file lscript_byteconvert.h.

Referenced by bytestream2alloc_entry().

U16 bytestream2u16 ( const U8 stream,
S32 offset 
) [inline]

Definition at line 119 of file lscript_byteconvert.h.

Referenced by print_calllib_two_byte(), and safe_instruction_bytestream2u16().

U64 bytestream2u64 ( const U8 stream,
S32 offset 
) [inline]

Definition at line 63 of file lscript_byteconvert.h.

Referenced by LLScriptScriptCodeChunk::build(), get_event_register(), get_handled_events(), get_register_u64(), and LLScriptLSOParse::printStates().

U32 bytestream2unsigned_integer ( const U8 stream,
S32 offset 
) [inline]

Definition at line 56 of file lscript_byteconvert.h.

void bytestream2uuid ( U8 stream,
S32 offset,
LLUUID uuid 
) [inline]

Definition at line 205 of file lscript_byteconvert.h.

References i, LLUUID::mData, S32, and UUID_BYTES.

void bytestream2vector ( LLVector3 vector,
const U8 stream,
S32 offset 
) [inline]

Definition at line 215 of file lscript_byteconvert.h.

References bytestream2integer(), llfinite, LSRF_MATH, LLVector3::mV, S32, set_fault(), VX, VY, and VZ.

Referenced by LLScriptLibData::LLScriptLibData(), lsa_fprint_heap(), lsa_get_data(), lsa_print_heap(), lscript_global_get(), lscript_local_get(), lscript_pop_vector(), print_pushargv(), LLScriptLSOParse::printGlobals(), LLScriptSAVector::recurse(), run_dupv(), run_storegv(), run_storev(), safe_instruction_bytestream2vector(), and LLScriptLibData::set().

void bytestream_int2float ( U8 stream,
S32 offset 
) [inline]

Definition at line 152 of file lscript_byteconvert.h.

References bytestream2integer(), float2bytestream(), llfinite, LSRF_MATH, S32, and set_fault().

Referenced by LLScriptGlobalVariable::recurse(), LLScriptSAQuaternion::recurse(), and LLScriptSAVector::recurse().

void char2bytestream ( U8 stream,
S32 offset,
char *  buffer 
) [inline]

Definition at line 171 of file lscript_byteconvert.h.

Referenced by lsa_create_data_block(), lsa_insert_data(), and LLScriptLibData::write2bytestream().

static LSCRIPTType char2type ( char  type  )  [inline, static]

Definition at line 1128 of file lscript_byteconvert.h.

References LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_LIST, LST_NULL, LST_QUATERNION, LST_STRING, and LST_VECTOR.

Referenced by LLScriptScript::recurse(), run_calllib(), and run_calllib_two_byte().

void float2bytestream ( U8 stream,
S32 offset,
F32  floatingpoint 
) [inline]

Definition at line 146 of file lscript_byteconvert.h.

References integer2bytestream(), and S32.

Referenced by add_register_fp(), LLScriptByteCodeChunk::addFloat(), bytestream_int2float(), lsa_create_data_block(), lsa_insert_data(), lscript_global_store(), lscript_local_store(), lscript_push(), safe_instruction_float2bytestream(), set_register_fp(), and LLScriptLibData::write2bytestream().

U64 get_event_register ( U8 stream,
LSCRIPTRegisters  reg,
S32  major_version 
) [inline]

Definition at line 317 of file lscript_byteconvert.h.

References bytestream2integer(), bytestream2u64(), gLSCRIPTRegisterAddresses, LREG_CE, LREG_NCE, and S32.

Referenced by get_event_stack_size(), get_state_event_opcoode_start(), LLScriptExecute::run(), and run_state().

S32 get_event_stack_size ( U8 stream,
S32  state,
LSCRIPTStateEventType  event 
) [inline]

Definition at line 858 of file lscript_byteconvert.h.

References bytestream2integer(), get_event_handler_jump_position(), get_event_register(), get_register(), LREG_ER, LREG_SR, LREG_VN, LSCRIPTDataSize, LSL2_MAJOR_VERSION_ONE, LSL2_MAJOR_VERSION_TWO, LSL2_VERSION1_END_NUMBER, LSL2_VERSION_NUMBER, LST_INTEGER, S32, and TOP_OF_MEMORY.

Referenced by LLScriptExecute::run().

U64 get_handled_events ( U8 stream,
S32  state 
) [inline]

Definition at line 833 of file lscript_byteconvert.h.

References bytestream2integer(), bytestream2u64(), get_register(), LREG_SR, LREG_VN, LSCRIPTDataSize, LSL2_VERSION1_END_NUMBER, LSL2_VERSION_NUMBER, LST_INTEGER, and S32.

Referenced by LLScriptExecute::run().

S32 get_register ( const U8 stream,
LSCRIPTRegisters  reg 
) [inline]

Definition at line 294 of file lscript_byteconvert.h.

References bytestream2integer(), gLSCRIPTRegisterAddresses, and S32.

Referenced by get_event_stack_size(), get_handled_events(), get_max_heap_size(), get_state_event_opcoode_start(), lsa_cat_lists(), lsa_cat_strings(), lsa_cmp_lists(), lsa_cmp_strings(), lsa_decrease_ref_count(), lsa_fprint_heap(), lsa_get_data(), lsa_get_list_ptr(), lsa_heap_add_data(), lsa_increase_ref_count(), lsa_insert_data(), lsa_postadd_lists(), lsa_preadd_lists(), lsa_print_heap(), lsa_split_block(), lscript_check_global(), lscript_check_local(), lscript_pop_char(), lscript_pop_float(), lscript_pop_int(), lscript_pop_quaternion(), lscript_pop_variable(), lscript_pop_vector(), lscript_poparg(), lscript_push(), lscript_pusharg(), lscript_pusharge(), lscript_run(), lscript_stacktol_pop_variable(), print_loadglp(), print_loadgp(), print_loadgqp(), print_loadgsp(), print_loadgvp(), print_pushg(), print_pushgl(), print_pushgq(), print_pushgs(), print_pushgv(), print_storeg(), print_storegl(), print_storegq(), print_storegs(), print_storegv(), LLScriptLSOParse::printGlobalFunctions(), LLScriptLSOParse::printGlobals(), LLScriptLSOParse::printHeap(), LLScriptLSOParse::printRegisters(), LLScriptLSOParse::printStates(), LLScriptExecute::run(), run_call(), run_cast(), run_dup(), run_dupl(), run_dupq(), run_dups(), run_dupv(), run_jumpif(), run_jumpnif(), run_print(), run_pushbp(), run_pushsp(), run_stacktol(), run_stacktos(), run_state(), run_store(), run_storeg(), run_storegl(), run_storegq(), run_storegs(), run_storegv(), run_storel(), run_storeq(), run_stores(), run_storev(), safe_heap_check_address(), safe_instruction_check_address(), set_bp(), set_fault(), set_ip(), and set_sp().

F32 get_register_fp ( U8 stream,
LSCRIPTRegisters  reg 
) [inline]

Definition at line 300 of file lscript_byteconvert.h.

References bytestream2float(), gLSCRIPTRegisterAddresses, llfinite, LSRF_MATH, S32, and set_fault().

U64 get_register_u64 ( U8 stream,
LSCRIPTRegisters  reg 
) [inline]

Definition at line 311 of file lscript_byteconvert.h.

References bytestream2u64(), gLSCRIPTRegisterAddresses, and S32.

Referenced by LLScriptLSOParse::printRegisters().

S32 get_state_event_opcoode_start ( U8 stream,
S32  state,
LSCRIPTStateEventType  event 
) [inline]

Definition at line 767 of file lscript_byteconvert.h.

References bytestream2integer(), get_event_handler_jump_position(), get_event_register(), get_register(), LREG_ER, LREG_SR, LREG_VN, LSCRIPTDataSize, LSL2_MAJOR_VERSION_ONE, LSL2_MAJOR_VERSION_TWO, LSL2_VERSION1_END_NUMBER, LSL2_VERSION_NUMBER, LST_INTEGER, S32, and TOP_OF_MEMORY.

Referenced by LLScriptExecute::setStateEventOpcoodeStartSafely().

void integer2bytestream ( U8 stream,
S32 offset,
S32  integer 
) [inline]

Definition at line 71 of file lscript_byteconvert.h.

Referenced by LLScriptByteCodeChunk::addInteger(), alloc_entry2bytestream(), LLScriptByteCodeChunk::connectJumps(), float2bytestream(), lsa_create_data_block(), lsa_insert_data(), lscript_global_store(), lscript_local_store(), lscript_push(), quaternion2bytestream(), LLScriptScript::recurse(), LLScriptState::recurse(), LLScriptGlobalFunctions::recurse(), LLScriptEventHandler::recurse(), LLScriptGlobalVariable::recurse(), safe_instruction_integer2bytestream(), set_event_register(), set_register(), vector2bytestream(), LLScriptLibData::write2bytestream(), LLScriptEventData::write2bytestream(), and LLScriptDataCollection::write2bytestream().

void lsa_print_heap ( U8 buffer  ) 

Definition at line 782 of file lscript_library/lscript_alloc.cpp.

References bytestream2alloc_entry(), bytestream2char(), bytestream2float(), bytestream2integer(), bytestream2quaternion(), bytestream2vector(), get_register(), LREG_HP, LREG_HR, LSCRIPTTypeNames, LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_LIST, LST_QUATERNION, LST_STRING, LST_VECTOR, MAX_HEAP_SIZE, LLQuaternion::mQ, LLScriptAllocEntry::mReferenceCount, LLScriptAllocEntry::mSize, LLScriptAllocEntry::mType, LLVector3::mV, S32, VS, VX, VY, and VZ.

BOOL lscript_check_global ( U8 stream,
S32 address,
S32  size 
) [inline]

Definition at line 635 of file lscript_byteconvert.h.

References FALSE, get_register(), LREG_GFR, LREG_GVR, LSRF_BOUND_CHECK_ERROR, S32, set_fault(), and TRUE.

Referenced by lscript_global_get(), and lscript_global_store().

BOOL lscript_check_local ( U8 stream,
S32 address,
S32  size 
) [inline]

Definition at line 613 of file lscript_byteconvert.h.

References FALSE, get_register(), LREG_BP, LREG_SP, LREG_TM, LSRF_BOUND_CHECK_ERROR, S32, set_fault(), tut::tm(), and TRUE.

Referenced by lscript_local_get(), and lscript_local_store().

void lscript_global_get ( U8 stream,
S32  address,
LLQuaternion value 
) [inline]

Definition at line 759 of file lscript_byteconvert.h.

References bytestream2quaternion(), lscript_check_global(), LSCRIPTDataSize, and LST_QUATERNION.

void lscript_global_get ( U8 stream,
S32  address,
LLVector3 value 
) [inline]

Definition at line 753 of file lscript_byteconvert.h.

References bytestream2vector(), lscript_check_global(), LSCRIPTDataSize, and LST_VECTOR.

void lscript_global_get ( U8 stream,
S32  address,
F32 value 
) [inline]

Definition at line 742 of file lscript_byteconvert.h.

References bytestream2float(), llfinite, lscript_check_global(), LSCRIPTDataSize, LSRF_MATH, LST_FLOATINGPOINT, and set_fault().

S32 lscript_global_get ( U8 stream,
S32  address 
) [inline]

Definition at line 735 of file lscript_byteconvert.h.

References bytestream2integer(), lscript_check_global(), LSCRIPTDataSize, and LST_INTEGER.

Referenced by run_loadglp(), run_loadgsp(), run_pushg(), run_pushgl(), run_pushgq(), run_pushgs(), run_pushgv(), run_storegl(), and run_storegs().

void lscript_global_store ( U8 stream,
S32  address,
LLQuaternion  value 
) [inline]

Definition at line 699 of file lscript_byteconvert.h.

References lscript_check_global(), LSCRIPTDataSize, LST_QUATERNION, and quaternion2bytestream().

void lscript_global_store ( U8 stream,
S32  address,
LLVector3  value 
) [inline]

Definition at line 693 of file lscript_byteconvert.h.

References lscript_check_global(), LSCRIPTDataSize, LST_VECTOR, and vector2bytestream().

void lscript_global_store ( U8 stream,
S32  address,
F32  value 
) [inline]

Definition at line 687 of file lscript_byteconvert.h.

References float2bytestream(), lscript_check_global(), LSCRIPTDataSize, and LST_FLOATINGPOINT.

void lscript_global_store ( U8 stream,
S32  address,
S32  value 
) [inline]

Definition at line 681 of file lscript_byteconvert.h.

References integer2bytestream(), lscript_check_global(), LSCRIPTDataSize, and LST_INTEGER.

Referenced by run_loadglp(), run_loadgp(), run_loadgqp(), run_loadgsp(), run_loadgvp(), run_storeg(), run_storegl(), run_storegq(), run_storegs(), and run_storegv().

void lscript_local_get ( U8 stream,
S32  address,
LLQuaternion value 
) [inline]

Definition at line 729 of file lscript_byteconvert.h.

References bytestream2quaternion(), lscript_check_local(), LSCRIPTDataSize, and LST_QUATERNION.

void lscript_local_get ( U8 stream,
S32  address,
LLVector3 value 
) [inline]

Definition at line 723 of file lscript_byteconvert.h.

References bytestream2vector(), lscript_check_local(), LSCRIPTDataSize, and LST_VECTOR.

void lscript_local_get ( U8 stream,
S32  address,
F32 value 
) [inline]

Definition at line 712 of file lscript_byteconvert.h.

References bytestream2float(), llfinite, lscript_check_local(), LSCRIPTDataSize, LSRF_MATH, LST_FLOATINGPOINT, and set_fault().

S32 lscript_local_get ( U8 stream,
S32  address 
) [inline]

Definition at line 705 of file lscript_byteconvert.h.

References bytestream2integer(), lscript_check_local(), LSCRIPTDataSize, and LST_INTEGER.

Referenced by run_loadlp(), run_loadsp(), run_push(), run_pushl(), run_pushq(), run_pushs(), run_pushv(), run_storel(), and run_stores().

void lscript_local_store ( U8 stream,
S32  address,
LLQuaternion  value 
) [inline]

Definition at line 675 of file lscript_byteconvert.h.

References lscript_check_local(), LSCRIPTDataSize, LST_QUATERNION, and quaternion2bytestream().

void lscript_local_store ( U8 stream,
S32  address,
LLVector3  value 
) [inline]

Definition at line 669 of file lscript_byteconvert.h.

References lscript_check_local(), LSCRIPTDataSize, LST_VECTOR, and vector2bytestream().

void lscript_local_store ( U8 stream,
S32  address,
F32  value 
) [inline]

Definition at line 663 of file lscript_byteconvert.h.

References float2bytestream(), lscript_check_local(), LSCRIPTDataSize, and LST_FLOATINGPOINT.

void lscript_local_store ( U8 stream,
S32  address,
S32  value 
) [inline]

Definition at line 657 of file lscript_byteconvert.h.

References integer2bytestream(), lscript_check_local(), LSCRIPTDataSize, and LST_INTEGER.

Referenced by lscript_push_return_variable(), run_call(), run_loadlp(), run_loadp(), run_loadqp(), run_loadsp(), run_loadvp(), run_store(), run_storel(), run_storeq(), run_stores(), and run_storev().

U8 lscript_pop_char ( U8 stream  )  [inline]

Definition at line 556 of file lscript_byteconvert.h.

References get_register(), LREG_SP, S32, and set_sp().

Referenced by run_stacktol(), and run_stacktos().

F32 lscript_pop_float ( U8 stream  )  [inline]

Definition at line 572 of file lscript_byteconvert.h.

References bytestream2float(), get_register(), llfinite, LREG_SP, LSRF_MATH, S32, set_fault(), and set_sp().

Referenced by float_float_operation(), float_integer_operation(), float_list_operation(), float_operation(), float_vector_operation(), integer_float_operation(), list_float_operation(), lscript_pop_variable(), lscript_stacktol_pop_variable(), run_cast(), run_jumpif(), run_jumpnif(), run_print(), and vector_float_operation().

S32 lscript_pop_int ( U8 stream  )  [inline]

Definition at line 564 of file lscript_byteconvert.h.

References bytestream2integer(), get_register(), LREG_SP, S32, and set_sp().

Referenced by float_integer_operation(), float_list_operation(), integer_float_operation(), integer_integer_operation(), integer_list_operation(), integer_operation(), integer_vector_operation(), key_key_operation(), key_list_operation(), key_string_operation(), list_float_operation(), list_integer_operation(), list_key_operation(), list_list_operation(), list_quaternion_operation(), list_string_operation(), list_vector_operation(), lscript_pop_variable(), lscript_stacktol_pop_variable(), quaternion_list_operation(), run_calllib(), run_calllib_two_byte(), run_cast(), run_jumpif(), run_jumpnif(), run_loadglp(), run_loadgp(), run_loadgsp(), run_loadlp(), run_loadp(), run_loadsp(), run_popbp(), run_popip(), run_popl(), run_pops(), run_popslr(), run_popsp(), run_print(), run_return(), run_stacktos(), run_state(), string_key_operation(), string_list_operation(), string_string_operation(), vector_integer_operation(), and vector_list_operation().

void lscript_pop_quaternion ( U8 stream,
LLQuaternion value 
) [inline]

Definition at line 592 of file lscript_byteconvert.h.

References bytestream2quaternion(), get_register(), LREG_SP, S32, and set_sp().

Referenced by list_quaternion_operation(), lscript_pop_variable(), lscript_stacktol_pop_variable(), quaternion_list_operation(), quaternion_operation(), quaternion_quaternion_operation(), run_cast(), run_jumpif(), run_jumpnif(), run_loadgqp(), run_loadqp(), run_print(), and vector_quaternion_operation().

void lscript_pop_vector ( U8 stream,
LLVector3 value 
) [inline]

Definition at line 585 of file lscript_byteconvert.h.

References bytestream2vector(), get_register(), LREG_SP, S32, and set_sp().

Referenced by float_vector_operation(), integer_vector_operation(), list_vector_operation(), lscript_pop_variable(), lscript_stacktol_pop_variable(), run_cast(), run_jumpif(), run_jumpnif(), run_loadgvp(), run_loadvp(), run_print(), vector_float_operation(), vector_integer_operation(), vector_list_operation(), vector_operation(), vector_quaternion_operation(), and vector_vector_operation().

void lscript_poparg ( U8 stream,
S32  arg 
) [inline]

Definition at line 548 of file lscript_byteconvert.h.

References get_register(), LREG_SP, S32, and set_sp().

Referenced by run_calllib(), run_calllib_two_byte(), run_pop(), run_poparg(), run_popq(), and run_popv().

void lscript_push ( U8 stream,
LLQuaternion value 
) [inline]

Definition at line 529 of file lscript_byteconvert.h.

References get_register(), LREG_SP, LSCRIPTDataSize, LST_QUATERNION, quaternion2bytestream(), S32, and set_sp().

void lscript_push ( U8 stream,
LLVector3 value 
) [inline]

Definition at line 518 of file lscript_byteconvert.h.

References get_register(), LREG_SP, LSCRIPTDataSize, LST_VECTOR, S32, set_sp(), and vector2bytestream().

void lscript_push ( U8 stream,
F32  value 
) [inline]

Definition at line 507 of file lscript_byteconvert.h.

References float2bytestream(), get_register(), LREG_SP, LSCRIPTDataSize, LST_FLOATINGPOINT, S32, and set_sp().

void lscript_push ( U8 stream,
S32  value 
) [inline]

Definition at line 496 of file lscript_byteconvert.h.

References get_register(), integer2bytestream(), LREG_SP, LSCRIPTDataSize, LST_INTEGER, S32, and set_sp().

void lscript_push ( U8 stream,
U8  value 
) [inline]

Definition at line 485 of file lscript_byteconvert.h.

References get_register(), LREG_SP, S32, and set_sp().

Referenced by float_float_operation(), float_integer_operation(), float_list_operation(), float_operation(), float_vector_operation(), integer_float_operation(), integer_integer_operation(), integer_list_operation(), integer_operation(), integer_vector_operation(), key_key_operation(), key_list_operation(), key_string_operation(), list_float_operation(), list_integer_operation(), list_key_operation(), list_list_operation(), list_quaternion_operation(), list_string_operation(), list_vector_operation(), lscript_push_variable(), quaternion_list_operation(), quaternion_operation(), quaternion_quaternion_operation(), LLScriptExecute::run(), run_cast(), run_dup(), run_dupl(), run_dupq(), run_dups(), run_dupv(), run_push(), run_pushargb(), run_pushargf(), run_pushargi(), run_pushargq(), run_pushargs(), run_pushargv(), run_pushbp(), run_pushg(), run_pushgl(), run_pushgq(), run_pushgs(), run_pushgv(), run_puship(), run_pushl(), run_pushq(), run_pushs(), run_pushsp(), run_pushv(), run_stacktol(), run_stacktos(), string_key_operation(), string_list_operation(), string_string_operation(), vector_float_operation(), vector_integer_operation(), vector_list_operation(), vector_operation(), vector_quaternion_operation(), and vector_vector_operation().

void lscript_pusharg ( U8 stream,
S32  arg 
) [inline]

Definition at line 540 of file lscript_byteconvert.h.

References get_register(), LREG_SP, S32, and set_sp().

void lscript_pusharge ( U8 stream,
S32  value 
) [inline]

Definition at line 599 of file lscript_byteconvert.h.

References get_register(), i, LREG_SP, S32, and set_sp().

Referenced by LLScriptExecute::run(), run_pusharge(), run_pushe(), run_pusheq(), and run_pushev().

void quaternion2bytestream ( U8 stream,
S32 offset,
LLQuaternion quat 
) [inline]

Definition at line 282 of file lscript_byteconvert.h.

References integer2bytestream(), LLQuaternion::mQ, S32, VS, VX, VY, and VZ.

Referenced by lsa_create_data_block(), lsa_insert_data(), lscript_global_store(), lscript_local_store(), lscript_push(), safe_instruction_quaternion2bytestream(), and LLScriptLibData::write2bytestream().

void reset_hp_to_safe_spot ( const U8 buffer  ) 

Definition at line 63 of file lscript_library/lscript_alloc.cpp.

References LREG_HP, set_register(), and TOP_OF_MEMORY.

LSCRIPTStateEventType return_first_event ( S32  event  )  [inline]

Definition at line 914 of file lscript_byteconvert.h.

References count, LSTT_EOF, LSTT_NULL, and S32.

Referenced by LLScriptExecute::run().

void s162bytestream ( U8 stream,
S32 offset,
S16  integer 
) [inline]

Definition at line 111 of file lscript_byteconvert.h.

Referenced by alloc_entry2bytestream().

void safe_heap_bytestream_count_char ( U8 stream,
S32 offset 
) [inline]

Definition at line 1082 of file lscript_byteconvert.h.

References safe_heap_check_address().

Referenced by lscript_pop_variable(), lscript_stacktol_pop_variable(), run_cast(), run_jumpif(), run_jumpnif(), and run_print().

BOOL safe_heap_check_address ( U8 stream,
S32  offset,
S32  size 
) [inline]

Definition at line 959 of file lscript_byteconvert.h.

References FALSE, get_register(), LREG_HP, LREG_HR, LSRF_BOUND_CHECK_ERROR, S32, set_fault(), and TRUE.

Referenced by lscript_pop_variable(), lscript_stacktol_pop_variable(), run_cast(), run_jumpif(), run_jumpnif(), run_print(), and safe_heap_bytestream_count_char().

void safe_instruction_byte2bytestream ( U8 stream,
S32 offset,
U8  byte 
) [inline]

Definition at line 994 of file lscript_byteconvert.h.

References safe_instruction_check_address().

U8 safe_instruction_bytestream2byte ( U8 stream,
S32 offset 
) [inline]

Definition at line 982 of file lscript_byteconvert.h.

References safe_instruction_check_address().

Referenced by LLScriptExecute::run(), run_add(), run_calllib(), run_cast(), run_div(), run_eq(), run_geq(), run_greater(), run_jumpif(), run_jumpnif(), run_leq(), run_less(), run_mod(), run_mul(), run_neg(), run_neq(), run_print(), run_pushargb(), and run_sub().

void safe_instruction_bytestream2char ( char *  buffer,
U8 stream,
S32 offset 
) [inline]

Definition at line 1068 of file lscript_byteconvert.h.

References safe_instruction_check_address().

Referenced by run_pushargs().

F32 safe_instruction_bytestream2float ( U8 stream,
S32 offset 
) [inline]

Definition at line 1042 of file lscript_byteconvert.h.

References bytestream2float(), llfinite, LSCRIPTDataSize, LSRF_MATH, LST_INTEGER, safe_instruction_check_address(), and set_fault().

Referenced by run_pushargf().

S32 safe_instruction_bytestream2integer ( U8 stream,
S32 offset 
) [inline]

Definition at line 1002 of file lscript_byteconvert.h.

References bytestream2integer(), LSCRIPTDataSize, LST_INTEGER, and safe_instruction_check_address().

Referenced by run_call(), run_jump(), run_jumpif(), run_jumpnif(), run_loadglp(), run_loadgp(), run_loadgqp(), run_loadgsp(), run_loadgvp(), run_loadlp(), run_loadp(), run_loadqp(), run_loadsp(), run_loadvp(), run_poparg(), run_push(), run_pusharge(), run_pushargi(), run_pushg(), run_pushgl(), run_pushgq(), run_pushgs(), run_pushgv(), run_pushl(), run_pushq(), run_pushs(), run_pushv(), run_stacktol(), run_state(), run_store(), run_storeg(), run_storegl(), run_storegq(), run_storegs(), run_storegv(), run_storel(), run_storeq(), run_stores(), and run_storev().

void safe_instruction_bytestream2quaternion ( LLQuaternion value,
U8 stream,
S32 offset 
) [inline]

Definition at line 1112 of file lscript_byteconvert.h.

References bytestream2quaternion(), LSCRIPTDataSize, LST_QUATERNION, and safe_instruction_check_address().

Referenced by run_pushargq().

U16 safe_instruction_bytestream2u16 ( U8 stream,
S32 offset 
) [inline]

Definition at line 1022 of file lscript_byteconvert.h.

References bytestream2u16(), and safe_instruction_check_address().

Referenced by run_calllib_two_byte().

void safe_instruction_bytestream2vector ( LLVector3 value,
U8 stream,
S32 offset 
) [inline]

Definition at line 1096 of file lscript_byteconvert.h.

References bytestream2vector(), LSCRIPTDataSize, LST_VECTOR, and safe_instruction_check_address().

Referenced by run_pushargv().

void safe_instruction_bytestream_count_char ( U8 stream,
S32 offset 
) [inline]

Definition at line 1075 of file lscript_byteconvert.h.

References safe_instruction_check_address().

Referenced by run_pushargs().

void safe_instruction_char2bytestream ( U8 stream,
S32 offset,
char *  buffer 
) [inline]

Definition at line 1089 of file lscript_byteconvert.h.

References safe_instruction_check_address().

BOOL safe_instruction_check_address ( U8 stream,
S32  offset,
S32  size 
) [inline]

Definition at line 936 of file lscript_byteconvert.h.

References FALSE, get_register(), LREG_GFR, LREG_HR, LSRF_BOUND_CHECK_ERROR, S32, set_fault(), and TRUE.

Referenced by safe_instruction_byte2bytestream(), safe_instruction_bytestream2byte(), safe_instruction_bytestream2char(), safe_instruction_bytestream2float(), safe_instruction_bytestream2integer(), safe_instruction_bytestream2quaternion(), safe_instruction_bytestream2u16(), safe_instruction_bytestream2vector(), safe_instruction_bytestream_count_char(), safe_instruction_char2bytestream(), safe_instruction_float2bytestream(), safe_instruction_integer2bytestream(), safe_instruction_quaternion2bytestream(), safe_instruction_u162bytestream(), and safe_instruction_vector2bytestream().

void safe_instruction_float2bytestream ( U8 stream,
S32 offset,
F32  value 
) [inline]

Definition at line 1060 of file lscript_byteconvert.h.

References float2bytestream(), LSCRIPTDataSize, LST_FLOATINGPOINT, and safe_instruction_check_address().

void safe_instruction_integer2bytestream ( U8 stream,
S32 offset,
S32  value 
) [inline]

Definition at line 1014 of file lscript_byteconvert.h.

References integer2bytestream(), LSCRIPTDataSize, LST_INTEGER, and safe_instruction_check_address().

void safe_instruction_quaternion2bytestream ( U8 stream,
S32 offset,
LLQuaternion value 
) [inline]

Definition at line 1120 of file lscript_byteconvert.h.

References LSCRIPTDataSize, LST_QUATERNION, quaternion2bytestream(), and safe_instruction_check_address().

void safe_instruction_u162bytestream ( U8 stream,
S32 offset,
U16  value 
) [inline]

Definition at line 1034 of file lscript_byteconvert.h.

References safe_instruction_check_address(), and u162bytestream().

void safe_instruction_vector2bytestream ( U8 stream,
S32 offset,
LLVector3 value 
) [inline]

Definition at line 1104 of file lscript_byteconvert.h.

References LSCRIPTDataSize, LST_VECTOR, safe_instruction_check_address(), and vector2bytestream().

BOOL set_bp ( U8 stream,
S32  bp 
) [inline]

Definition at line 436 of file lscript_byteconvert.h.

References FALSE, get_register(), LREG_BP, LREG_HP, LREG_SP, LREG_TM, LSRF_BOUND_CHECK_ERROR, LSRF_STACK_HEAP_COLLISION, S32, set_fault(), set_register(), tut::tm(), and TRUE.

Referenced by LLScriptExecute::run(), run_calllib(), run_calllib_two_byte(), run_popbp(), run_return(), and run_state().

void set_event_register ( U8 stream,
LSCRIPTRegisters  reg,
U64  value,
S32  major_version 
) [inline]

Definition at line 354 of file lscript_byteconvert.h.

References gLSCRIPTRegisterAddresses, integer2bytestream(), LREG_CE, LREG_NCE, S32, and u642bytestream().

Referenced by LLScriptScriptCodeChunk::build(), LLScriptExecute::run(), and run_state().

void set_fault ( const U8 stream,
LSCRIPTRunTimeFaults  fault 
) [inline]

Definition at line 392 of file lscript_byteconvert.h.

References get_register(), LREG_FR, LSCRIPTRunTimeFaultBits, LSRF_BOUND_CHECK_ERROR, LSRF_HEAP_ERROR, LSRF_STACK_HEAP_COLLISION, reset_hp_to_safe_spot(), S32, and set_register().

Referenced by add_register_fp(), alloc_entry2bytestream(), bytestream2alloc_entry(), bytestream2float(), bytestream2quaternion(), bytestream2vector(), bytestream_int2float(), float_float_operation(), float_integer_operation(), get_register_fp(), integer_float_operation(), integer_integer_operation(), lsa_cat_lists(), lsa_cat_strings(), lsa_cmp_lists(), lsa_cmp_strings(), lsa_decrease_ref_count(), lsa_get_data(), lsa_get_list_ptr(), lsa_heap_add_data(), lsa_increase_ref_count(), lsa_postadd_lists(), lsa_preadd_lists(), lscript_check_global(), lscript_check_local(), lscript_global_get(), lscript_local_get(), lscript_pop_float(), LLScriptExecute::recordBoundaryError(), LLScriptExecute::run(), run_call(), run_calllib(), run_calllib_two_byte(), safe_heap_check_address(), safe_instruction_bytestream2float(), safe_instruction_check_address(), set_bp(), set_ip(), set_sp(), vector_float_operation(), and vector_integer_operation().

BOOL set_ip ( U8 stream,
S32  ip 
) [inline]

Definition at line 410 of file lscript_byteconvert.h.

References FALSE, get_register(), LREG_GFR, LREG_HR, LREG_IP, LSRF_BOUND_CHECK_ERROR, S32, set_fault(), set_register(), and TRUE.

Referenced by LLScriptExecute::run(), and LLScriptExecute::setStateEventOpcoodeStartSafely().

void set_register ( U8 stream,
LSCRIPTRegisters  reg,
S32  value 
) [inline]

Definition at line 336 of file lscript_byteconvert.h.

References gLSCRIPTRegisterAddresses, integer2bytestream(), and S32.

Referenced by LLScriptScriptCodeChunk::build(), lsa_heap_add_data(), reset_hp_to_safe_spot(), LLScriptExecute::run(), run_popslr(), run_state(), set_bp(), set_fault(), set_ip(), and set_sp().

void set_register_fp ( U8 stream,
LSCRIPTRegisters  reg,
F32  value 
) [inline]

Definition at line 342 of file lscript_byteconvert.h.

References float2bytestream(), gLSCRIPTRegisterAddresses, and S32.

void set_register_u64 ( U8 stream,
LSCRIPTRegisters  reg,
U64  value 
) [inline]

Definition at line 348 of file lscript_byteconvert.h.

References gLSCRIPTRegisterAddresses, S32, and u642bytestream().

BOOL set_sp ( U8 stream,
S32  sp 
) [inline]

Definition at line 464 of file lscript_byteconvert.h.

References FALSE, get_register(), LREG_HP, LREG_SP, LREG_TM, LSRF_BOUND_CHECK_ERROR, LSRF_STACK_HEAP_COLLISION, S32, set_fault(), set_register(), tut::tm(), and TRUE.

Referenced by lscript_pop_char(), lscript_pop_float(), lscript_pop_int(), lscript_pop_quaternion(), lscript_pop_vector(), lscript_poparg(), lscript_push(), lscript_pusharg(), lscript_pusharge(), and run_popsp().

void u162bytestream ( U8 stream,
S32 offset,
U16  integer 
) [inline]

Definition at line 126 of file lscript_byteconvert.h.

Referenced by LLScriptByteCodeChunk::addU16(), and safe_instruction_u162bytestream().

void u642bytestream ( U8 stream,
S32 offset,
U64  integer 
) [inline]

Definition at line 90 of file lscript_byteconvert.h.

Referenced by LLScriptState::recurse(), set_event_register(), and set_register_u64().

void unsigned_integer2bytestream ( U8 stream,
S32 offset,
U32  integer 
) [inline]

Definition at line 81 of file lscript_byteconvert.h.

void uuid2bytestream ( U8 stream,
S32 offset,
const LLUUID uuid 
) [inline]

Definition at line 196 of file lscript_byteconvert.h.

References i, LLUUID::mData, S32, and UUID_BYTES.

void vector2bytestream ( U8 stream,
S32 offset,
LLVector3 vector 
) [inline]

Definition at line 240 of file lscript_byteconvert.h.

References integer2bytestream(), LLVector3::mV, S32, VX, VY, and VZ.

Referenced by lsa_create_data_block(), lsa_insert_data(), lscript_global_store(), lscript_local_store(), lscript_push(), safe_instruction_vector2bytestream(), and LLScriptLibData::write2bytestream().


Generated on Thu Jul 1 06:10:52 2010 for Second Life Viewer by  doxygen 1.4.7