From: ishell@chromium.org Date: Thu, 24 Apr 2014 09:59:44 +0000 (+0000) Subject: *NumberDictionary::AtNumberPut() handlified. X-Git-Tag: upstream/4.7.83~9461 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b95ffe90677b6b6fd2be7ed168d8ef6749f2040a;p=platform%2Fupstream%2Fv8.git *NumberDictionary::AtNumberPut() handlified. R=yangguo@chromium.org Review URL: https://codereview.chromium.org/250003002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20932 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/code-stubs.cc b/src/code-stubs.cc index 0c9f3af..b9722d1 100644 --- a/src/code-stubs.cc +++ b/src/code-stubs.cc @@ -135,7 +135,6 @@ void CodeStub::VerifyPlatformFeatures(Isolate* isolate) { Handle CodeStub::GetCode(Isolate* isolate) { - Factory* factory = isolate->factory(); Heap* heap = isolate->heap(); Code* code; if (UseSpecialCache() @@ -170,7 +169,7 @@ Handle CodeStub::GetCode(Isolate* isolate) { } else { // Update the dictionary and the root in Heap. Handle dict = - factory->DictionaryAtNumberPut( + UnseededNumberDictionary::AtNumberPut( Handle(heap->code_stubs()), GetKey(), new_object); diff --git a/src/factory.cc b/src/factory.cc index 2e405bc..36d7332 100644 --- a/src/factory.cc +++ b/src/factory.cc @@ -1963,26 +1963,6 @@ Handle Factory::NumberToString(Handle number, } -Handle Factory::DictionaryAtNumberPut( - Handle dictionary, - uint32_t key, - Handle value) { - CALL_HEAP_FUNCTION(isolate(), - dictionary->AtNumberPut(key, *value), - SeededNumberDictionary); -} - - -Handle Factory::DictionaryAtNumberPut( - Handle dictionary, - uint32_t key, - Handle value) { - CALL_HEAP_FUNCTION(isolate(), - dictionary->AtNumberPut(key, *value), - UnseededNumberDictionary); -} - - void Factory::InitializeFunction(Handle function, Handle info, Handle context, diff --git a/src/factory.h b/src/factory.h index caabac8..8549938 100644 --- a/src/factory.h +++ b/src/factory.h @@ -607,16 +607,6 @@ class Factory V8_FINAL { Handle script, Handle stack_frames); - Handle DictionaryAtNumberPut( - Handle, - uint32_t key, - Handle value); - - Handle DictionaryAtNumberPut( - Handle, - uint32_t key, - Handle value); - #ifdef ENABLE_DEBUGGER_SUPPORT Handle NewDebugInfo(Handle shared); #endif diff --git a/src/objects.cc b/src/objects.cc index 9f50042..34fdf25 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -16064,15 +16064,26 @@ Handle UnseededNumberDictionary::AddNumberEntry( } -MaybeObject* SeededNumberDictionary::AtNumberPut(uint32_t key, Object* value) { - UpdateMaxNumberKey(key); - return AtPut(key, value); +Handle SeededNumberDictionary::AtNumberPut( + Handle dictionary, + uint32_t key, + Handle value) { + dictionary->UpdateMaxNumberKey(key); + CALL_HEAP_FUNCTION( + dictionary->GetIsolate(), + dictionary->AtPut(key, *value), + SeededNumberDictionary); } -MaybeObject* UnseededNumberDictionary::AtNumberPut(uint32_t key, - Object* value) { - return AtPut(key, value); +Handle UnseededNumberDictionary::AtNumberPut( + Handle dictionary, + uint32_t key, + Handle value) { + CALL_HEAP_FUNCTION( + dictionary->GetIsolate(), + dictionary->AtPut(key, *value), + UnseededNumberDictionary); } diff --git a/src/objects.h b/src/objects.h index dc8aa7a..85807ee 100644 --- a/src/objects.h +++ b/src/objects.h @@ -4193,7 +4193,10 @@ class SeededNumberDictionary } // Type specific at put (default NONE attributes is used when adding). - MUST_USE_RESULT MaybeObject* AtNumberPut(uint32_t key, Object* value); + MUST_USE_RESULT static Handle AtNumberPut( + Handle dictionary, + uint32_t key, + Handle value); MUST_USE_RESULT static Handle AddNumberEntry( Handle dictionary, uint32_t key, @@ -4245,7 +4248,10 @@ 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 static Handle AtNumberPut( + Handle dictionary, + uint32_t key, + Handle value); MUST_USE_RESULT static Handle AddNumberEntry( Handle dictionary, uint32_t key, diff --git a/src/runtime.cc b/src/runtime.cc index b45f6e3..812d1da 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -9979,7 +9979,7 @@ class ArrayConcatVisitor { Handle dict( SeededNumberDictionary::cast(*storage_)); Handle result = - isolate_->factory()->DictionaryAtNumberPut(dict, index, elm); + SeededNumberDictionary::AtNumberPut(dict, index, elm); if (!result.is_identical_to(dict)) { // Dictionary needed to grow. clear_storage(); @@ -10029,7 +10029,7 @@ class ArrayConcatVisitor { Handle element(current_storage->get(i), isolate_); if (!element->IsTheHole()) { Handle new_storage = - isolate_->factory()->DictionaryAtNumberPut(slow_storage, i, element); + SeededNumberDictionary::AtNumberPut(slow_storage, i, element); if (!new_storage.is_identical_to(slow_storage)) { slow_storage = loop_scope.CloseAndEscape(new_storage); } diff --git a/src/type-info.cc b/src/type-info.cc index 71236f7..64a8dff 100644 --- a/src/type-info.cc +++ b/src/type-info.cc @@ -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()); - isolate()->factory()->DictionaryAtNumberPut( + UnseededNumberDictionary::AtNumberPut( dictionary_, IdToKey(ast_id), handle(target, isolate())); }