mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Handle exception cases in CodeCache
* handle ThrowStaticErrorOperation bytecode with default error message * LoadRegexp bytecode could have empty string as its option string * test on new-es benchmarks Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
parent
606b59ecef
commit
dbe6cd0e70
3 changed files with 21 additions and 7 deletions
|
|
@ -439,7 +439,7 @@ void CodeCacheWriter::storeByteCodeStream(ByteCodeBlock* block)
|
|||
String* bodyString = bc->m_body;
|
||||
String* optionString = bc->m_option;
|
||||
ASSERT(!!bodyString && bodyString->length() > 0);
|
||||
ASSERT(!!optionString && optionString->length() > 0);
|
||||
ASSERT(!!optionString);
|
||||
|
||||
size_t bodyIndex = VectorUtil::findInVector(stringLiteralData, bodyString);
|
||||
size_t optionIndex = VectorUtil::findInVector(stringLiteralData, optionString);
|
||||
|
|
@ -501,8 +501,11 @@ void CodeCacheWriter::storeByteCodeStream(ByteCodeBlock* block)
|
|||
STORE_ATOMICSTRING_RELOC(m_slot->m_propertyName);
|
||||
break;
|
||||
}
|
||||
// TODO
|
||||
case ThrowStaticErrorOperationOpcode:
|
||||
case ThrowStaticErrorOperationOpcode: {
|
||||
ThrowStaticErrorOperation* bc = (ThrowStaticErrorOperation*)currentCode;
|
||||
STORE_ATOMICSTRING_RELOC(m_templateDataString);
|
||||
break;
|
||||
}
|
||||
case ExecutionResumeOpcode:
|
||||
RELEASE_ASSERT_NOT_REACHED();
|
||||
break;
|
||||
|
|
@ -952,6 +955,12 @@ void CodeCacheReader::loadByteCodeStream(Context* context, ByteCodeBlock* block)
|
|||
bc->m_slot = context->ensureGlobalVariableAccessCacheSlot(m_stringTable->get(stringIndex));
|
||||
break;
|
||||
}
|
||||
case ThrowStaticErrorOperationOpcode: {
|
||||
ThrowStaticErrorOperation* bc = (ThrowStaticErrorOperation*)currentCode;
|
||||
bc->m_errorMessage = ErrorObject::Messages::CodeCache_Loaded_StaticError;
|
||||
LOAD_ATOMICSTRING_RELOC(m_templateDataString);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
RELEASE_ASSERT_NOT_REACHED();
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue