mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
1. fix bug in Object.setPrototype
2. revise rule of generate name of binded function 3. revise order evalutate CallEvalFunction opcode 4. process invalid lhs assignment correctly 5. allow \n\r in string literal 6. implement change property of binding correctly 7. Date.prototype.toGMTString and toUTCString should be same 8. fix bug in Function ctor 9. add stack checking in parseJSONWorker 10. use double_conversion with Number.prototype.toFixed, toPrecision 11. add has8BitContent for RopeString for prevent stackoverflow when invoke child::has8BitContent Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
a904501b75
commit
e7df366d73
22 changed files with 154 additions and 98 deletions
|
|
@ -712,14 +712,14 @@ Value ByteCodeInterpreter::interpret(ExecutionState& state, ByteCodeBlock* byteC
|
|||
|
||||
StoreByNameOpcodeLbl : {
|
||||
StoreByName* code = (StoreByName*)programCounter;
|
||||
storeByName(state, ec->lexicalEnvironment(), code->m_name, registerFile[code->m_registerIndex], code->m_isInitializeBinding);
|
||||
storeByName(state, ec->lexicalEnvironment(), code->m_name, registerFile[code->m_registerIndex]);
|
||||
ADD_PROGRAM_COUNTER(StoreByName);
|
||||
NEXT_INSTRUCTION();
|
||||
}
|
||||
|
||||
CallEvalFunctionOpcodeLbl : {
|
||||
CallEvalFunction* code = (CallEvalFunction*)programCounter;
|
||||
Value eval = loadByName(state, ec->lexicalEnvironment(), state.context()->staticStrings().eval);
|
||||
Value eval = registerFile[code->m_evalIndex];
|
||||
if (eval.equalsTo(state, state.context()->globalObject()->eval())) {
|
||||
// do eval
|
||||
Value arg;
|
||||
|
|
@ -998,16 +998,12 @@ NEVER_INLINE Value ByteCodeInterpreter::loadByName(ExecutionState& state, Lexica
|
|||
return Value();
|
||||
}
|
||||
|
||||
NEVER_INLINE void ByteCodeInterpreter::storeByName(ExecutionState& state, LexicalEnvironment* env, const AtomicString& name, const Value& value, bool isInitializeBinding)
|
||||
NEVER_INLINE void ByteCodeInterpreter::storeByName(ExecutionState& state, LexicalEnvironment* env, const AtomicString& name, const Value& value)
|
||||
{
|
||||
while (env) {
|
||||
auto result = env->record()->hasBinding(state, name);
|
||||
if (result.m_index != SIZE_MAX) {
|
||||
if (isInitializeBinding) {
|
||||
env->record()->initializeBinding(state, name, value);
|
||||
} else {
|
||||
env->record()->setMutableBindingByIndex(state, result.m_index, name, value);
|
||||
}
|
||||
env->record()->setMutableBindingByIndex(state, result.m_index, name, value);
|
||||
return;
|
||||
}
|
||||
env = env->outerEnvironment();
|
||||
|
|
@ -1126,8 +1122,8 @@ NEVER_INLINE Value ByteCodeInterpreter::instanceOfOperation(ExecutionState& stat
|
|||
Value P = C->getFunctionPrototype(state);
|
||||
Value O = left.asObject()->getPrototype(state);
|
||||
if (P.isObject()) {
|
||||
while (!O.isUndefinedOrNull()) {
|
||||
if (P == O) {
|
||||
while (O.isObject()) {
|
||||
if (P.asObject() == O.asObject()) {
|
||||
return Value(true);
|
||||
}
|
||||
O = O.asObject()->getPrototype(state);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue