Reviewers: Yang,

Message:
PTAL #3

Description:
*NumberDictionary::AddNumberEntry() handlified.

Please review this at https://codereview.chromium.org/249993002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+8, -21 lines):
  M src/objects.h
  M src/objects.cc


Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 0ba7859b3883baa1063843db751abca196ec8875..7e768d90c19b07cbf25e1cb543f3257e65c50840 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -16014,6 +16014,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;
@@ -16031,38 +16032,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);
 }

Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 3018fdfb48514e0e47a480570d1cbd4a8c78ad7e..dc8aa7a4a17ce58ffe99573bdfc169040bdfc185 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -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,


--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to