Commit 13fd4a52 authored by adamk's avatar adamk Committed by Commit bot

Revert of Optimize add/set/delete operations for string keys in Maps and Sets...

Revert of Optimize add/set/delete operations for string keys in Maps and Sets (patchset #5 id:70001 of https://codereview.chromium.org/773993002/)

Reason for revert:
Caused test failures in mjsunit/es6/collections with --deopt-every-n-times=1

Original issue's description:
> Optimize add/set/delete operations for string keys in Maps and Sets

TBR=dslomov@chromium.org,arv@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/777233003

Cr-Commit-Position: refs/heads/master@{#25670}
parent f515e363
......@@ -56,7 +56,7 @@ function SetAddJS(key) {
if (key === 0) {
key = 0;
}
return %_SetAdd(this, key);
return %SetAdd(this, key);
}
......@@ -74,7 +74,7 @@ function SetDeleteJS(key) {
throw MakeTypeError('incompatible_method_receiver',
['Set.prototype.delete', this]);
}
return %_SetDelete(this, key);
return %SetDelete(this, key);
}
......@@ -209,7 +209,7 @@ function MapSetJS(key, value) {
if (key === 0) {
key = 0;
}
return %_MapSet(this, key, value);
return %MapSet(this, key, value);
}
......@@ -227,7 +227,7 @@ function MapDeleteJS(key) {
throw MakeTypeError('incompatible_method_receiver',
['Map.prototype.delete', this]);
}
return %_MapDelete(this, key);
return %MapDelete(this, key);
}
......
......@@ -6356,13 +6356,6 @@ class HObjectAccess FINAL {
Representation::Smi());
}
template <typename CollectionType>
static HObjectAccess ForOrderedHashTableNumberOfDeletedElements() {
return HObjectAccess(kInobject,
CollectionType::kNumberOfDeletedElementsOffset,
Representation::Smi());
}
inline bool Equals(HObjectAccess that) const {
return value_ == that.value_; // portion and offset must match
}
......
This diff is collapsed.
......@@ -2417,26 +2417,14 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
ElementsKind fixed_elements_kind,
HValue* byte_length, HValue* length);
// TODO(adamk): Move all OrderedHashTable functions to their own class.
HValue* BuildOrderedHashTableHashToBucket(HValue* hash, HValue* num_buckets);
template <typename CollectionType>
HValue* BuildOrderedHashTableHashToEntry(HValue* table, HValue* hash,
HValue* num_buckets);
template <typename CollectionType>
HValue* BuildOrderedHashTableEntryToIndex(HValue* entry, HValue* num_buckets);
template <typename CollectionType>
HValue* BuildOrderedHashTableFindEntry(HValue* table, HValue* key,
HValue* hash);
template <typename CollectionType>
HValue* BuildOrderedHashTableAddEntry(HValue* table, HValue* key,
HValue* hash,
HIfContinuation* join_continuation);
template <typename CollectionType>
void BuildJSCollectionDelete(CallRuntime* call,
const Runtime::Function* c_function);
template <typename CollectionType>
void BuildJSCollectionHas(CallRuntime* call,
const Runtime::Function* c_function);
HValue* BuildStringHashLoadIfIsStringAndHashComputed(
HValue* object, HIfContinuation* continuation);
......
......@@ -3915,14 +3915,10 @@ class OrderedHashTable: public FixedArray {
kHeaderSize + kNumberOfBucketsIndex * kPointerSize;
static const int kNumberOfElementsOffset =
kHeaderSize + kNumberOfElementsIndex * kPointerSize;
static const int kNumberOfDeletedElementsOffset =
kHeaderSize + kNumberOfDeletedElementsIndex * kPointerSize;
static const int kEntrySize = entrysize + 1;
static const int kChainOffset = entrysize;
static const int kLoadFactor = 2;
private:
static Handle<Derived> Rehash(Handle<Derived> table, int new_capacity);
......@@ -3967,6 +3963,7 @@ class OrderedHashTable: public FixedArray {
static const int kNextTableIndex = kNumberOfElementsIndex;
static const int kRemovedHolesIndex = kHashTableStartIndex;
static const int kLoadFactor = 2;
static const int kMaxCapacity =
(FixedArray::kMaxLength - kHashTableStartIndex)
/ (1 + (kEntrySize * kLoadFactor));
......
......@@ -303,6 +303,8 @@ namespace internal {
\
/* Harmony sets */ \
F(SetInitialize, 1, 1) \
F(SetAdd, 2, 1) \
F(SetDelete, 2, 1) \
F(SetClear, 1, 1) \
\
F(SetIteratorInitialize, 3, 1) \
......@@ -312,7 +314,9 @@ namespace internal {
\
/* Harmony maps */ \
F(MapInitialize, 1, 1) \
F(MapDelete, 2, 1) \
F(MapClear, 1, 1) \
F(MapSet, 3, 1) \
\
F(MapIteratorInitialize, 3, 1) \
F(MapIteratorClone, 1, 1) \
......@@ -724,13 +728,9 @@ namespace internal {
F(MathSqrtRT, 1, 1) \
F(MathLogRT, 1, 1) \
/* ES6 Collections */ \
F(MapDelete, 2, 1) \
F(MapGet, 2, 1) \
F(MapGetSize, 1, 1) \
F(MapHas, 2, 1) \
F(MapSet, 3, 1) \
F(SetAdd, 2, 1) \
F(SetDelete, 2, 1) \
F(SetGetSize, 1, 1) \
F(SetHas, 2, 1) \
/* Arrays */ \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment