mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-29 10:02:14 +00:00
Reduce memory usage
* Reduce size of RopeString * Use fit memory if possible for ArrayObject fastModeData * Re-implement ByteCode pruning logic * Re-implement inline-cache for reducing memory usage * Remove std::vector with gc_allocator. it can cause memory leak Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
963cc4aa07
commit
fba9396ec9
74 changed files with 777 additions and 654 deletions
|
|
@ -553,7 +553,7 @@ Object::OwnPropertyKeyVector ProxyObject::ownPropertyKeys(ExecutionState& state)
|
|||
}
|
||||
|
||||
// 20. Let uncheckedResultKeys be a new List which is a copy of trapResult.
|
||||
std::vector<Value, GCUtil::gc_malloc_allocator<Value>> uncheckedResultKeys;
|
||||
ValueVector uncheckedResultKeys;
|
||||
for (size_t i = 0; i < trapResult.size(); ++i) {
|
||||
uncheckedResultKeys.push_back(trapResult[i]);
|
||||
}
|
||||
|
|
@ -565,12 +565,11 @@ Object::OwnPropertyKeyVector ProxyObject::ownPropertyKeys(ExecutionState& state)
|
|||
// a. If key is not an element of uncheckedResultKeys, throw a TypeError exception.
|
||||
// b. Remove key from uncheckedResultKeys
|
||||
bool found = false;
|
||||
for (auto iter = uncheckedResultKeys.begin(); iter != uncheckedResultKeys.end();) {
|
||||
if (iter->equalsTo(state, key)) {
|
||||
iter = uncheckedResultKeys.erase(iter);
|
||||
for (size_t i = 0; i < uncheckedResultKeys.size(); i++) {
|
||||
if (uncheckedResultKeys[i].equalsTo(state, key)) {
|
||||
uncheckedResultKeys.erase(i);
|
||||
found = true;
|
||||
} else {
|
||||
iter++;
|
||||
i--;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
|
|
@ -589,12 +588,11 @@ Object::OwnPropertyKeyVector ProxyObject::ownPropertyKeys(ExecutionState& state)
|
|||
// a. If key is not an element of uncheckedResultKeys, throw a TypeError exception.
|
||||
// b. Remove key from uncheckedResultKeys
|
||||
bool found = false;
|
||||
for (auto iter = uncheckedResultKeys.begin(); iter != uncheckedResultKeys.end();) {
|
||||
if (iter->equalsTo(state, key)) {
|
||||
iter = uncheckedResultKeys.erase(iter);
|
||||
for (size_t i = 0; i < uncheckedResultKeys.size(); i++) {
|
||||
if (uncheckedResultKeys[i].equalsTo(state, key)) {
|
||||
uncheckedResultKeys.erase(i);
|
||||
found = true;
|
||||
} else {
|
||||
iter++;
|
||||
i--;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue