1. divide FunctionObject::call into call and newInstance

2. fix test262(x64) crash
3. process new operation with binded function correctly

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
seonghyun kim 2017-04-06 14:55:07 +09:00
commit 0e2e594a55
13 changed files with 91 additions and 58 deletions

View file

@ -191,6 +191,9 @@ void ArrayObject::sort(ExecutionState& state, std::function<bool(const Value& a,
if (getArrayLength(state)) {
std::vector<Value, GCUtil::gc_malloc_ignore_off_page_allocator<Value>> values(&m_fastModeData[0], m_fastModeData.data() + getArrayLength(state));
std::sort(values.begin(), values.end(), comp);
if (getArrayLength(state) != values.size()) {
setArrayLength(state, values.size());
}
for (size_t i = 0; i < values.size(); i++) {
m_fastModeData[i] = values[i];
}