Revert "*NumberDictionary::AtNumberPut() handlified."
authorishell@chromium.org <ishell@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 24 Apr 2014 10:17:10 +0000 (10:17 +0000)
committerishell@chromium.org <ishell@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 24 Apr 2014 10:17:10 +0000 (10:17 +0000)
This reverts commit r20932 for breaking Mac build.

TBR=yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20933 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/code-stubs.cc
src/factory.cc
src/factory.h
src/objects.cc
src/objects.h
src/runtime.cc
src/type-info.cc

index b9722d1..0c9f3af 100644 (file)
@@ -135,6 +135,7 @@ void CodeStub::VerifyPlatformFeatures(Isolate* isolate) {
 
 
 Handle<Code> CodeStub::GetCode(Isolate* isolate) {
+  Factory* factory = isolate->factory();
   Heap* heap = isolate->heap();
   Code* code;
   if (UseSpecialCache()
@@ -169,7 +170,7 @@ Handle<Code> CodeStub::GetCode(Isolate* isolate) {
     } else {
       // Update the dictionary and the root in Heap.
       Handle<UnseededNumberDictionary> dict =
-          UnseededNumberDictionary::AtNumberPut(
+          factory->DictionaryAtNumberPut(
               Handle<UnseededNumberDictionary>(heap->code_stubs()),
               GetKey(),
               new_object);
index 36d7332..2e405bc 100644 (file)
@@ -1963,6 +1963,26 @@ Handle<String> Factory::NumberToString(Handle<Object> number,
 }
 
 
+Handle<SeededNumberDictionary> Factory::DictionaryAtNumberPut(
+    Handle<SeededNumberDictionary> dictionary,
+    uint32_t key,
+    Handle<Object> value) {
+  CALL_HEAP_FUNCTION(isolate(),
+                     dictionary->AtNumberPut(key, *value),
+                     SeededNumberDictionary);
+}
+
+
+Handle<UnseededNumberDictionary> Factory::DictionaryAtNumberPut(
+    Handle<UnseededNumberDictionary> dictionary,
+    uint32_t key,
+    Handle<Object> value) {
+  CALL_HEAP_FUNCTION(isolate(),
+                     dictionary->AtNumberPut(key, *value),
+                     UnseededNumberDictionary);
+}
+
+
 void Factory::InitializeFunction(Handle<JSFunction> function,
                                  Handle<SharedFunctionInfo> info,
                                  Handle<Context> context,
index 8549938..caabac8 100644 (file)
@@ -607,6 +607,16 @@ class Factory V8_FINAL {
       Handle<Object> script,
       Handle<Object> stack_frames);
 
+  Handle<SeededNumberDictionary> DictionaryAtNumberPut(
+      Handle<SeededNumberDictionary>,
+      uint32_t key,
+      Handle<Object> value);
+
+  Handle<UnseededNumberDictionary> DictionaryAtNumberPut(
+      Handle<UnseededNumberDictionary>,
+      uint32_t key,
+      Handle<Object> value);
+
 #ifdef ENABLE_DEBUGGER_SUPPORT
   Handle<DebugInfo> NewDebugInfo(Handle<SharedFunctionInfo> shared);
 #endif
index 34fdf25..9f50042 100644 (file)
@@ -16064,26 +16064,15 @@ Handle<UnseededNumberDictionary> UnseededNumberDictionary::AddNumberEntry(
 }
 
 
-Handle<SeededNumberDictionary> SeededNumberDictionary::AtNumberPut(
-    Handle<SeededNumberDictionary> dictionary,
-    uint32_t key,
-    Handle<Object> value) {
-  dictionary->UpdateMaxNumberKey(key);
-  CALL_HEAP_FUNCTION(
-      dictionary->GetIsolate(),
-      dictionary->AtPut(key, *value),
-      SeededNumberDictionary);
+MaybeObject* SeededNumberDictionary::AtNumberPut(uint32_t key, Object* value) {
+  UpdateMaxNumberKey(key);
+  return AtPut(key, value);
 }
 
 
-Handle<UnseededNumberDictionary> UnseededNumberDictionary::AtNumberPut(
-    Handle<UnseededNumberDictionary> dictionary,
-    uint32_t key,
-    Handle<Object> value) {
-  CALL_HEAP_FUNCTION(
-      dictionary->GetIsolate(),
-      dictionary->AtPut(key, *value),
-      UnseededNumberDictionary);
+MaybeObject* UnseededNumberDictionary::AtNumberPut(uint32_t key,
+                                                   Object* value) {
+  return AtPut(key, value);
 }
 
 
index 85807ee..dc8aa7a 100644 (file)
@@ -4193,10 +4193,7 @@ class SeededNumberDictionary
   }
 
   // Type specific at put (default NONE attributes is used when adding).
-  MUST_USE_RESULT static Handle<SeededNumberDictionary> AtNumberPut(
-      Handle<SeededNumberDictionary> dictionary,
-      uint32_t key,
-      Handle<Object> value);
+  MUST_USE_RESULT MaybeObject* AtNumberPut(uint32_t key, Object* value);
   MUST_USE_RESULT static Handle<SeededNumberDictionary> AddNumberEntry(
       Handle<SeededNumberDictionary> dictionary,
       uint32_t key,
@@ -4248,10 +4245,7 @@ class UnseededNumberDictionary
   }
 
   // Type specific at put (default NONE attributes is used when adding).
-  MUST_USE_RESULT static Handle<UnseededNumberDictionary> AtNumberPut(
-      Handle<UnseededNumberDictionary> dictionary,
-      uint32_t key,
-      Handle<Object> value);
+  MUST_USE_RESULT MaybeObject* AtNumberPut(uint32_t key, Object* value);
   MUST_USE_RESULT static Handle<UnseededNumberDictionary> AddNumberEntry(
       Handle<UnseededNumberDictionary> dictionary,
       uint32_t key,
index 812d1da..b45f6e3 100644 (file)
@@ -9979,7 +9979,7 @@ class ArrayConcatVisitor {
     Handle<SeededNumberDictionary> dict(
         SeededNumberDictionary::cast(*storage_));
     Handle<SeededNumberDictionary> result =
-        SeededNumberDictionary::AtNumberPut(dict, index, elm);
+        isolate_->factory()->DictionaryAtNumberPut(dict, index, elm);
     if (!result.is_identical_to(dict)) {
       // Dictionary needed to grow.
       clear_storage();
@@ -10029,7 +10029,7 @@ class ArrayConcatVisitor {
       Handle<Object> element(current_storage->get(i), isolate_);
       if (!element->IsTheHole()) {
         Handle<SeededNumberDictionary> new_storage =
-            SeededNumberDictionary::AtNumberPut(slow_storage, i, element);
+          isolate_->factory()->DictionaryAtNumberPut(slow_storage, i, element);
         if (!new_storage.is_identical_to(slow_storage)) {
           slow_storage = loop_scope.CloseAndEscape(new_storage);
         }
index 64a8dff..71236f7 100644 (file)
@@ -495,7 +495,7 @@ void TypeFeedbackOracle::SetInfo(TypeFeedbackId ast_id, Object* target) {
   // Dictionary has been allocated with sufficient size for all elements.
   DisallowHeapAllocation no_need_to_resize_dictionary;
   HandleScope scope(isolate());
-  UnseededNumberDictionary::AtNumberPut(
+  isolate()->factory()->DictionaryAtNumberPut(
       dictionary_, IdToKey(ast_id), handle(target, isolate()));
 }