Commit 7e3fafc6 authored by ishell@chromium.org's avatar ishell@chromium.org

*NumberDictionary::AddNumberEntry() handlified.

R=yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20931 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 484442d1
......@@ -16020,6 +16020,7 @@ MaybeObject* Dictionary<Derived, Shape, Key>::AddEntry(
void SeededNumberDictionary::UpdateMaxNumberKey(uint32_t key) {
DisallowHeapAllocation no_allocation;
// If the dictionary requires slow elements an element has already
// been added at a high index.
if (requires_slow_elements()) return;
......@@ -16037,38 +16038,28 @@ void SeededNumberDictionary::UpdateMaxNumberKey(uint32_t key) {
}
}
Handle<SeededNumberDictionary> SeededNumberDictionary::AddNumberEntry(
Handle<SeededNumberDictionary> dictionary,
uint32_t key,
Handle<Object> value,
PropertyDetails details) {
dictionary->UpdateMaxNumberKey(key);
SLOW_ASSERT(dictionary->FindEntry(key) == kNotFound);
CALL_HEAP_FUNCTION(dictionary->GetIsolate(),
dictionary->AddNumberEntry(key, *value, details),
dictionary->Add(key, *value, details),
SeededNumberDictionary);
}
MaybeObject* SeededNumberDictionary::AddNumberEntry(uint32_t key,
Object* value,
PropertyDetails details) {
UpdateMaxNumberKey(key);
SLOW_ASSERT(this->FindEntry(key) == kNotFound);
return Add(key, value, details);
}
MaybeObject* UnseededNumberDictionary::AddNumberEntry(uint32_t key,
Object* value) {
SLOW_ASSERT(this->FindEntry(key) == kNotFound);
return Add(key, value, PropertyDetails(NONE, NORMAL, 0));
}
Handle<UnseededNumberDictionary> UnseededNumberDictionary::AddNumberEntry(
Handle<UnseededNumberDictionary> dictionary,
uint32_t key,
Handle<Object> value) {
SLOW_ASSERT(dictionary->FindEntry(key) == kNotFound);
CALL_HEAP_FUNCTION(dictionary->GetIsolate(),
dictionary->AddNumberEntry(key, *value),
dictionary->Add(
key, *value, PropertyDetails(NONE, NORMAL, 0)),
UnseededNumberDictionary);
}
......
......@@ -4199,9 +4199,6 @@ class SeededNumberDictionary
uint32_t key,
Handle<Object> value,
PropertyDetails details);
MUST_USE_RESULT MaybeObject* AddNumberEntry(uint32_t key,
Object* value,
PropertyDetails details);
// Set an existing entry or add a new one if needed.
// Return the updated dictionary.
......@@ -4249,7 +4246,6 @@ class UnseededNumberDictionary
// Type specific at put (default NONE attributes is used when adding).
MUST_USE_RESULT MaybeObject* AtNumberPut(uint32_t key, Object* value);
MUST_USE_RESULT MaybeObject* AddNumberEntry(uint32_t key, Object* value);
MUST_USE_RESULT static Handle<UnseededNumberDictionary> AddNumberEntry(
Handle<UnseededNumberDictionary> dictionary,
uint32_t key,
......
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