From 7e3fafc605d1f47dd56764d58db4a6b95a19a9e9 Mon Sep 17 00:00:00 2001 From: "ishell@chromium.org" Date: Thu, 24 Apr 2014 09:49:06 +0000 Subject: [PATCH] *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 --- src/objects.cc | 25 ++++++++----------------- src/objects.h | 4 ---- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/objects.cc b/src/objects.cc index c30e279..9f50042 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -16020,6 +16020,7 @@ MaybeObject* Dictionary::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::AddNumberEntry( Handle dictionary, uint32_t key, Handle 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::AddNumberEntry( Handle dictionary, uint32_t key, Handle 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); } diff --git a/src/objects.h b/src/objects.h index 3018fdf..dc8aa7a 100644 --- a/src/objects.h +++ b/src/objects.h @@ -4199,9 +4199,6 @@ class SeededNumberDictionary uint32_t key, Handle 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 AddNumberEntry( Handle dictionary, uint32_t key, -- 2.7.4