Handle<Code> CodeStub::GetCode(Isolate* isolate) {
- Factory* factory = isolate->factory();
Heap* heap = isolate->heap();
Code* code;
if (UseSpecialCache()
} else {
// Update the dictionary and the root in Heap.
Handle<UnseededNumberDictionary> dict =
- factory->DictionaryAtNumberPut(
+ UnseededNumberDictionary::AtNumberPut(
Handle<UnseededNumberDictionary>(heap->code_stubs()),
GetKey(),
new_object);
}
-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,
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
}
-MaybeObject* SeededNumberDictionary::AtNumberPut(uint32_t key, Object* value) {
- UpdateMaxNumberKey(key);
- return AtPut(key, value);
+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* UnseededNumberDictionary::AtNumberPut(uint32_t key,
- Object* value) {
- 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);
}
}
// 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(
Handle<SeededNumberDictionary> dictionary,
uint32_t key,
}
// 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(
Handle<UnseededNumberDictionary> dictionary,
uint32_t key,
Handle<SeededNumberDictionary> dict(
SeededNumberDictionary::cast(*storage_));
Handle<SeededNumberDictionary> result =
- isolate_->factory()->DictionaryAtNumberPut(dict, index, elm);
+ SeededNumberDictionary::AtNumberPut(dict, index, elm);
if (!result.is_identical_to(dict)) {
// Dictionary needed to grow.
clear_storage();
Handle<Object> element(current_storage->get(i), isolate_);
if (!element->IsTheHole()) {
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)) {
slow_storage = loop_scope.CloseAndEscape(new_storage);
}
// 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()));
}