mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Reduce memory allocation during bytecode generation
* ByteCodeBlock does not hold location data info anymore * location data of each bytecode is manually allocated only for stack-tracing or debugger mode * duplicated String allocation for source code is removed Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
parent
ccdf475f9b
commit
f56a557ff5
22 changed files with 277 additions and 186 deletions
|
|
@ -267,9 +267,7 @@ void CodeCacheWriter::storeByteCodeBlock(ByteCodeBlock* block)
|
|||
|
||||
size_t size;
|
||||
|
||||
m_buffer.ensureSize(4 * sizeof(bool) + sizeof(uint16_t));
|
||||
m_buffer.put(block->m_isEvalMode);
|
||||
m_buffer.put(block->m_isOnGlobal);
|
||||
m_buffer.ensureSize(2 * sizeof(bool) + sizeof(uint16_t));
|
||||
m_buffer.put(block->m_shouldClearStack);
|
||||
m_buffer.put(block->m_isOwnerMayFreed);
|
||||
m_buffer.put((uint16_t)block->m_requiredRegisterFileSizeInValueSize);
|
||||
|
|
@ -715,8 +713,6 @@ ByteCodeBlock* CodeCacheReader::loadByteCodeBlock(Context* context, Script* scri
|
|||
size_t size;
|
||||
ByteCodeBlock* block = new ByteCodeBlock(script->topCodeBlock());
|
||||
|
||||
block->m_isEvalMode = m_buffer.get<bool>();
|
||||
block->m_isOnGlobal = m_buffer.get<bool>();
|
||||
block->m_shouldClearStack = m_buffer.get<bool>();
|
||||
block->m_isOwnerMayFreed = m_buffer.get<bool>();
|
||||
block->m_requiredRegisterFileSizeInValueSize = m_buffer.get<uint16_t>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue