*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
This commit is contained in:
ishell@chromium.org 2014-04-24 09:59:44 +00:00
parent 7e3fafc605
commit b95ffe9067
7 changed files with 29 additions and 43 deletions

View File

@ -135,7 +135,6 @@ void CodeStub::VerifyPlatformFeatures(Isolate* isolate) {
Handle<Code> CodeStub::GetCode(Isolate* isolate) { Handle<Code> CodeStub::GetCode(Isolate* isolate) {
Factory* factory = isolate->factory();
Heap* heap = isolate->heap(); Heap* heap = isolate->heap();
Code* code; Code* code;
if (UseSpecialCache() if (UseSpecialCache()
@ -170,7 +169,7 @@ Handle<Code> CodeStub::GetCode(Isolate* isolate) {
} else { } else {
// Update the dictionary and the root in Heap. // Update the dictionary and the root in Heap.
Handle<UnseededNumberDictionary> dict = Handle<UnseededNumberDictionary> dict =
factory->DictionaryAtNumberPut( UnseededNumberDictionary::AtNumberPut(
Handle<UnseededNumberDictionary>(heap->code_stubs()), Handle<UnseededNumberDictionary>(heap->code_stubs()),
GetKey(), GetKey(),
new_object); new_object);

View File

@ -1963,26 +1963,6 @@ 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, void Factory::InitializeFunction(Handle<JSFunction> function,
Handle<SharedFunctionInfo> info, Handle<SharedFunctionInfo> info,
Handle<Context> context, Handle<Context> context,

View File

@ -607,16 +607,6 @@ class Factory V8_FINAL {
Handle<Object> script, Handle<Object> script,
Handle<Object> stack_frames); 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 #ifdef ENABLE_DEBUGGER_SUPPORT
Handle<DebugInfo> NewDebugInfo(Handle<SharedFunctionInfo> shared); Handle<DebugInfo> NewDebugInfo(Handle<SharedFunctionInfo> shared);
#endif #endif

View File

@ -16064,15 +16064,26 @@ Handle<UnseededNumberDictionary> UnseededNumberDictionary::AddNumberEntry(
} }
MaybeObject* SeededNumberDictionary::AtNumberPut(uint32_t key, Object* value) { Handle<SeededNumberDictionary> SeededNumberDictionary::AtNumberPut(
UpdateMaxNumberKey(key); Handle<SeededNumberDictionary> dictionary,
return AtPut(key, value); uint32_t key,
Handle<Object> value) {
dictionary->UpdateMaxNumberKey(key);
CALL_HEAP_FUNCTION(
dictionary->GetIsolate(),
dictionary->AtPut(key, *value),
SeededNumberDictionary);
} }
MaybeObject* UnseededNumberDictionary::AtNumberPut(uint32_t key, Handle<UnseededNumberDictionary> UnseededNumberDictionary::AtNumberPut(
Object* value) { Handle<UnseededNumberDictionary> dictionary,
return AtPut(key, value); uint32_t key,
Handle<Object> value) {
CALL_HEAP_FUNCTION(
dictionary->GetIsolate(),
dictionary->AtPut(key, *value),
UnseededNumberDictionary);
} }

View File

@ -4193,7 +4193,10 @@ class SeededNumberDictionary
} }
// Type specific at put (default NONE attributes is used when adding). // 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<SeededNumberDictionary> AtNumberPut(
Handle<SeededNumberDictionary> dictionary,
uint32_t key,
Handle<Object> value);
MUST_USE_RESULT static Handle<SeededNumberDictionary> AddNumberEntry( MUST_USE_RESULT static Handle<SeededNumberDictionary> AddNumberEntry(
Handle<SeededNumberDictionary> dictionary, Handle<SeededNumberDictionary> dictionary,
uint32_t key, uint32_t key,
@ -4245,7 +4248,10 @@ class UnseededNumberDictionary
} }
// Type specific at put (default NONE attributes is used when adding). // 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<UnseededNumberDictionary> AtNumberPut(
Handle<UnseededNumberDictionary> dictionary,
uint32_t key,
Handle<Object> value);
MUST_USE_RESULT static Handle<UnseededNumberDictionary> AddNumberEntry( MUST_USE_RESULT static Handle<UnseededNumberDictionary> AddNumberEntry(
Handle<UnseededNumberDictionary> dictionary, Handle<UnseededNumberDictionary> dictionary,
uint32_t key, uint32_t key,

View File

@ -9979,7 +9979,7 @@ class ArrayConcatVisitor {
Handle<SeededNumberDictionary> dict( Handle<SeededNumberDictionary> dict(
SeededNumberDictionary::cast(*storage_)); SeededNumberDictionary::cast(*storage_));
Handle<SeededNumberDictionary> result = Handle<SeededNumberDictionary> result =
isolate_->factory()->DictionaryAtNumberPut(dict, index, elm); SeededNumberDictionary::AtNumberPut(dict, index, elm);
if (!result.is_identical_to(dict)) { if (!result.is_identical_to(dict)) {
// Dictionary needed to grow. // Dictionary needed to grow.
clear_storage(); clear_storage();
@ -10029,7 +10029,7 @@ class ArrayConcatVisitor {
Handle<Object> element(current_storage->get(i), isolate_); Handle<Object> element(current_storage->get(i), isolate_);
if (!element->IsTheHole()) { if (!element->IsTheHole()) {
Handle<SeededNumberDictionary> new_storage = Handle<SeededNumberDictionary> new_storage =
isolate_->factory()->DictionaryAtNumberPut(slow_storage, i, element); SeededNumberDictionary::AtNumberPut(slow_storage, i, element);
if (!new_storage.is_identical_to(slow_storage)) { if (!new_storage.is_identical_to(slow_storage)) {
slow_storage = loop_scope.CloseAndEscape(new_storage); slow_storage = loop_scope.CloseAndEscape(new_storage);
} }

View File

@ -495,7 +495,7 @@ void TypeFeedbackOracle::SetInfo(TypeFeedbackId ast_id, Object* target) {
// Dictionary has been allocated with sufficient size for all elements. // Dictionary has been allocated with sufficient size for all elements.
DisallowHeapAllocation no_need_to_resize_dictionary; DisallowHeapAllocation no_need_to_resize_dictionary;
HandleScope scope(isolate()); HandleScope scope(isolate());
isolate()->factory()->DictionaryAtNumberPut( UnseededNumberDictionary::AtNumberPut(
dictionary_, IdToKey(ast_id), handle(target, isolate())); dictionary_, IdToKey(ast_id), handle(target, isolate()));
} }