Removing m_ prefix from identifiers (m_ValueType -> ValueType, ...).

This commit is contained in:
Ruben Ayrapetyan 2014-07-23 11:41:58 +04:00
parent 3ef9ee9eb4
commit 2d4ed154ee
14 changed files with 370 additions and 370 deletions

View File

@ -64,10 +64,10 @@ typedef enum
*/
typedef struct mem_BlockHeader_t
{
mem_MagicNumOfBlock_t m_MagicNum; /**< magic number - MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK for allocated block
and MEM_MAGIC_NUM_OF_FREE_BLOCK for free block */
struct mem_BlockHeader_t *m_Neighbours[ MEM_DIRECTION_COUNT ]; /**< neighbour blocks */
size_t allocated_bytes; /**< allocated area size - for allocated blocks; 0 - for free blocks */
mem_MagicNumOfBlock_t MagicNum; /**< magic number - MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK for allocated block
and MEM_MAGIC_NUM_OF_FREE_BLOCK for free block */
struct mem_BlockHeader_t *Neighbours[ MEM_DIRECTION_COUNT ]; /**< neighbour blocks */
size_t allocated_bytes; /**< allocated area size - for allocated blocks; 0 - for free blocks */
} mem_BlockHeader_t;
/**
@ -85,10 +85,10 @@ JERRY_STATIC_ASSERT( MEM_HEAP_CHUNK_SIZE % MEM_ALIGNMENT == 0 );
*/
typedef struct
{
uint8_t* m_HeapStart; /**< first address of heap space */
size_t m_HeapSize; /**< heap space size */
mem_BlockHeader_t* m_pFirstBlock; /**< first block of the heap */
mem_BlockHeader_t* m_pLastBlock; /**< last block of the heap */
uint8_t* HeapStart; /**< first address of heap space */
size_t HeapSize; /**< heap space size */
mem_BlockHeader_t* pFirstBlock; /**< first block of the heap */
mem_BlockHeader_t* pLastBlock; /**< last block of the heap */
} mem_HeapState_t;
/**
@ -136,18 +136,18 @@ mem_get_block_chunks_count( const mem_BlockHeader_t *block_header_p) /**< block
{
JERRY_ASSERT( block_header_p != NULL );
const mem_BlockHeader_t *next_block_p = block_header_p->m_Neighbours[ MEM_DIRECTION_NEXT ];
const mem_BlockHeader_t *next_block_p = block_header_p->Neighbours[ MEM_DIRECTION_NEXT ];
size_t dist_till_block_end;
if ( next_block_p == NULL )
{
dist_till_block_end = (size_t) ( mem_Heap.m_HeapStart + mem_Heap.m_HeapSize - (uint8_t*) block_header_p );
dist_till_block_end = (size_t) ( mem_Heap.HeapStart + mem_Heap.HeapSize - (uint8_t*) block_header_p );
} else
{
dist_till_block_end = (size_t) ( (uint8_t*) next_block_p - (uint8_t*) block_header_p );
}
JERRY_ASSERT( dist_till_block_end <= mem_Heap.m_HeapSize );
JERRY_ASSERT( dist_till_block_end <= mem_Heap.HeapSize );
JERRY_ASSERT( dist_till_block_end % MEM_HEAP_CHUNK_SIZE == 0 );
return dist_till_block_end / MEM_HEAP_CHUNK_SIZE;
@ -187,17 +187,17 @@ mem_HeapInit(uint8_t *heapStart, /**< first address of heap space */
JERRY_ASSERT( heapSize % MEM_HEAP_CHUNK_SIZE == 0 );
JERRY_ASSERT( (uintptr_t) heapStart % MEM_ALIGNMENT == 0);
mem_Heap.m_HeapStart = heapStart;
mem_Heap.m_HeapSize = heapSize;
mem_Heap.HeapStart = heapStart;
mem_Heap.HeapSize = heapSize;
mem_InitBlockHeader(mem_Heap.m_HeapStart,
mem_InitBlockHeader(mem_Heap.HeapStart,
0,
MEM_BLOCK_FREE,
NULL,
NULL);
mem_Heap.m_pFirstBlock = (mem_BlockHeader_t*) mem_Heap.m_HeapStart;
mem_Heap.m_pLastBlock = mem_Heap.m_pFirstBlock;
mem_Heap.pFirstBlock = (mem_BlockHeader_t*) mem_Heap.HeapStart;
mem_Heap.pLastBlock = mem_Heap.pFirstBlock;
mem_HeapStatInit();
} /* mem_HeapInit */
@ -216,16 +216,16 @@ mem_InitBlockHeader( uint8_t *pFirstChunk, /**< address of the first chu
if ( blockState == MEM_BLOCK_FREE )
{
pBlockHeader->m_MagicNum = MEM_MAGIC_NUM_OF_FREE_BLOCK;
pBlockHeader->MagicNum = MEM_MAGIC_NUM_OF_FREE_BLOCK;
JERRY_ASSERT( allocated_bytes == 0 );
} else
{
pBlockHeader->m_MagicNum = MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK;
pBlockHeader->MagicNum = MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK;
}
pBlockHeader->m_Neighbours[ MEM_DIRECTION_PREV ] = pPrevBlock;
pBlockHeader->m_Neighbours[ MEM_DIRECTION_NEXT ] = pNextBlock;
pBlockHeader->Neighbours[ MEM_DIRECTION_PREV ] = pPrevBlock;
pBlockHeader->Neighbours[ MEM_DIRECTION_NEXT ] = pNextBlock;
pBlockHeader->allocated_bytes = allocated_bytes;
JERRY_ASSERT( allocated_bytes <= mem_get_block_data_space_size( pBlockHeader) );
@ -255,18 +255,18 @@ mem_HeapAllocBlock( size_t sizeInBytes, /**< size of region to allocat
if ( allocTerm == MEM_HEAP_ALLOC_SHORT_TERM )
{
pBlock = mem_Heap.m_pFirstBlock;
pBlock = mem_Heap.pFirstBlock;
direction = MEM_DIRECTION_NEXT;
} else
{
pBlock = mem_Heap.m_pLastBlock;
pBlock = mem_Heap.pLastBlock;
direction = MEM_DIRECTION_PREV;
}
/* searching for appropriate block */
while ( pBlock != NULL )
{
if ( pBlock->m_MagicNum == MEM_MAGIC_NUM_OF_FREE_BLOCK )
if ( pBlock->MagicNum == MEM_MAGIC_NUM_OF_FREE_BLOCK )
{
if ( mem_get_block_data_space_size( pBlock) >= sizeInBytes )
{
@ -274,10 +274,10 @@ mem_HeapAllocBlock( size_t sizeInBytes, /**< size of region to allocat
}
} else
{
JERRY_ASSERT( pBlock->m_MagicNum == MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK );
JERRY_ASSERT( pBlock->MagicNum == MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK );
}
pBlock = pBlock->m_Neighbours[ direction ];
pBlock = pBlock->Neighbours[ direction ];
}
if ( pBlock == NULL )
@ -292,8 +292,8 @@ mem_HeapAllocBlock( size_t sizeInBytes, /**< size of region to allocat
JERRY_ASSERT( newBlockSizeInChunks <= foundBlockSizeInChunks );
mem_BlockHeader_t *pPrevBlock = pBlock->m_Neighbours[ MEM_DIRECTION_PREV ];
mem_BlockHeader_t *pNextBlock = pBlock->m_Neighbours[ MEM_DIRECTION_NEXT ];
mem_BlockHeader_t *pPrevBlock = pBlock->Neighbours[ MEM_DIRECTION_PREV ];
mem_BlockHeader_t *pNextBlock = pBlock->Neighbours[ MEM_DIRECTION_NEXT ];
if ( newBlockSizeInChunks < foundBlockSizeInChunks )
{
@ -310,7 +310,7 @@ mem_HeapAllocBlock( size_t sizeInBytes, /**< size of region to allocat
if ( pNextBlock == NULL )
{
mem_Heap.m_pLastBlock = pNewFreeBlock;
mem_Heap.pLastBlock = pNewFreeBlock;
}
pNextBlock = pNewFreeBlock;
@ -342,57 +342,57 @@ void
mem_HeapFreeBlock( uint8_t *ptr) /**< pointer to beginning of data space of the block */
{
/* checking that ptr points to the heap */
JERRY_ASSERT( ptr >= mem_Heap.m_HeapStart
&& ptr <= mem_Heap.m_HeapStart + mem_Heap.m_HeapSize );
JERRY_ASSERT( ptr >= mem_Heap.HeapStart
&& ptr <= mem_Heap.HeapStart + mem_Heap.HeapSize );
mem_CheckHeap();
mem_BlockHeader_t *pBlock = (mem_BlockHeader_t*) ptr - 1;
mem_BlockHeader_t *pPrevBlock = pBlock->m_Neighbours[ MEM_DIRECTION_PREV ];
mem_BlockHeader_t *pNextBlock = pBlock->m_Neighbours[ MEM_DIRECTION_NEXT ];
mem_BlockHeader_t *pPrevBlock = pBlock->Neighbours[ MEM_DIRECTION_PREV ];
mem_BlockHeader_t *pNextBlock = pBlock->Neighbours[ MEM_DIRECTION_NEXT ];
mem_HeapStatFreeBlock( pBlock);
/* checking magic nums that are neighbour to data space */
JERRY_ASSERT( pBlock->m_MagicNum == MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK );
JERRY_ASSERT( pBlock->MagicNum == MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK );
if ( pNextBlock != NULL )
{
JERRY_ASSERT( pNextBlock->m_MagicNum == MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK
|| pNextBlock->m_MagicNum == MEM_MAGIC_NUM_OF_FREE_BLOCK );
JERRY_ASSERT( pNextBlock->MagicNum == MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK
|| pNextBlock->MagicNum == MEM_MAGIC_NUM_OF_FREE_BLOCK );
}
pBlock->m_MagicNum = MEM_MAGIC_NUM_OF_FREE_BLOCK;
pBlock->MagicNum = MEM_MAGIC_NUM_OF_FREE_BLOCK;
if ( pNextBlock != NULL
&& pNextBlock->m_MagicNum == MEM_MAGIC_NUM_OF_FREE_BLOCK )
&& pNextBlock->MagicNum == MEM_MAGIC_NUM_OF_FREE_BLOCK )
{
/* merge with the next block */
mem_HeapStatFreeBlockMerge();
pNextBlock = pNextBlock->m_Neighbours[ MEM_DIRECTION_NEXT ];
pBlock->m_Neighbours[ MEM_DIRECTION_NEXT ] = pNextBlock;
pNextBlock = pNextBlock->Neighbours[ MEM_DIRECTION_NEXT ];
pBlock->Neighbours[ MEM_DIRECTION_NEXT ] = pNextBlock;
if ( pNextBlock != NULL )
{
pNextBlock->m_Neighbours[ MEM_DIRECTION_PREV ] = pBlock;
pNextBlock->Neighbours[ MEM_DIRECTION_PREV ] = pBlock;
} else
{
mem_Heap.m_pLastBlock = pBlock;
mem_Heap.pLastBlock = pBlock;
}
}
if ( pPrevBlock != NULL
&& pPrevBlock->m_MagicNum == MEM_MAGIC_NUM_OF_FREE_BLOCK )
&& pPrevBlock->MagicNum == MEM_MAGIC_NUM_OF_FREE_BLOCK )
{
/* merge with the previous block */
mem_HeapStatFreeBlockMerge();
pPrevBlock->m_Neighbours[ MEM_DIRECTION_NEXT ] = pNextBlock;
pPrevBlock->Neighbours[ MEM_DIRECTION_NEXT ] = pNextBlock;
if ( pNextBlock != NULL )
{
pNextBlock->m_Neighbours[ MEM_DIRECTION_PREV ] = pBlock->m_Neighbours[ MEM_DIRECTION_PREV ];
pNextBlock->Neighbours[ MEM_DIRECTION_PREV ] = pBlock->Neighbours[ MEM_DIRECTION_PREV ];
} else
{
mem_Heap.m_pLastBlock = pPrevBlock;
mem_Heap.pLastBlock = pPrevBlock;
}
}
@ -423,21 +423,21 @@ mem_HeapPrint( bool dumpBlockData) /**< print block with data (true)
mem_CheckHeap();
__printf("Heap: start=%p size=%lu, first block->%p, last block->%p\n",
mem_Heap.m_HeapStart,
mem_Heap.m_HeapSize,
(void*) mem_Heap.m_pFirstBlock,
(void*) mem_Heap.m_pLastBlock);
mem_Heap.HeapStart,
mem_Heap.HeapSize,
(void*) mem_Heap.pFirstBlock,
(void*) mem_Heap.pLastBlock);
for ( mem_BlockHeader_t *pBlock = mem_Heap.m_pFirstBlock;
for ( mem_BlockHeader_t *pBlock = mem_Heap.pFirstBlock;
pBlock != NULL;
pBlock = pBlock->m_Neighbours[ MEM_DIRECTION_NEXT ] )
pBlock = pBlock->Neighbours[ MEM_DIRECTION_NEXT ] )
{
__printf("Block (%p): magic num=0x%08x, size in chunks=%lu, previous block->%p next block->%p\n",
(void*) pBlock,
pBlock->m_MagicNum,
pBlock->MagicNum,
mem_get_block_chunks_count( pBlock),
(void*) pBlock->m_Neighbours[ MEM_DIRECTION_PREV ],
(void*) pBlock->m_Neighbours[ MEM_DIRECTION_NEXT ]);
(void*) pBlock->Neighbours[ MEM_DIRECTION_PREV ],
(void*) pBlock->Neighbours[ MEM_DIRECTION_NEXT ]);
if ( dumpBlockData )
{
@ -486,20 +486,20 @@ static void
mem_CheckHeap( void)
{
#ifndef JERRY_NDEBUG
JERRY_ASSERT( (uint8_t*) mem_Heap.m_pFirstBlock == mem_Heap.m_HeapStart );
JERRY_ASSERT( mem_Heap.m_HeapSize % MEM_HEAP_CHUNK_SIZE == 0 );
JERRY_ASSERT( (uint8_t*) mem_Heap.pFirstBlock == mem_Heap.HeapStart );
JERRY_ASSERT( mem_Heap.HeapSize % MEM_HEAP_CHUNK_SIZE == 0 );
bool isLastBlockWasMet = false;
for ( mem_BlockHeader_t *pBlock = mem_Heap.m_pFirstBlock;
for ( mem_BlockHeader_t *pBlock = mem_Heap.pFirstBlock;
pBlock != NULL;
pBlock = pBlock->m_Neighbours[ MEM_DIRECTION_NEXT ] )
pBlock = pBlock->Neighbours[ MEM_DIRECTION_NEXT ] )
{
JERRY_ASSERT( pBlock != NULL );
JERRY_ASSERT( pBlock->m_MagicNum == MEM_MAGIC_NUM_OF_FREE_BLOCK
|| pBlock->m_MagicNum == MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK );
JERRY_ASSERT( pBlock->MagicNum == MEM_MAGIC_NUM_OF_FREE_BLOCK
|| pBlock->MagicNum == MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK );
mem_BlockHeader_t *pNextBlock = pBlock->m_Neighbours[ MEM_DIRECTION_NEXT ];
if ( pBlock == mem_Heap.m_pLastBlock )
mem_BlockHeader_t *pNextBlock = pBlock->Neighbours[ MEM_DIRECTION_NEXT ];
if ( pBlock == mem_Heap.pLastBlock )
{
isLastBlockWasMet = true;
@ -532,7 +532,7 @@ mem_HeapStatInit()
{
__memset( &mem_HeapStats, 0, sizeof (mem_HeapStats));
mem_HeapStats.size = mem_Heap.m_HeapSize;
mem_HeapStats.size = mem_Heap.HeapSize;
mem_HeapStats.blocks = 1;
} /* mem_InitStats */
@ -542,7 +542,7 @@ mem_HeapStatInit()
static void
mem_HeapStatAllocBlock( mem_BlockHeader_t *block_header_p) /**< allocated block */
{
JERRY_ASSERT( block_header_p->m_MagicNum == MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK );
JERRY_ASSERT( block_header_p->MagicNum == MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK );
const size_t chunks = mem_get_block_chunks_count( block_header_p);
const size_t bytes = block_header_p->allocated_bytes;
@ -584,7 +584,7 @@ mem_HeapStatAllocBlock( mem_BlockHeader_t *block_header_p) /**< allocated block
static void
mem_HeapStatFreeBlock( mem_BlockHeader_t *block_header_p) /**< block to be freed */
{
JERRY_ASSERT( block_header_p->m_MagicNum == MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK );
JERRY_ASSERT( block_header_p->MagicNum == MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK );
const size_t chunks = mem_get_block_chunks_count( block_header_p);
const size_t bytes = block_header_p->allocated_bytes;

View File

@ -62,9 +62,9 @@ mem_PoolInit(mem_PoolState_t *pPool, /**< pool */
JERRY_ASSERT( (uintptr_t) poolStart % MEM_ALIGNMENT == 0);
JERRY_ASSERT( chunkSize % MEM_ALIGNMENT == 0 );
pPool->m_pPoolStart = poolStart;
pPool->m_PoolSize = poolSize;
pPool->m_ChunkSize = chunkSize;
pPool->pPoolStart = poolStart;
pPool->PoolSize = poolSize;
pPool->ChunkSize = chunkSize;
const size_t bitsInByte = JERRY_BITSINBYTE;
const size_t bitmapAreaSizeAlignment = JERRY_MAX( sizeof (mword_t), MEM_ALIGNMENT);
@ -100,21 +100,21 @@ mem_PoolInit(mem_PoolState_t *pPool, /**< pool */
JERRY_ASSERT( chunksAreaSize >= chunksNumber * chunkSize );
JERRY_ASSERT( bitmapAreaSize + chunksAreaSize <= poolSize );
pPool->m_pBitmap = (mword_t*) poolStart;
pPool->m_pChunks = poolStart + bitmapAreaSize;
pPool->pBitmap = (mword_t*) poolStart;
pPool->pChunks = poolStart + bitmapAreaSize;
JERRY_ASSERT( (uintptr_t) pPool->m_pChunks % MEM_ALIGNMENT == 0 );
JERRY_ASSERT( (uintptr_t) pPool->pChunks % MEM_ALIGNMENT == 0 );
pPool->m_ChunksNumber = chunksNumber;
pPool->ChunksNumber = chunksNumber;
/*
* All chunks are free right after initialization
*/
pPool->m_FreeChunksNumber = chunksNumber;
__memset( pPool->m_pBitmap, 0, bitmapAreaSize);
pPool->FreeChunksNumber = chunksNumber;
__memset( pPool->pBitmap, 0, bitmapAreaSize);
#ifndef JERRY_NDEBUG
__memset( pPool->m_pChunks, mem_PoolFreeChunkMagicNum, chunksAreaSize);
__memset( pPool->pChunks, mem_PoolFreeChunkMagicNum, chunksAreaSize);
#endif /* JERRY_NDEBUG */
mem_CheckPool( pPool);
@ -128,7 +128,7 @@ mem_PoolAllocChunk(mem_PoolState_t *pPool) /**< pool */
{
mem_CheckPool( pPool);
if ( pPool->m_FreeChunksNumber == 0 )
if ( pPool->FreeChunksNumber == 0 )
{
return NULL;
}
@ -136,9 +136,9 @@ mem_PoolAllocChunk(mem_PoolState_t *pPool) /**< pool */
size_t chunkIndex = 0;
size_t bitmapBlockIndex = 0;
while ( chunkIndex < pPool->m_ChunksNumber )
while ( chunkIndex < pPool->ChunksNumber )
{
if ( ~pPool->m_pBitmap[ bitmapBlockIndex ] != 0 )
if ( ~pPool->pBitmap[ bitmapBlockIndex ] != 0 )
{
break;
} else
@ -148,7 +148,7 @@ mem_PoolAllocChunk(mem_PoolState_t *pPool) /**< pool */
}
}
if ( chunkIndex >= pPool->m_ChunksNumber )
if ( chunkIndex >= pPool->ChunksNumber )
{
/* no free chunks */
return NULL;
@ -158,16 +158,16 @@ mem_PoolAllocChunk(mem_PoolState_t *pPool) /**< pool */
mword_t bit = 1;
for ( size_t bitIndex = 0;
bitIndex < mem_BitmapBitsInBlock && chunkIndex < pPool->m_ChunksNumber;
bitIndex < mem_BitmapBitsInBlock && chunkIndex < pPool->ChunksNumber;
bitIndex++, chunkIndex++, bit <<= 1 )
{
if ( ~pPool->m_pBitmap[ bitmapBlockIndex ] & bit )
if ( ~pPool->pBitmap[ bitmapBlockIndex ] & bit )
{
/* found free chunk */
pPool->m_pBitmap[ bitmapBlockIndex ] |= bit;
pPool->pBitmap[ bitmapBlockIndex ] |= bit;
uint8_t *pChunk = &pPool->m_pChunks[ chunkIndex * pPool->m_ChunkSize ];
pPool->m_FreeChunksNumber--;
uint8_t *pChunk = &pPool->pChunks[ chunkIndex * pPool->ChunkSize ];
pPool->FreeChunksNumber--;
mem_CheckPool( pPool);
@ -186,24 +186,24 @@ void
mem_PoolFreeChunk(mem_PoolState_t *pPool, /**< pool */
uint8_t *pChunk) /**< chunk pointer */
{
JERRY_ASSERT( pPool->m_FreeChunksNumber < pPool->m_ChunksNumber );
JERRY_ASSERT( pChunk >= pPool->m_pChunks && pChunk <= pPool->m_pChunks + pPool->m_ChunksNumber * pPool->m_ChunkSize );
JERRY_ASSERT( ( (uintptr_t) pChunk - (uintptr_t) pPool->m_pChunks ) % pPool->m_ChunkSize == 0 );
JERRY_ASSERT( pPool->FreeChunksNumber < pPool->ChunksNumber );
JERRY_ASSERT( pChunk >= pPool->pChunks && pChunk <= pPool->pChunks + pPool->ChunksNumber * pPool->ChunkSize );
JERRY_ASSERT( ( (uintptr_t) pChunk - (uintptr_t) pPool->pChunks ) % pPool->ChunkSize == 0 );
mem_CheckPool( pPool);
size_t chunkIndex = (size_t) (pChunk - pPool->m_pChunks) / pPool->m_ChunkSize;
size_t chunkIndex = (size_t) (pChunk - pPool->pChunks) / pPool->ChunkSize;
size_t bitmapBlockIndex = chunkIndex / mem_BitmapBitsInBlock;
size_t bitmapBitInBlock = chunkIndex % mem_BitmapBitsInBlock;
mword_t bitMask = ( 1lu << bitmapBitInBlock );
#ifndef JERRY_NDEBUG
__memset( (uint8_t*) pChunk, mem_PoolFreeChunkMagicNum, pPool->m_ChunkSize);
__memset( (uint8_t*) pChunk, mem_PoolFreeChunkMagicNum, pPool->ChunkSize);
#endif /* JERRY_NDEBUG */
JERRY_ASSERT( pPool->m_pBitmap[ bitmapBlockIndex ] & bitMask );
JERRY_ASSERT( pPool->pBitmap[ bitmapBlockIndex ] & bitMask );
pPool->m_pBitmap[ bitmapBlockIndex ] &= ~bitMask;
pPool->m_FreeChunksNumber++;
pPool->pBitmap[ bitmapBlockIndex ] &= ~bitMask;
pPool->FreeChunksNumber++;
mem_CheckPool( pPool);
} /* mem_PoolFreeChunk */
@ -215,39 +215,39 @@ static void
mem_CheckPool( mem_PoolState_t __unused *pPool) /**< pool (unused #ifdef JERRY_NDEBUG) */
{
#ifndef JERRY_NDEBUG
JERRY_ASSERT( pPool->m_ChunksNumber != 0 );
JERRY_ASSERT( pPool->m_FreeChunksNumber <= pPool->m_ChunksNumber );
JERRY_ASSERT( (uint8_t*) pPool->m_pBitmap == pPool->m_pPoolStart );
JERRY_ASSERT( (uint8_t*) pPool->m_pChunks > pPool->m_pPoolStart );
JERRY_ASSERT( pPool->ChunksNumber != 0 );
JERRY_ASSERT( pPool->FreeChunksNumber <= pPool->ChunksNumber );
JERRY_ASSERT( (uint8_t*) pPool->pBitmap == pPool->pPoolStart );
JERRY_ASSERT( (uint8_t*) pPool->pChunks > pPool->pPoolStart );
uint8_t freeChunkTemplate[ pPool->m_ChunkSize ];
uint8_t freeChunkTemplate[ pPool->ChunkSize ];
__memset( &freeChunkTemplate, mem_PoolFreeChunkMagicNum, sizeof (freeChunkTemplate));
size_t metFreeChunksNumber = 0;
for ( size_t chunkIndex = 0, bitmapBlockIndex = 0;
chunkIndex < pPool->m_ChunksNumber;
chunkIndex < pPool->ChunksNumber;
bitmapBlockIndex++ )
{
JERRY_ASSERT( (uint8_t*) & pPool->m_pBitmap[ bitmapBlockIndex ] < pPool->m_pChunks );
JERRY_ASSERT( (uint8_t*) & pPool->pBitmap[ bitmapBlockIndex ] < pPool->pChunks );
mword_t bitmapBlock = pPool->m_pBitmap[ bitmapBlockIndex ];
mword_t bitmapBlock = pPool->pBitmap[ bitmapBlockIndex ];
mword_t bitMask = 1;
for ( size_t bitmapBitInBlock = 0;
chunkIndex < pPool->m_ChunksNumber && bitmapBitInBlock < mem_BitmapBitsInBlock;
chunkIndex < pPool->ChunksNumber && bitmapBitInBlock < mem_BitmapBitsInBlock;
bitmapBitInBlock++, bitMask <<= 1, chunkIndex++ )
{
if ( ~bitmapBlock & bitMask )
{
metFreeChunksNumber++;
JERRY_ASSERT( __memcmp( &pPool->m_pChunks[ chunkIndex * pPool->m_ChunkSize ], freeChunkTemplate, pPool->m_ChunkSize) == 0 );
JERRY_ASSERT( __memcmp( &pPool->pChunks[ chunkIndex * pPool->ChunkSize ], freeChunkTemplate, pPool->ChunkSize) == 0 );
}
}
}
JERRY_ASSERT( metFreeChunksNumber == pPool->m_FreeChunksNumber );
JERRY_ASSERT( metFreeChunksNumber == pPool->FreeChunksNumber );
#endif /* !JERRY_NDEBUG */
} /* mem_CheckPool */

View File

@ -31,18 +31,18 @@
* Compact the struct
*/
typedef struct mem_PoolState_t {
uint8_t *m_pPoolStart; /**< first address of pool space */
size_t m_PoolSize; /**< pool space size */
uint8_t *pPoolStart; /**< first address of pool space */
size_t PoolSize; /**< pool space size */
size_t m_ChunkSize; /**< size of one chunk */
size_t ChunkSize; /**< size of one chunk */
mword_t *m_pBitmap; /**< bitmap - pool chunks' state */
uint8_t *m_pChunks; /**< chunks with data */
mword_t *pBitmap; /**< bitmap - pool chunks' state */
uint8_t *pChunks; /**< chunks with data */
size_t m_ChunksNumber; /**< number of chunks */
size_t m_FreeChunksNumber; /**< number of free chunks */
size_t ChunksNumber; /**< number of chunks */
size_t FreeChunksNumber; /**< number of free chunks */
struct mem_PoolState_t *m_pNextPool; /**< pointer to the next pool with same chunk size */
struct mem_PoolState_t *pNextPool; /**< pointer to the next pool with same chunk size */
} mem_PoolState_t;
extern void mem_PoolInit(mem_PoolState_t *pPool, size_t chunkSize, uint8_t *poolStart, size_t poolSize);

View File

@ -171,10 +171,10 @@ mem_PoolsAlloc( mem_PoolChunkType_t chunkType) /**< chunk type */
poolSpace,
poolSpaceSize);
poolState->m_pNextPool = mem_Pools[ chunkType ];
poolState->pNextPool = mem_Pools[ chunkType ];
mem_Pools[ chunkType ] = poolState;
mem_FreeChunksNumber[ chunkType ] += poolState->m_FreeChunksNumber;
mem_FreeChunksNumber[ chunkType ] += poolState->FreeChunksNumber;
mem_PoolsStatAllocPool( chunkType);
}
@ -186,9 +186,9 @@ mem_PoolsAlloc( mem_PoolChunkType_t chunkType) /**< chunk type */
*/
mem_PoolState_t *poolState = mem_Pools[ chunkType ];
while ( poolState->m_FreeChunksNumber == 0 )
while ( poolState->FreeChunksNumber == 0 )
{
poolState = poolState->m_pNextPool;
poolState = poolState->pNextPool;
JERRY_ASSERT( poolState != NULL );
}
@ -215,11 +215,11 @@ mem_PoolsFree( mem_PoolChunkType_t chunkType, /**< the chunk type */
/**
* Search for the pool containing specified chunk.
*/
while ( !( pChunk >= poolState->m_pChunks
&& pChunk <= poolState->m_pPoolStart + poolState->m_PoolSize ) )
while ( !( pChunk >= poolState->pChunks
&& pChunk <= poolState->pPoolStart + poolState->PoolSize ) )
{
prevPoolState = poolState;
poolState = poolState->m_pNextPool;
poolState = poolState->pNextPool;
JERRY_ASSERT( poolState != NULL );
}
@ -235,19 +235,19 @@ mem_PoolsFree( mem_PoolChunkType_t chunkType, /**< the chunk type */
/**
* If all chunks of the pool are free, free the pool itself.
*/
if ( poolState->m_FreeChunksNumber == poolState->m_ChunksNumber )
if ( poolState->FreeChunksNumber == poolState->ChunksNumber )
{
if ( prevPoolState != NULL )
{
prevPoolState->m_pNextPool = poolState->m_pNextPool;
prevPoolState->pNextPool = poolState->pNextPool;
} else
{
mem_Pools[ chunkType ] = poolState->m_pNextPool;
mem_Pools[ chunkType ] = poolState->pNextPool;
}
mem_FreeChunksNumber[ chunkType ] -= poolState->m_ChunksNumber;
mem_FreeChunksNumber[ chunkType ] -= poolState->ChunksNumber;
mem_HeapFreeBlock( poolState->m_pPoolStart);
mem_HeapFreeBlock( poolState->pPoolStart);
mem_PoolFreeChunk( &mem_PoolForPoolHeaders, (uint8_t*) poolState);

View File

@ -166,9 +166,9 @@ do_strict_eval_arguments_check( ecma_Reference_t ref) /**< ECMA-reference */
return ( ref.is_strict
&& ( __strcmp( (char*)ref.referenced_name_p, "eval") == 0
|| __strcmp( (char*)ref.referenced_name_p, "arguments") == 0 )
&& ( ref.base.m_ValueType == ECMA_TYPE_OBJECT )
&& ( ecma_GetPointer( ref.base.m_Value) != NULL )
&& ( ( (ecma_Object_t*) ecma_GetPointer( ref.base.m_Value) )->m_IsLexicalEnvironment ) );
&& ( ref.base.ValueType == ECMA_TYPE_OBJECT )
&& ( ecma_GetPointer( ref.base.Value) != NULL )
&& ( ( (ecma_Object_t*) ecma_GetPointer( ref.base.Value) )->IsLexicalEnvironment ) );
} /* do_strict_eval_arguments_check */
/**
@ -279,8 +279,8 @@ do_number_arithmetic(struct __int_data *int_data, /**< interpreter context */
TRY_CATCH(num_right_value, ecma_op_to_number( right_value), ret_value);
ecma_Number_t *left_p, *right_p, *res_p;
left_p = (ecma_Number_t*)ecma_GetPointer( num_left_value.value.m_Value);
right_p = (ecma_Number_t*)ecma_GetPointer( num_right_value.value.m_Value);
left_p = (ecma_Number_t*)ecma_GetPointer( num_left_value.value.Value);
right_p = (ecma_Number_t*)ecma_GetPointer( num_right_value.value.Value);
res_p = ecma_AllocNumber();
@ -562,8 +562,8 @@ opfunc_addition(OPCODE opdata, /**< operation data */
TRY_CATCH(prim_left_value, ecma_op_to_primitive( left_value.value), ret_value);
TRY_CATCH(prim_right_value, ecma_op_to_primitive( right_value.value), ret_value);
if ( prim_left_value.value.m_ValueType == ECMA_TYPE_STRING
|| prim_right_value.value.m_ValueType == ECMA_TYPE_STRING )
if ( prim_left_value.value.ValueType == ECMA_TYPE_STRING
|| prim_right_value.value.ValueType == ECMA_TYPE_STRING )
{
JERRY_UNIMPLEMENTED();
}

View File

@ -45,11 +45,11 @@ static void
ecma_GCQueue( ecma_Object_t *pObject) /**< object */
{
JERRY_ASSERT( pObject != NULL );
JERRY_ASSERT( pObject->m_GCInfo.m_IsObjectValid );
JERRY_ASSERT( pObject->m_GCInfo.u.m_Refs == 0 );
JERRY_ASSERT( pObject->GCInfo.IsObjectValid );
JERRY_ASSERT( pObject->GCInfo.u.Refs == 0 );
pObject->m_GCInfo.m_IsObjectValid = false;
ecma_SetPointer( pObject->m_GCInfo.u.m_NextQueuedForGC, ecma_GC_Queue);
pObject->GCInfo.IsObjectValid = false;
ecma_SetPointer( pObject->GCInfo.u.NextQueuedForGC, ecma_GC_Queue);
ecma_GC_Queue = pObject;
} /* ecma_QueueGC */
@ -60,14 +60,14 @@ ecma_GCQueue( ecma_Object_t *pObject) /**< object */
void
ecma_RefObject(ecma_Object_t *pObject) /**< object */
{
JERRY_ASSERT(pObject->m_GCInfo.m_IsObjectValid);
JERRY_ASSERT(pObject->GCInfo.IsObjectValid);
pObject->m_GCInfo.u.m_Refs++;
pObject->GCInfo.u.Refs++;
/**
* Check that value was not overflowed
*/
JERRY_ASSERT(pObject->m_GCInfo.u.m_Refs > 0);
JERRY_ASSERT(pObject->GCInfo.u.Refs > 0);
} /* ecma_RefObject */
/**
@ -77,12 +77,12 @@ void
ecma_DerefObject(ecma_Object_t *pObject) /**< object */
{
JERRY_ASSERT(pObject != NULL);
JERRY_ASSERT(pObject->m_GCInfo.m_IsObjectValid);
JERRY_ASSERT(pObject->m_GCInfo.u.m_Refs > 0);
JERRY_ASSERT(pObject->GCInfo.IsObjectValid);
JERRY_ASSERT(pObject->GCInfo.u.Refs > 0);
pObject->m_GCInfo.u.m_Refs--;
pObject->GCInfo.u.Refs--;
if ( pObject->m_GCInfo.u.m_Refs == 0 )
if ( pObject->GCInfo.u.Refs == 0 )
{
ecma_GCQueue( pObject);
}
@ -106,22 +106,22 @@ ecma_GCRun( void)
while ( ecma_GC_Queue != NULL )
{
ecma_Object_t *pObject = ecma_GC_Queue;
ecma_GC_Queue = ecma_GetPointer( pObject->m_GCInfo.u.m_NextQueuedForGC);
ecma_GC_Queue = ecma_GetPointer( pObject->GCInfo.u.NextQueuedForGC);
JERRY_ASSERT( !pObject->m_GCInfo.m_IsObjectValid );
JERRY_ASSERT( !pObject->GCInfo.IsObjectValid );
for ( ecma_Property_t *property = ecma_GetPointer( pObject->m_pProperties), *pNextProperty;
for ( ecma_Property_t *property = ecma_GetPointer( pObject->pProperties), *pNextProperty;
property != NULL;
property = pNextProperty )
{
pNextProperty = ecma_GetPointer( property->m_pNextProperty);
pNextProperty = ecma_GetPointer( property->pNextProperty);
ecma_FreeProperty( property);
}
if ( pObject->m_IsLexicalEnvironment )
if ( pObject->IsLexicalEnvironment )
{
ecma_Object_t *pOuterLexicalEnvironment = ecma_GetPointer( pObject->u.m_LexicalEnvironment.m_pOuterReference);
ecma_Object_t *pOuterLexicalEnvironment = ecma_GetPointer( pObject->u.LexicalEnvironment.pOuterReference);
if ( pOuterLexicalEnvironment != NULL )
{
@ -129,7 +129,7 @@ ecma_GCRun( void)
}
} else
{
ecma_Object_t *pPrototypeObject = ecma_GetPointer( pObject->u.m_Object.m_pPrototypeObject);
ecma_Object_t *pPrototypeObject = ecma_GetPointer( pObject->u.Object.pPrototypeObject);
if ( pPrototypeObject != NULL )
{

View File

@ -103,12 +103,12 @@ typedef enum {
*/
typedef struct {
/** Value type (ecma_Type_t) */
unsigned int m_ValueType : 2;
unsigned int ValueType : 2;
/**
* Simple value (ecma_SimpleValue_t) or compressed pointer to value (depending on m_ValueType)
* Simple value (ecma_SimpleValue_t) or compressed pointer to value (depending on ValueType)
*/
unsigned int m_Value : ECMA_POINTER_FIELD_WIDTH;
unsigned int Value : ECMA_POINTER_FIELD_WIDTH;
} __packed ecma_Value_t;
/**
@ -187,58 +187,58 @@ typedef enum
*/
typedef struct ecma_Property_t {
/** Property's type (ecma_PropertyType_t) */
unsigned int m_Type : 2;
unsigned int Type : 2;
/** Compressed pointer to next property */
unsigned int m_pNextProperty : ECMA_POINTER_FIELD_WIDTH;
unsigned int pNextProperty : ECMA_POINTER_FIELD_WIDTH;
/** Property's details (depending on m_Type) */
/** Property's details (depending on Type) */
union {
/** Description of named data property */
struct __packed ecma_NamedDataProperty_t {
/** Compressed pointer to property's name (pointer to String) */
unsigned int m_pName : ECMA_POINTER_FIELD_WIDTH;
unsigned int pName : ECMA_POINTER_FIELD_WIDTH;
/** Attribute 'Writable' (ecma_PropertyWritableValue_t) */
unsigned int m_Writable : 1;
unsigned int Writable : 1;
/** Attribute 'Enumerable' (ecma_PropertyEnumerableValue_t) */
unsigned int m_Enumerable : 1;
unsigned int Enumerable : 1;
/** Attribute 'Configurable' (ecma_PropertyConfigurableValue_t) */
unsigned int m_Configurable : 1;
unsigned int Configurable : 1;
/** Value */
ecma_Value_t m_Value;
} m_NamedDataProperty;
ecma_Value_t Value;
} NamedDataProperty;
/** Description of named accessor property */
struct __packed ecma_NamedAccessorProperty_t {
/** Compressed pointer to property's name (pointer to String) */
unsigned int m_pName : ECMA_POINTER_FIELD_WIDTH;
unsigned int pName : ECMA_POINTER_FIELD_WIDTH;
/** Attribute 'Enumerable' (ecma_PropertyEnumerableValue_t) */
unsigned int m_Enumerable : 1;
unsigned int Enumerable : 1;
/** Attribute 'Configurable' (ecma_PropertyConfigurableValue_t) */
unsigned int m_Configurable : 1;
unsigned int Configurable : 1;
/** Compressed pointer to property's getter */
unsigned int m_pGet : ECMA_POINTER_FIELD_WIDTH;
unsigned int pGet : ECMA_POINTER_FIELD_WIDTH;
/** Compressed pointer to property's setter */
unsigned int m_pSet : ECMA_POINTER_FIELD_WIDTH;
} m_NamedAccessorProperty;
unsigned int pSet : ECMA_POINTER_FIELD_WIDTH;
} NamedAccessorProperty;
/** Description of internal property */
struct __packed ecma_InternalProperty_t {
/** Internal property's type */
unsigned int m_InternalPropertyType : 4;
unsigned int InternalPropertyType : 4;
/** Value (may be a compressed pointer) */
unsigned int m_Value : ECMA_POINTER_FIELD_WIDTH;
} m_InternalProperty;
unsigned int Value : ECMA_POINTER_FIELD_WIDTH;
} InternalProperty;
} u;
} ecma_Property_t;
@ -250,22 +250,22 @@ typedef struct {
* Flag that indicates if the object is valid for normal usage.
* If the flag is zero, then the object is not valid and is queued for GC.
*/
unsigned int m_IsObjectValid : 1;
unsigned int IsObjectValid : 1;
/** Details (depending on m_IsObjectValid) */
/** Details (depending on IsObjectValid) */
union {
/**
* Number of refs to the object (if m_IsObjectValid).
* Number of refs to the object (if IsObjectValid).
*
* Note: It is not a pointer. Maximum value of reference counter
* willn't be bigger than overall count of variables/objects/properties,
* which is limited by size of address space allocated for JerryScript
* (and, consequently, by ECMA_POINTER_FIELD_WIDTH).
*/
unsigned int m_Refs : ECMA_POINTER_FIELD_WIDTH;
unsigned int Refs : ECMA_POINTER_FIELD_WIDTH;
/** Compressed pointer to next object in the list of objects, queued for GC (if !m_IsObjectValid) */
unsigned int m_NextQueuedForGC : ECMA_POINTER_FIELD_WIDTH;
/** Compressed pointer to next object in the list of objects, queued for GC (if !IsObjectValid) */
unsigned int NextQueuedForGC : ECMA_POINTER_FIELD_WIDTH;
} __packed u;
} ecma_GCInfo_t;
@ -279,49 +279,49 @@ typedef enum {
/**
* Description of ECMA-object or lexical environment
* (depending on m_IsLexicalEnvironment).
* (depending on IsLexicalEnvironment).
*/
typedef struct ecma_Object_t {
/** Compressed pointer to property list */
unsigned int m_pProperties : ECMA_POINTER_FIELD_WIDTH;
unsigned int pProperties : ECMA_POINTER_FIELD_WIDTH;
/** Flag indicating whether it is a general object (false)
or a lexical environment (true) */
unsigned int m_IsLexicalEnvironment : 1;
unsigned int IsLexicalEnvironment : 1;
/**
* Attributes of either general object or lexical environment
* (depending on m_IsLexicalEnvironment)
* (depending on IsLexicalEnvironment)
*/
union {
/**
* A general object's attributes (if !m_IsLexicalEnvironment)
* A general object's attributes (if !IsLexicalEnvironment)
*/
struct {
/** Attribute 'Extensible' */
unsigned int m_Extensible : 1;
unsigned int Extensible : 1;
/** Compressed pointer to prototype object (ecma_Object_t) */
unsigned int m_pPrototypeObject : ECMA_POINTER_FIELD_WIDTH;
} __packed m_Object;
unsigned int pPrototypeObject : ECMA_POINTER_FIELD_WIDTH;
} __packed Object;
/**
* A lexical environment's attribute (if m_IsLexicalEnvironment)
* A lexical environment's attribute (if IsLexicalEnvironment)
*/
struct {
/**
* Type of lexical environment (ecma_LexicalEnvironmentType_t).
*/
unsigned int m_Type : 1;
unsigned int Type : 1;
/** Compressed pointer to outer lexical environment */
unsigned int m_pOuterReference : ECMA_POINTER_FIELD_WIDTH;
} __packed m_LexicalEnvironment;
unsigned int pOuterReference : ECMA_POINTER_FIELD_WIDTH;
} __packed LexicalEnvironment;
} __packed u;
/** GC's information */
ecma_GCInfo_t m_GCInfo;
ecma_GCInfo_t GCInfo;
} ecma_Object_t;
/**
@ -344,10 +344,10 @@ typedef uint16_t ecma_Length_t;
*/
typedef struct {
/** Compressed pointer to next chunk */
uint16_t m_pNextChunk;
uint16_t pNextChunk;
/** Number of elements in the Array */
ecma_Length_t m_UnitNumber;
ecma_Length_t UnitNumber;
} ecma_ArrayHeader_t;
/**
@ -360,10 +360,10 @@ typedef struct {
*/
typedef struct {
/** Array's header */
ecma_ArrayHeader_t m_Header;
ecma_ArrayHeader_t Header;
/** Elements */
uint8_t m_Data[ ECMA_ARRAY_CHUNK_SIZE_IN_BYTES - sizeof (ecma_ArrayHeader_t) ];
uint8_t Data[ ECMA_ARRAY_CHUNK_SIZE_IN_BYTES - sizeof (ecma_ArrayHeader_t) ];
} ecma_ArrayFirstChunk_t;
/**
@ -371,10 +371,10 @@ typedef struct {
*/
typedef struct {
/** Compressed pointer to next chunk */
uint16_t m_pNextChunk;
uint16_t pNextChunk;
/** Characters */
uint8_t m_Data[ ECMA_ARRAY_CHUNK_SIZE_IN_BYTES - sizeof (uint16_t) ];
uint8_t Data[ ECMA_ARRAY_CHUNK_SIZE_IN_BYTES - sizeof (uint16_t) ];
} ecma_ArrayNonFirstChunk_t;
/**

View File

@ -35,7 +35,7 @@
bool
ecma_IsValueUndefined( ecma_Value_t value) /**< ecma-value */
{
return ( value.m_ValueType == ECMA_TYPE_SIMPLE && value.m_Value == ECMA_SIMPLE_VALUE_UNDEFINED );
return ( value.ValueType == ECMA_TYPE_SIMPLE && value.Value == ECMA_SIMPLE_VALUE_UNDEFINED );
} /* ecma_IsValueUndefined */
/**
@ -47,7 +47,7 @@ ecma_IsValueUndefined( ecma_Value_t value) /**< ecma-value */
bool
ecma_IsValueNull( ecma_Value_t value) /**< ecma-value */
{
return ( value.m_ValueType == ECMA_TYPE_SIMPLE && value.m_Value == ECMA_SIMPLE_VALUE_NULL );
return ( value.ValueType == ECMA_TYPE_SIMPLE && value.Value == ECMA_SIMPLE_VALUE_NULL );
} /* ecma_IsValueNull */
/**
@ -59,8 +59,8 @@ ecma_IsValueNull( ecma_Value_t value) /**< ecma-value */
bool
ecma_IsValueBoolean( ecma_Value_t value) /**< ecma-value */
{
return ( ( value.m_ValueType == ECMA_TYPE_SIMPLE && value.m_Value == ECMA_SIMPLE_VALUE_FALSE )
|| ( value.m_ValueType == ECMA_TYPE_SIMPLE && value.m_Value == ECMA_SIMPLE_VALUE_TRUE ) );
return ( ( value.ValueType == ECMA_TYPE_SIMPLE && value.Value == ECMA_SIMPLE_VALUE_FALSE )
|| ( value.ValueType == ECMA_TYPE_SIMPLE && value.Value == ECMA_SIMPLE_VALUE_TRUE ) );
} /* ecma_IsValueBoolean */
/**
@ -77,7 +77,7 @@ ecma_IsValueTrue( ecma_Value_t value) /**< ecma-value */
{
JERRY_ASSERT( ecma_IsValueBoolean( value) );
return ( value.m_ValueType == ECMA_TYPE_SIMPLE && value.m_Value == ECMA_SIMPLE_VALUE_TRUE );
return ( value.ValueType == ECMA_TYPE_SIMPLE && value.Value == ECMA_SIMPLE_VALUE_TRUE );
} /* ecma_IsValueTrue */
/**
@ -86,7 +86,7 @@ ecma_IsValueTrue( ecma_Value_t value) /**< ecma-value */
ecma_Value_t
ecma_MakeSimpleValue( ecma_SimpleValue_t value) /**< simple value */
{
return (ecma_Value_t) { .m_ValueType = ECMA_TYPE_SIMPLE, .m_Value = value };
return (ecma_Value_t) { .ValueType = ECMA_TYPE_SIMPLE, .Value = value };
} /* ecma_MakeSimpleValue */
/**
@ -99,8 +99,8 @@ ecma_MakeNumberValue( ecma_Number_t* num_p) /**< number to reference in value */
ecma_Value_t number_value;
number_value.m_ValueType = ECMA_TYPE_NUMBER;
ecma_SetPointer( number_value.m_Value, num_p);
number_value.ValueType = ECMA_TYPE_NUMBER;
ecma_SetPointer( number_value.Value, num_p);
return number_value;
} /* ecma_MakeNumberValue */
@ -115,8 +115,8 @@ ecma_make_string_value( ecma_ArrayFirstChunk_t* ecma_string_p) /**< string to re
ecma_Value_t string_value;
string_value.m_ValueType = ECMA_TYPE_STRING;
ecma_SetPointer( string_value.m_Value, ecma_string_p);
string_value.ValueType = ECMA_TYPE_STRING;
ecma_SetPointer( string_value.Value, ecma_string_p);
return string_value;
} /* ecma_make_string_value */
@ -131,8 +131,8 @@ ecma_MakeObjectValue( ecma_Object_t* object_p) /**< object to reference in value
ecma_Value_t object_value;
object_value.m_ValueType = ECMA_TYPE_OBJECT;
ecma_SetPointer( object_value.m_Value, object_p);
object_value.ValueType = ECMA_TYPE_OBJECT;
ecma_SetPointer( object_value.Value, object_p);
return object_value;
} /* ecma_MakeObjectValue */
@ -163,7 +163,7 @@ ecma_CopyValue( const ecma_Value_t value) /**< ecma-value */
{
ecma_Value_t value_copy;
switch ( (ecma_Type_t)value.m_ValueType )
switch ( (ecma_Type_t)value.ValueType )
{
case ECMA_TYPE_SIMPLE:
{
@ -173,32 +173,32 @@ ecma_CopyValue( const ecma_Value_t value) /**< ecma-value */
}
case ECMA_TYPE_NUMBER:
{
ecma_Number_t *num_p = ecma_GetPointer( value.m_Value);
ecma_Number_t *num_p = ecma_GetPointer( value.Value);
JERRY_ASSERT( num_p != NULL );
ecma_Number_t *number_copy_p = ecma_AllocNumber();
*number_copy_p = *num_p;
value_copy = (ecma_Value_t) { .m_ValueType = ECMA_TYPE_NUMBER };
ecma_SetPointer( value_copy.m_Value, number_copy_p);
value_copy = (ecma_Value_t) { .ValueType = ECMA_TYPE_NUMBER };
ecma_SetPointer( value_copy.Value, number_copy_p);
break;
}
case ECMA_TYPE_STRING:
{
ecma_ArrayFirstChunk_t *string_p = ecma_GetPointer( value.m_Value);
ecma_ArrayFirstChunk_t *string_p = ecma_GetPointer( value.Value);
JERRY_ASSERT( string_p != NULL );
ecma_ArrayFirstChunk_t *string_copy_p = ecma_DuplicateEcmaString( string_p);
value_copy = (ecma_Value_t) { .m_ValueType = ECMA_TYPE_STRING };
ecma_SetPointer( value_copy.m_Value, string_copy_p);
value_copy = (ecma_Value_t) { .ValueType = ECMA_TYPE_STRING };
ecma_SetPointer( value_copy.Value, string_copy_p);
break;
}
case ECMA_TYPE_OBJECT:
{
ecma_Object_t *obj_p = ecma_GetPointer( value.m_Value);
ecma_Object_t *obj_p = ecma_GetPointer( value.Value);
JERRY_ASSERT( obj_p != NULL );
ecma_RefObject( obj_p);
@ -222,7 +222,7 @@ ecma_CopyValue( const ecma_Value_t value) /**< ecma-value */
void
ecma_FreeValue( ecma_Value_t value) /**< value description */
{
switch ( (ecma_Type_t) value.m_ValueType )
switch ( (ecma_Type_t) value.ValueType )
{
case ECMA_TYPE_SIMPLE:
{
@ -232,21 +232,21 @@ ecma_FreeValue( ecma_Value_t value) /**< value description */
case ECMA_TYPE_NUMBER:
{
ecma_Number_t *pNumber = ecma_GetPointer( value.m_Value);
ecma_Number_t *pNumber = ecma_GetPointer( value.Value);
ecma_DeallocNumber( pNumber);
break;
}
case ECMA_TYPE_STRING:
{
ecma_ArrayFirstChunk_t *pString = ecma_GetPointer( value.m_Value);
ecma_ArrayFirstChunk_t *pString = ecma_GetPointer( value.Value);
ecma_FreeArray( pString);
break;
}
case ECMA_TYPE_OBJECT:
{
ecma_DerefObject( ecma_GetPointer( value.m_Value));
ecma_DerefObject( ecma_GetPointer( value.Value));
break;
}
@ -278,7 +278,7 @@ ecma_MakeCompletionValue(ecma_CompletionType_t type, /**< type */
ecma_CompletionValue_t
ecma_MakeThrowValue( ecma_Object_t *exception_p) /**< an object */
{
JERRY_ASSERT( exception_p != NULL && !exception_p->m_IsLexicalEnvironment );
JERRY_ASSERT( exception_p != NULL && !exception_p->IsLexicalEnvironment );
ecma_Value_t exception = ecma_MakeObjectValue( exception_p);
@ -329,7 +329,7 @@ ecma_free_completion_value( ecma_CompletionValue_t completion_value) /**< comple
case ECMA_COMPLETION_TYPE_CONTINUE:
case ECMA_COMPLETION_TYPE_BREAK:
case ECMA_COMPLETION_TYPE_EXIT:
JERRY_ASSERT( completion_value.value.m_ValueType == ECMA_TYPE_SIMPLE );
JERRY_ASSERT( completion_value.value.ValueType == ECMA_TYPE_SIMPLE );
break;
}
} /* ecma_free_completion_value */
@ -370,8 +370,8 @@ ecma_is_completion_value_normal_simple_value(ecma_CompletionValue_t value, /**<
ecma_SimpleValue_t simple_value) /**< simple value to check for equality with */
{
return ( value.type == ECMA_COMPLETION_TYPE_NORMAL
&& value.value.m_ValueType == ECMA_TYPE_SIMPLE
&& value.value.m_Value == simple_value );
&& value.value.ValueType == ECMA_TYPE_SIMPLE
&& value.value.Value == simple_value );
} /* ecma_is_completion_value_normal_simple_value */
/**

View File

@ -83,16 +83,16 @@ ecma_CreateObject( ecma_Object_t *pPrototypeObject, /**< pointer to prototybe of
{
ecma_Object_t *pObject = ecma_AllocObject();
pObject->m_pProperties = ECMA_NULL_POINTER;
pObject->m_IsLexicalEnvironment = false;
pObject->m_GCInfo.m_IsObjectValid = true;
pObject->pProperties = ECMA_NULL_POINTER;
pObject->IsLexicalEnvironment = false;
pObject->GCInfo.IsObjectValid = true;
/* The global object is always referenced
* (at least with the ctx_GlobalObject variable) */
pObject->m_GCInfo.u.m_Refs = 1;
pObject->GCInfo.u.Refs = 1;
pObject->u.m_Object.m_Extensible = isExtensible;
ecma_SetPointer( pObject->u.m_Object.m_pPrototypeObject, pPrototypeObject);
pObject->u.Object.Extensible = isExtensible;
ecma_SetPointer( pObject->u.Object.pPrototypeObject, pPrototypeObject);
return pObject;
} /* ecma_CreateObject */
@ -115,15 +115,15 @@ ecma_CreateLexicalEnvironment(ecma_Object_t *pOuterLexicalEnvironment, /**< oute
{
ecma_Object_t *pNewLexicalEnvironment = ecma_AllocObject();
pNewLexicalEnvironment->m_IsLexicalEnvironment = true;
pNewLexicalEnvironment->u.m_LexicalEnvironment.m_Type = type;
pNewLexicalEnvironment->IsLexicalEnvironment = true;
pNewLexicalEnvironment->u.LexicalEnvironment.Type = type;
pNewLexicalEnvironment->m_pProperties = ECMA_NULL_POINTER;
pNewLexicalEnvironment->pProperties = ECMA_NULL_POINTER;
pNewLexicalEnvironment->m_GCInfo.m_IsObjectValid = true;
pNewLexicalEnvironment->m_GCInfo.u.m_Refs = 1;
pNewLexicalEnvironment->GCInfo.IsObjectValid = true;
pNewLexicalEnvironment->GCInfo.u.Refs = 1;
ecma_SetPointer( pNewLexicalEnvironment->u.m_LexicalEnvironment.m_pOuterReference, pOuterLexicalEnvironment);
ecma_SetPointer( pNewLexicalEnvironment->u.LexicalEnvironment.pOuterReference, pOuterLexicalEnvironment);
return pNewLexicalEnvironment;
} /* ecma_CreateLexicalEnvironment */
@ -140,13 +140,13 @@ ecma_CreateInternalProperty(ecma_Object_t *pObject, /**< the object */
{
ecma_Property_t *pNewProperty = ecma_AllocProperty();
pNewProperty->m_Type = ECMA_PROPERTY_INTERNAL;
pNewProperty->Type = ECMA_PROPERTY_INTERNAL;
ecma_SetPointer( pNewProperty->m_pNextProperty, ecma_GetPointer( pObject->m_pProperties));
ecma_SetPointer( pObject->m_pProperties, pNewProperty);
ecma_SetPointer( pNewProperty->pNextProperty, ecma_GetPointer( pObject->pProperties));
ecma_SetPointer( pObject->pProperties, pNewProperty);
pNewProperty->u.m_InternalProperty.m_InternalPropertyType = propertyId;
pNewProperty->u.m_InternalProperty.m_Value = ECMA_NULL_POINTER;
pNewProperty->u.InternalProperty.InternalPropertyType = propertyId;
pNewProperty->u.InternalProperty.Value = ECMA_NULL_POINTER;
return pNewProperty;
} /* ecma_CreateInternalProperty */
@ -166,13 +166,13 @@ ecma_FindInternalProperty(ecma_Object_t *pObject, /**< object descriptor */
JERRY_ASSERT( propertyId != ECMA_INTERNAL_PROPERTY_PROTOTYPE
&& propertyId != ECMA_INTERNAL_PROPERTY_EXTENSIBLE );
for ( ecma_Property_t *pProperty = ecma_GetPointer( pObject->m_pProperties);
for ( ecma_Property_t *pProperty = ecma_GetPointer( pObject->pProperties);
pProperty != NULL;
pProperty = ecma_GetPointer( pProperty->m_pNextProperty) )
pProperty = ecma_GetPointer( pProperty->pNextProperty) )
{
if ( pProperty->m_Type == ECMA_PROPERTY_INTERNAL )
if ( pProperty->Type == ECMA_PROPERTY_INTERNAL )
{
if ( pProperty->u.m_InternalProperty.m_InternalPropertyType == propertyId )
if ( pProperty->u.InternalProperty.InternalPropertyType == propertyId )
{
return pProperty;
}
@ -218,18 +218,18 @@ ecma_CreateNamedProperty(ecma_Object_t *obj_p, /**< object */
ecma_Property_t *prop = ecma_AllocProperty();
prop->m_Type = ECMA_PROPERTY_NAMEDDATA;
prop->Type = ECMA_PROPERTY_NAMEDDATA;
ecma_SetPointer( prop->u.m_NamedDataProperty.m_pName, ecma_NewEcmaString( name_p));
ecma_SetPointer( prop->u.NamedDataProperty.pName, ecma_NewEcmaString( name_p));
prop->u.m_NamedDataProperty.m_Writable = writable;
prop->u.m_NamedDataProperty.m_Enumerable = enumerable;
prop->u.m_NamedDataProperty.m_Configurable = configurable;
prop->u.NamedDataProperty.Writable = writable;
prop->u.NamedDataProperty.Enumerable = enumerable;
prop->u.NamedDataProperty.Configurable = configurable;
prop->u.m_NamedDataProperty.m_Value = ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_UNDEFINED);
prop->u.NamedDataProperty.Value = ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_UNDEFINED);
ecma_SetPointer( prop->m_pNextProperty, ecma_GetPointer( obj_p->m_pProperties));
ecma_SetPointer( obj_p->m_pProperties, prop);
ecma_SetPointer( prop->pNextProperty, ecma_GetPointer( obj_p->pProperties));
ecma_SetPointer( obj_p->pProperties, prop);
return prop;
} /* ecma_CreateNamedProperty */
@ -247,18 +247,18 @@ ecma_FindNamedProperty(ecma_Object_t *obj_p, /**< object to find property in */
JERRY_ASSERT( obj_p != NULL );
JERRY_ASSERT( name_p != NULL );
for ( ecma_Property_t *property_p = ecma_GetPointer( obj_p->m_pProperties);
for ( ecma_Property_t *property_p = ecma_GetPointer( obj_p->pProperties);
property_p != NULL;
property_p = ecma_GetPointer( property_p->m_pNextProperty) )
property_p = ecma_GetPointer( property_p->pNextProperty) )
{
ecma_ArrayFirstChunk_t *property_name_p;
if ( property_p->m_Type == ECMA_PROPERTY_NAMEDDATA )
if ( property_p->Type == ECMA_PROPERTY_NAMEDDATA )
{
property_name_p = ecma_GetPointer( property_p->u.m_NamedDataProperty.m_pName);
} else if ( property_p->m_Type == ECMA_PROPERTY_NAMEDACCESSOR )
property_name_p = ecma_GetPointer( property_p->u.NamedDataProperty.pName);
} else if ( property_p->Type == ECMA_PROPERTY_NAMEDACCESSOR )
{
property_name_p = ecma_GetPointer( property_p->u.m_NamedAccessorProperty.m_pName);
property_name_p = ecma_GetPointer( property_p->u.NamedAccessorProperty.pName);
} else
{
continue;
@ -316,7 +316,7 @@ ecma_GetNamedDataProperty(ecma_Object_t *obj_p, /**< object to find property in
ecma_Property_t *property_p = ecma_FindNamedProperty( obj_p, name_p);
JERRY_ASSERT( property_p != NULL && property_p->m_Type == ECMA_PROPERTY_NAMEDDATA );
JERRY_ASSERT( property_p != NULL && property_p->Type == ECMA_PROPERTY_NAMEDDATA );
return property_p;
} /* ecma_GetNamedDataProperty */
@ -327,10 +327,10 @@ ecma_GetNamedDataProperty(ecma_Object_t *obj_p, /**< object to find property in
void
ecma_FreeNamedDataProperty( ecma_Property_t *pProperty) /**< the property */
{
JERRY_ASSERT( pProperty->m_Type == ECMA_PROPERTY_NAMEDDATA );
JERRY_ASSERT( pProperty->Type == ECMA_PROPERTY_NAMEDDATA );
ecma_FreeArray( ecma_GetPointer( pProperty->u.m_NamedDataProperty.m_pName));
ecma_FreeValue( pProperty->u.m_NamedDataProperty.m_Value);
ecma_FreeArray( ecma_GetPointer( pProperty->u.NamedDataProperty.pName));
ecma_FreeValue( pProperty->u.NamedDataProperty.Value);
ecma_DeallocProperty( pProperty);
} /* ecma_FreeNamedDataProperty */
@ -341,12 +341,12 @@ ecma_FreeNamedDataProperty( ecma_Property_t *pProperty) /**< the property */
void
ecma_FreeNamedAccessorProperty( ecma_Property_t *pProperty) /**< the property */
{
JERRY_ASSERT( pProperty->m_Type == ECMA_PROPERTY_NAMEDACCESSOR );
JERRY_ASSERT( pProperty->Type == ECMA_PROPERTY_NAMEDACCESSOR );
ecma_FreeArray( ecma_GetPointer( pProperty->u.m_NamedAccessorProperty.m_pName));
ecma_FreeArray( ecma_GetPointer( pProperty->u.NamedAccessorProperty.pName));
ecma_Object_t *pGet = ecma_GetPointer(pProperty->u.m_NamedAccessorProperty.m_pGet);
ecma_Object_t *pSet = ecma_GetPointer(pProperty->u.m_NamedAccessorProperty.m_pSet);
ecma_Object_t *pGet = ecma_GetPointer(pProperty->u.NamedAccessorProperty.pGet);
ecma_Object_t *pSet = ecma_GetPointer(pProperty->u.NamedAccessorProperty.pSet);
if ( pGet != NULL )
{
@ -367,10 +367,10 @@ ecma_FreeNamedAccessorProperty( ecma_Property_t *pProperty) /**< the property */
void
ecma_FreeInternalProperty( ecma_Property_t *pProperty) /**< the property */
{
JERRY_ASSERT( pProperty->m_Type == ECMA_PROPERTY_INTERNAL );
JERRY_ASSERT( pProperty->Type == ECMA_PROPERTY_INTERNAL );
ecma_InternalPropertyId_t propertyId = pProperty->u.m_InternalProperty.m_InternalPropertyType;
uint32_t propertyValue = pProperty->u.m_InternalProperty.m_Value;
ecma_InternalPropertyId_t propertyId = pProperty->u.InternalProperty.InternalPropertyType;
uint32_t propertyValue = pProperty->u.InternalProperty.Value;
switch ( propertyId )
{
@ -406,7 +406,7 @@ ecma_FreeInternalProperty( ecma_Property_t *pProperty) /**< the property */
void
ecma_FreeProperty(ecma_Property_t *prop_p) /**< property */
{
switch ( (ecma_PropertyType_t) prop_p->m_Type )
switch ( (ecma_PropertyType_t) prop_p->Type )
{
case ECMA_PROPERTY_NAMEDDATA:
{
@ -440,11 +440,11 @@ void
ecma_DeleteProperty(ecma_Object_t *obj_p, /**< object */
ecma_Property_t *prop_p) /**< property */
{
for ( ecma_Property_t *cur_prop_p = ecma_GetPointer( obj_p->m_pProperties), *prev_prop_p = NULL, *next_prop_p;
for ( ecma_Property_t *cur_prop_p = ecma_GetPointer( obj_p->pProperties), *prev_prop_p = NULL, *next_prop_p;
cur_prop_p != NULL;
prev_prop_p = cur_prop_p, cur_prop_p = next_prop_p )
{
next_prop_p = ecma_GetPointer( cur_prop_p->m_pNextProperty);
next_prop_p = ecma_GetPointer( cur_prop_p->pNextProperty);
if ( cur_prop_p == prop_p )
{
@ -452,10 +452,10 @@ ecma_DeleteProperty(ecma_Object_t *obj_p, /**< object */
if ( prev_prop_p == NULL )
{
ecma_SetPointer( obj_p->m_pProperties, next_prop_p);
ecma_SetPointer( obj_p->pProperties, next_prop_p);
} else
{
ecma_SetPointer( prev_prop_p->m_pNextProperty, next_prop_p);
ecma_SetPointer( prev_prop_p->pNextProperty, next_prop_p);
}
return;
@ -489,30 +489,30 @@ ecma_NewEcmaString(const ecma_Char_t *pString) /**< zero-terminated string of ec
ecma_ArrayFirstChunk_t *pStringFirstChunk = ecma_AllocArrayFirstChunk();
pStringFirstChunk->m_Header.m_UnitNumber = length;
pStringFirstChunk->Header.UnitNumber = length;
uint8_t *copyPointer = (uint8_t*) pString;
size_t charsLeft = length;
size_t charsToCopy = JERRY_MIN( length, sizeof (pStringFirstChunk->m_Data) / sizeof (ecma_Char_t));
__memcpy(pStringFirstChunk->m_Data, copyPointer, charsToCopy * sizeof (ecma_Char_t));
size_t charsToCopy = JERRY_MIN( length, sizeof (pStringFirstChunk->Data) / sizeof (ecma_Char_t));
__memcpy(pStringFirstChunk->Data, copyPointer, charsToCopy * sizeof (ecma_Char_t));
charsLeft -= charsToCopy;
copyPointer += charsToCopy * sizeof (ecma_Char_t);
ecma_ArrayNonFirstChunk_t *pStringNonFirstChunk;
JERRY_STATIC_ASSERT( ECMA_POINTER_FIELD_WIDTH <= sizeof(uint16_t) * JERRY_BITSINBYTE );
uint16_t *pNextChunkCompressedPointer = &pStringFirstChunk->m_Header.m_pNextChunk;
uint16_t *pNextChunkCompressedPointer = &pStringFirstChunk->Header.pNextChunk;
while ( charsLeft > 0 )
{
pStringNonFirstChunk = ecma_AllocArrayNonFirstChunk();
size_t charsToCopy = JERRY_MIN( charsLeft, sizeof (pStringNonFirstChunk->m_Data) / sizeof (ecma_Char_t));
__memcpy(pStringNonFirstChunk->m_Data, copyPointer, charsToCopy * sizeof (ecma_Char_t));
size_t charsToCopy = JERRY_MIN( charsLeft, sizeof (pStringNonFirstChunk->Data) / sizeof (ecma_Char_t));
__memcpy(pStringNonFirstChunk->Data, copyPointer, charsToCopy * sizeof (ecma_Char_t));
charsLeft -= charsToCopy;
copyPointer += charsToCopy * sizeof (ecma_Char_t);
ecma_SetPointer( *pNextChunkCompressedPointer, pStringNonFirstChunk);
pNextChunkCompressedPointer = &pStringNonFirstChunk->m_pNextChunk;
pNextChunkCompressedPointer = &pStringNonFirstChunk->pNextChunk;
}
*pNextChunkCompressedPointer = ECMA_NULL_POINTER;
@ -534,7 +534,7 @@ ecma_CopyEcmaStringCharsToBuffer(ecma_ArrayFirstChunk_t *pFirstChunk, /**< first
uint8_t *pBuffer, /**< destination buffer */
size_t bufferSize) /**< size of buffer */
{
ecma_Length_t stringLength = pFirstChunk->m_Header.m_UnitNumber;
ecma_Length_t stringLength = pFirstChunk->Header.UnitNumber;
size_t requiredBufferSize = sizeof (ecma_Length_t) + sizeof (ecma_Char_t) * stringLength;
if ( requiredBufferSize < bufferSize )
@ -546,25 +546,25 @@ ecma_CopyEcmaStringCharsToBuffer(ecma_ArrayFirstChunk_t *pFirstChunk, /**< first
size_t charsLeft = stringLength;
uint8_t *destPointer = pBuffer + sizeof (ecma_Length_t);
size_t copyChunkChars = JERRY_MIN(sizeof (pFirstChunk->m_Data) / sizeof (ecma_Char_t),
size_t copyChunkChars = JERRY_MIN(sizeof (pFirstChunk->Data) / sizeof (ecma_Char_t),
charsLeft);
__memcpy( destPointer, pFirstChunk->m_Data, copyChunkChars * sizeof (ecma_Char_t));
__memcpy( destPointer, pFirstChunk->Data, copyChunkChars * sizeof (ecma_Char_t));
destPointer += copyChunkChars * sizeof (ecma_Char_t);
charsLeft -= copyChunkChars;
ecma_ArrayNonFirstChunk_t *pNonFirstChunk = ecma_GetPointer( pFirstChunk->m_Header.m_pNextChunk);
ecma_ArrayNonFirstChunk_t *pNonFirstChunk = ecma_GetPointer( pFirstChunk->Header.pNextChunk);
while ( charsLeft > 0 )
{
JERRY_ASSERT( charsLeft < stringLength );
copyChunkChars = JERRY_MIN(sizeof (pNonFirstChunk->m_Data) / sizeof (ecma_Char_t),
copyChunkChars = JERRY_MIN(sizeof (pNonFirstChunk->Data) / sizeof (ecma_Char_t),
charsLeft);
__memcpy( destPointer, pNonFirstChunk->m_Data, copyChunkChars * sizeof (ecma_Char_t));
__memcpy( destPointer, pNonFirstChunk->Data, copyChunkChars * sizeof (ecma_Char_t));
destPointer += copyChunkChars * sizeof (ecma_Char_t);
charsLeft -= copyChunkChars;
pNonFirstChunk = ecma_GetPointer( pNonFirstChunk->m_pNextChunk);
pNonFirstChunk = ecma_GetPointer( pNonFirstChunk->pNextChunk);
}
return (ssize_t) requiredBufferSize;
@ -584,18 +584,18 @@ ecma_DuplicateEcmaString( ecma_ArrayFirstChunk_t *pFirstChunk) /**< first chunk
__memcpy( pFirstChunkCopy, pFirstChunk, sizeof (ecma_ArrayFirstChunk_t));
ecma_ArrayNonFirstChunk_t *pNonFirstChunk, *pNonFirstChunkCopy;
pNonFirstChunk = ecma_GetPointer( pFirstChunk->m_Header.m_pNextChunk);
uint16_t *pNextPointer = &pFirstChunkCopy->m_Header.m_pNextChunk;
pNonFirstChunk = ecma_GetPointer( pFirstChunk->Header.pNextChunk);
uint16_t *pNextPointer = &pFirstChunkCopy->Header.pNextChunk;
while ( pNonFirstChunk != NULL )
{
pNonFirstChunkCopy = ecma_AllocArrayNonFirstChunk();
ecma_SetPointer( *pNextPointer, pNonFirstChunkCopy);
pNextPointer = &pNonFirstChunkCopy->m_pNextChunk;
pNextPointer = &pNonFirstChunkCopy->pNextChunk;
__memcpy( pNonFirstChunkCopy, pNonFirstChunk, sizeof (ecma_ArrayNonFirstChunk_t));
pNonFirstChunk = ecma_GetPointer( pNonFirstChunk->m_pNextChunk);
pNonFirstChunk = ecma_GetPointer( pNonFirstChunk->pNextChunk);
}
*pNextPointer = ECMA_NULL_POINTER;
@ -630,13 +630,13 @@ ecma_CompareZtStringToEcmaString(const ecma_Char_t *pString, /**< zero-terminate
JERRY_ASSERT( pEcmaString != NULL );
const ecma_Char_t *str_iter_p = pString;
ecma_Length_t ecma_str_len = pEcmaString->m_Header.m_UnitNumber;
const ecma_Char_t *current_chunk_chars_cur = (ecma_Char_t*) pEcmaString->m_Data,
*current_chunk_chars_end = (ecma_Char_t*) (pEcmaString->m_Data
+ sizeof(pEcmaString->m_Data));
ecma_Length_t ecma_str_len = pEcmaString->Header.UnitNumber;
const ecma_Char_t *current_chunk_chars_cur = (ecma_Char_t*) pEcmaString->Data,
*current_chunk_chars_end = (ecma_Char_t*) (pEcmaString->Data
+ sizeof(pEcmaString->Data));
JERRY_STATIC_ASSERT( ECMA_POINTER_FIELD_WIDTH <= sizeof(uint16_t) * JERRY_BITSINBYTE );
const uint16_t *next_chunk_compressed_pointer_p = &pEcmaString->m_Header.m_pNextChunk;
const uint16_t *next_chunk_compressed_pointer_p = &pEcmaString->Header.pNextChunk;
for ( ecma_Length_t str_index = 0;
str_index < ecma_str_len;
@ -651,10 +651,10 @@ ecma_CompareZtStringToEcmaString(const ecma_Char_t *pString, /**< zero-terminate
JERRY_ASSERT( next_chunk_p != NULL );
current_chunk_chars_cur = (ecma_Char_t*) pEcmaString->m_Data;
current_chunk_chars_end = (ecma_Char_t*) (next_chunk_p->m_Data + sizeof(next_chunk_p->m_Data));
current_chunk_chars_cur = (ecma_Char_t*) pEcmaString->Data;
current_chunk_chars_end = (ecma_Char_t*) (next_chunk_p->Data + sizeof(next_chunk_p->Data));
next_chunk_compressed_pointer_p = &next_chunk_p->m_pNextChunk;
next_chunk_compressed_pointer_p = &next_chunk_p->pNextChunk;
}
if ( *str_iter_p != *current_chunk_chars_cur )
@ -686,13 +686,13 @@ ecma_FreeArray( ecma_ArrayFirstChunk_t *pFirstChunk) /**< first chunk of the arr
{
JERRY_ASSERT( pFirstChunk != NULL );
ecma_ArrayNonFirstChunk_t *pNonFirstChunk = ecma_GetPointer( pFirstChunk->m_Header.m_pNextChunk);
ecma_ArrayNonFirstChunk_t *pNonFirstChunk = ecma_GetPointer( pFirstChunk->Header.pNextChunk);
ecma_DeallocArrayFirstChunk( pFirstChunk);
while ( pNonFirstChunk != NULL )
{
ecma_ArrayNonFirstChunk_t *pNextChunk = ecma_GetPointer( pNonFirstChunk->m_pNextChunk);
ecma_ArrayNonFirstChunk_t *pNextChunk = ecma_GetPointer( pNonFirstChunk->pNextChunk);
ecma_DeallocArrayNonFirstChunk( pNonFirstChunk);

View File

@ -39,16 +39,16 @@ ecma_abstract_equality_compare(ecma_Value_t x, /**< first operand */
const bool is_x_undefined = ecma_IsValueUndefined( x);
const bool is_x_null = ecma_IsValueNull( x);
const bool is_x_boolean = ecma_IsValueBoolean( x);
const bool is_x_number = ( x.m_ValueType == ECMA_TYPE_NUMBER );
const bool is_x_string = ( x.m_ValueType == ECMA_TYPE_STRING );
const bool is_x_object = ( x.m_ValueType == ECMA_TYPE_OBJECT );
const bool is_x_number = ( x.ValueType == ECMA_TYPE_NUMBER );
const bool is_x_string = ( x.ValueType == ECMA_TYPE_STRING );
const bool is_x_object = ( x.ValueType == ECMA_TYPE_OBJECT );
const bool is_y_undefined = ecma_IsValueUndefined( y);
const bool is_y_null = ecma_IsValueNull( y);
const bool is_y_boolean = ecma_IsValueBoolean( y);
const bool is_y_number = ( y.m_ValueType == ECMA_TYPE_NUMBER );
const bool is_y_string = ( y.m_ValueType == ECMA_TYPE_STRING );
const bool is_y_object = ( y.m_ValueType == ECMA_TYPE_OBJECT );
const bool is_y_number = ( y.ValueType == ECMA_TYPE_NUMBER );
const bool is_y_string = ( y.ValueType == ECMA_TYPE_STRING );
const bool is_y_object = ( y.ValueType == ECMA_TYPE_OBJECT );
const bool is_types_equal = ( ( is_x_undefined && is_y_undefined )
|| ( is_x_null && is_y_null )
@ -68,26 +68,26 @@ ecma_abstract_equality_compare(ecma_Value_t x, /**< first operand */
return true;
} else if ( is_x_number )
{ // c.
ecma_Number_t x_num = *(ecma_Number_t*)( ecma_GetPointer(x.m_Value) );
ecma_Number_t y_num = *(ecma_Number_t*)( ecma_GetPointer(y.m_Value) );
ecma_Number_t x_num = *(ecma_Number_t*)( ecma_GetPointer(x.Value) );
ecma_Number_t y_num = *(ecma_Number_t*)( ecma_GetPointer(y.Value) );
TODO( Implement according to ECMA );
return (x_num == y_num);
} else if ( is_x_string )
{ // d.
ecma_ArrayFirstChunk_t* x_str = (ecma_ArrayFirstChunk_t*)( ecma_GetPointer(x.m_Value) );
ecma_ArrayFirstChunk_t* y_str = (ecma_ArrayFirstChunk_t*)( ecma_GetPointer(y.m_Value) );
ecma_ArrayFirstChunk_t* x_str = (ecma_ArrayFirstChunk_t*)( ecma_GetPointer(x.Value) );
ecma_ArrayFirstChunk_t* y_str = (ecma_ArrayFirstChunk_t*)( ecma_GetPointer(y.Value) );
return ecma_CompareEcmaStringToEcmaString( x_str, y_str);
} else if ( is_x_boolean )
{ // e.
return ( x.m_Value == y.m_Value );
return ( x.Value == y.Value );
} else
{ // f.
JERRY_ASSERT( is_x_object );
return ( x.m_Value == y.m_Value );
return ( x.Value == y.Value );
}
} else if ( ( is_x_null && is_y_undefined )
|| ( is_x_undefined && is_y_null ) )

View File

@ -40,11 +40,11 @@
ecma_CompletionValue_t
ecma_op_check_object_coercible( ecma_Value_t value) /**< ecma-value */
{
switch ( (ecma_Type_t)value.m_ValueType )
switch ( (ecma_Type_t)value.ValueType )
{
case ECMA_TYPE_SIMPLE:
{
switch ( (ecma_SimpleValue_t)value.m_Value )
switch ( (ecma_SimpleValue_t)value.Value )
{
case ECMA_SIMPLE_VALUE_UNDEFINED:
case ECMA_SIMPLE_VALUE_NULL:
@ -95,7 +95,7 @@ ecma_op_check_object_coercible( ecma_Value_t value) /**< ecma-value */
ecma_CompletionValue_t
ecma_op_to_primitive( ecma_Value_t value) /**< ecma-value */
{
switch ( (ecma_Type_t)value.m_ValueType )
switch ( (ecma_Type_t)value.ValueType )
{
case ECMA_TYPE_SIMPLE:
case ECMA_TYPE_NUMBER:
@ -130,7 +130,7 @@ ecma_op_to_primitive( ecma_Value_t value) /**< ecma-value */
ecma_CompletionValue_t
ecma_op_to_number( ecma_Value_t value) /**< ecma-value */
{
switch ( (ecma_Type_t)value.m_ValueType )
switch ( (ecma_Type_t)value.ValueType )
{
case ECMA_TYPE_NUMBER:
{

View File

@ -43,10 +43,10 @@ ecma_op_get_value( ecma_Reference_t ref) /**< ECMA-reference */
const ecma_Value_t base = ref.base;
const bool is_unresolvable_reference = ecma_IsValueUndefined( base);
const bool has_primitive_base = ( ecma_IsValueBoolean( base)
|| base.m_ValueType == ECMA_TYPE_NUMBER
|| base.m_ValueType == ECMA_TYPE_STRING );
const bool has_object_base = ( base.m_ValueType == ECMA_TYPE_OBJECT
&& !((ecma_Object_t*)ecma_GetPointer(base.m_Value))->m_IsLexicalEnvironment );
|| base.ValueType == ECMA_TYPE_NUMBER
|| base.ValueType == ECMA_TYPE_STRING );
const bool has_object_base = ( base.ValueType == ECMA_TYPE_OBJECT
&& !((ecma_Object_t*)ecma_GetPointer(base.Value))->IsLexicalEnvironment );
const bool is_property_reference = has_primitive_base || has_object_base;
// GetValue_3
@ -60,8 +60,8 @@ ecma_op_get_value( ecma_Reference_t ref) /**< ECMA-reference */
{
if ( !has_primitive_base ) // GetValue_4.a
{
ecma_Object_t *obj_p = ecma_GetPointer( base.m_Value);
JERRY_ASSERT( obj_p != NULL && !obj_p->m_IsLexicalEnvironment );
ecma_Object_t *obj_p = ecma_GetPointer( base.Value);
JERRY_ASSERT( obj_p != NULL && !obj_p->IsLexicalEnvironment );
// GetValue_4.b case 1
/* return [[Get]]( base as this, ref.referenced_name_p) */
@ -70,18 +70,18 @@ ecma_op_get_value( ecma_Reference_t ref) /**< ECMA-reference */
{ // GetValue_4.b case 2
/*
ecma_Object_t *obj_p = ecma_ToObject( base);
JERRY_ASSERT( obj_p != NULL && !obj_p->m_IsLexicalEnvironment );
JERRY_ASSERT( obj_p != NULL && !obj_p->IsLexicalEnvironment );
ecma_Property_t *property = obj_p->[[GetProperty]]( ref.referenced_name_p);
if ( property->m_Type == ECMA_PROPERTY_NAMEDDATA )
if ( property->Type == ECMA_PROPERTY_NAMEDDATA )
{
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_CopyValue( property->u.m_NamedDataProperty.m_Value),
ecma_CopyValue( property->u.NamedDataProperty.Value),
ECMA_TARGET_ID_RESERVED);
} else
{
JERRY_ASSERT( property->m_Type == ECMA_PROPERTY_NAMEDACCESSOR );
JERRY_ASSERT( property->Type == ECMA_PROPERTY_NAMEDACCESSOR );
ecma_Object_t *getter = ecma_GetPointer( property->u.m_NamedAccessorProperty.m_pGet);
ecma_Object_t *getter = ecma_GetPointer( property->u.NamedAccessorProperty.pGet);
if ( getter == NULL )
{
@ -99,9 +99,9 @@ ecma_op_get_value( ecma_Reference_t ref) /**< ECMA-reference */
} else
{
// GetValue_5
ecma_Object_t *lex_env_p = ecma_GetPointer( base.m_Value);
ecma_Object_t *lex_env_p = ecma_GetPointer( base.Value);
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->m_IsLexicalEnvironment );
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
return ecma_OpGetBindingValue( lex_env_p, ref.referenced_name_p, ref.is_strict);
}
@ -122,10 +122,10 @@ ecma_op_put_value(ecma_Reference_t ref, /**< ECMA-reference */
const ecma_Value_t base = ref.base;
const bool is_unresolvable_reference = ecma_IsValueUndefined( base);
const bool has_primitive_base = ( ecma_IsValueBoolean( base)
|| base.m_ValueType == ECMA_TYPE_NUMBER
|| base.m_ValueType == ECMA_TYPE_STRING );
const bool has_object_base = ( base.m_ValueType == ECMA_TYPE_OBJECT
&& !((ecma_Object_t*)ecma_GetPointer(base.m_Value))->m_IsLexicalEnvironment );
|| base.ValueType == ECMA_TYPE_NUMBER
|| base.ValueType == ECMA_TYPE_STRING );
const bool has_object_base = ( base.ValueType == ECMA_TYPE_OBJECT
&& !((ecma_Object_t*)ecma_GetPointer(base.Value))->IsLexicalEnvironment );
const bool is_property_reference = has_primitive_base || has_object_base;
if ( is_unresolvable_reference ) // PutValue_3
@ -158,7 +158,7 @@ ecma_op_put_value(ecma_Reference_t ref, /**< ECMA-reference */
/*
// PutValue_sub_1
ecma_Object_t *obj_p = ecma_ToObject( base);
JERRY_ASSERT( obj_p != NULL && !obj_p->m_IsLexicalEnvironment );
JERRY_ASSERT( obj_p != NULL && !obj_p->IsLexicalEnvironment );
// PutValue_sub_2
if ( !obj_p->[[CanPut]]( ref.referenced_name_p) )
@ -200,7 +200,7 @@ ecma_op_put_value(ecma_Reference_t ref, /**< ECMA-reference */
if ( ecma_OpIsAccessorDescriptor( prop) )
{
// PutValue_sub_6.a
ecma_Object_t *setter = ecma_GetPointer( property->u.m_NamedAccessorProperty.m_pSet);
ecma_Object_t *setter = ecma_GetPointer( property->u.NamedAccessorProperty.pSet);
JERRY_ASSERT( setter != NULL );
// PutValue_sub_6.b
@ -225,9 +225,9 @@ ecma_op_put_value(ecma_Reference_t ref, /**< ECMA-reference */
} else
{
// PutValue_7
ecma_Object_t *lex_env_p = ecma_GetPointer( base.m_Value);
ecma_Object_t *lex_env_p = ecma_GetPointer( base.Value);
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->m_IsLexicalEnvironment );
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
return ecma_OpSetMutableBinding( lex_env_p, ref.referenced_name_p, value, ref.is_strict);
}

View File

@ -41,11 +41,11 @@ ecma_CompletionValue_t
ecma_OpHasBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
ecma_Char_t *name_p) /**< argument N */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->m_IsLexicalEnvironment );
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
ecma_SimpleValue_t has_binding = ECMA_SIMPLE_VALUE_UNDEFINED;
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.m_LexicalEnvironment.m_Type )
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
@ -81,10 +81,10 @@ ecma_OpCreateMutableBinding(ecma_Object_t *lex_env_p, /**< lexical environment *
ecma_Char_t *name_p, /**< argument N */
bool is_deletable) /**< argument D */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->m_IsLexicalEnvironment );
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
JERRY_ASSERT( name_p != NULL );
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.m_LexicalEnvironment.m_Type )
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
@ -125,21 +125,21 @@ ecma_OpSetMutableBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
ecma_Value_t value, /**< argument V */
bool is_strict) /**< argument S */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->m_IsLexicalEnvironment );
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
JERRY_ASSERT( name_p != NULL );
JERRY_ASSERT( ecma_IsCompletionValueNormalTrue( ecma_OpHasBinding( lex_env_p, name_p)) );
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.m_LexicalEnvironment.m_Type )
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
ecma_Property_t *property_p = ecma_GetNamedDataProperty( lex_env_p, name_p);
if ( property_p->u.m_NamedDataProperty.m_Writable == ECMA_PROPERTY_WRITABLE )
if ( property_p->u.NamedDataProperty.Writable == ECMA_PROPERTY_WRITABLE )
{
ecma_FreeValue( property_p->u.m_NamedDataProperty.m_Value);
property_p->u.m_NamedDataProperty.m_Value = ecma_CopyValue( value);
ecma_FreeValue( property_p->u.NamedDataProperty.Value);
property_p->u.NamedDataProperty.Value = ecma_CopyValue( value);
} else if ( is_strict )
{
return ecma_MakeThrowValue( ecma_NewStandardError( ECMA_ERROR_TYPE));
@ -171,27 +171,27 @@ ecma_OpGetBindingValue(ecma_Object_t *lex_env_p, /**< lexical environment */
ecma_Char_t *name_p, /**< argument N */
bool is_strict) /**< argument S */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->m_IsLexicalEnvironment );
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
JERRY_ASSERT( name_p != NULL );
JERRY_ASSERT( ecma_IsCompletionValueNormalTrue( ecma_OpHasBinding( lex_env_p, name_p)) );
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.m_LexicalEnvironment.m_Type )
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
ecma_Property_t *property_p = ecma_GetNamedDataProperty( lex_env_p, name_p);
ecma_Value_t prop_value = property_p->u.m_NamedDataProperty.m_Value;
ecma_Value_t prop_value = property_p->u.NamedDataProperty.Value;
/* is the binding mutable? */
if ( property_p->u.m_NamedDataProperty.m_Writable == ECMA_PROPERTY_WRITABLE )
if ( property_p->u.NamedDataProperty.Writable == ECMA_PROPERTY_WRITABLE )
{
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_CopyValue( prop_value),
ECMA_TARGET_ID_RESERVED);
} else if ( prop_value.m_ValueType == ECMA_TYPE_SIMPLE
&& prop_value.m_Value == ECMA_SIMPLE_VALUE_EMPTY )
} else if ( prop_value.ValueType == ECMA_TYPE_SIMPLE
&& prop_value.Value == ECMA_SIMPLE_VALUE_EMPTY )
{
/* unitialized immutable binding */
if ( is_strict )
@ -229,10 +229,10 @@ ecma_CompletionValue_t
ecma_OpDeleteBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
ecma_Char_t *name_p) /**< argument N */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->m_IsLexicalEnvironment );
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
JERRY_ASSERT( name_p != NULL );
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.m_LexicalEnvironment.m_Type )
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
@ -244,9 +244,9 @@ ecma_OpDeleteBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
ret_val = ECMA_SIMPLE_VALUE_TRUE;
} else
{
JERRY_ASSERT( prop_p->m_Type == ECMA_PROPERTY_NAMEDDATA );
JERRY_ASSERT( prop_p->Type == ECMA_PROPERTY_NAMEDDATA );
if ( prop_p->u.m_NamedDataProperty.m_Configurable == ECMA_PROPERTY_NOT_CONFIGURABLE )
if ( prop_p->u.NamedDataProperty.Configurable == ECMA_PROPERTY_NOT_CONFIGURABLE )
{
ret_val = ECMA_SIMPLE_VALUE_FALSE;
} else
@ -281,9 +281,9 @@ ecma_OpDeleteBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
ecma_CompletionValue_t
ecma_OpImplicitThisValue( ecma_Object_t *lex_env_p) /**< lexical environment */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->m_IsLexicalEnvironment );
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.m_LexicalEnvironment.m_Type )
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
@ -309,9 +309,9 @@ void
ecma_OpCreateImmutableBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
ecma_Char_t *name_p) /**< argument N */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->m_IsLexicalEnvironment );
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.m_LexicalEnvironment.m_Type )
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
@ -327,9 +327,9 @@ ecma_OpCreateImmutableBinding(ecma_Object_t *lex_env_p, /**< lexical environment
ECMA_PROPERTY_NOT_ENUMERABLE,
ECMA_PROPERTY_NOT_CONFIGURABLE);
JERRY_ASSERT( prop_p->u.m_NamedDataProperty.m_Value.m_ValueType == ECMA_TYPE_SIMPLE );
JERRY_ASSERT( prop_p->u.NamedDataProperty.Value.ValueType == ECMA_TYPE_SIMPLE );
prop_p->u.m_NamedDataProperty.m_Value.m_Value = ECMA_SIMPLE_VALUE_EMPTY;
prop_p->u.NamedDataProperty.Value.Value = ECMA_SIMPLE_VALUE_EMPTY;
}
case ECMA_LEXICAL_ENVIRONMENT_OBJECTBOUND:
{
@ -350,9 +350,9 @@ ecma_OpInitializeImmutableBinding(ecma_Object_t *lex_env_p, /**< lexical environ
ecma_Char_t *name_p, /**< argument N */
ecma_Value_t value) /**< argument V */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->m_IsLexicalEnvironment );
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.m_LexicalEnvironment.m_Type )
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
@ -361,11 +361,11 @@ ecma_OpInitializeImmutableBinding(ecma_Object_t *lex_env_p, /**< lexical environ
ecma_Property_t *prop_p = ecma_GetNamedDataProperty( lex_env_p, name_p);
/* The binding must be unitialized immutable binding */
JERRY_ASSERT( prop_p->u.m_NamedDataProperty.m_Writable == ECMA_PROPERTY_NOT_WRITABLE
&& prop_p->u.m_NamedDataProperty.m_Value.m_ValueType == ECMA_TYPE_SIMPLE
&& prop_p->u.m_NamedDataProperty.m_Value.m_Value == ECMA_SIMPLE_VALUE_EMPTY );
JERRY_ASSERT( prop_p->u.NamedDataProperty.Writable == ECMA_PROPERTY_NOT_WRITABLE
&& prop_p->u.NamedDataProperty.Value.ValueType == ECMA_TYPE_SIMPLE
&& prop_p->u.NamedDataProperty.Value.Value == ECMA_SIMPLE_VALUE_EMPTY );
prop_p->u.m_NamedDataProperty.m_Value = ecma_CopyValue( value);
prop_p->u.NamedDataProperty.Value = ecma_CopyValue( value);
}
case ECMA_LEXICAL_ENVIRONMENT_OBJECTBOUND:
{

View File

@ -63,7 +63,7 @@ ecma_OpGetIdentifierReference(ecma_Object_t *lex_env_p, /**< lexical environment
JERRY_ASSERT( ecma_IsCompletionValueNormalFalse( completion_value) );
}
lex_env_iter_p = ecma_GetPointer( lex_env_iter_p->u.m_LexicalEnvironment.m_pOuterReference);
lex_env_iter_p = ecma_GetPointer( lex_env_iter_p->u.LexicalEnvironment.pOuterReference);
}
return ecma_MakeReference( ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_UNDEFINED),