80
Handle<NumberDictionary> Factory::NewNumberDictionary(int at_least_space_for) {
81
ASSERT(0 <= at_least_space_for);
82
CALL_HEAP_FUNCTION(isolate(),
83
NumberDictionary::Allocate(at_least_space_for),
80
Handle<SeededNumberDictionary> Factory::NewSeededNumberDictionary(
81
int at_least_space_for) {
82
ASSERT(0 <= at_least_space_for);
83
CALL_HEAP_FUNCTION(isolate(),
84
SeededNumberDictionary::Allocate(at_least_space_for),
85
SeededNumberDictionary);
89
Handle<UnseededNumberDictionary> Factory::NewUnseededNumberDictionary(
90
int at_least_space_for) {
91
ASSERT(0 <= at_least_space_for);
92
CALL_HEAP_FUNCTION(isolate(),
93
UnseededNumberDictionary::Allocate(at_least_space_for),
94
UnseededNumberDictionary);
144
Handle<AccessorPair> Factory::NewAccessorPair() {
145
CALL_HEAP_FUNCTION(isolate(),
146
isolate()->heap()->AllocateAccessorPair(),
134
151
// Symbols are created in the old generation (data space).
135
152
Handle<String> Factory::LookupSymbol(Vector<const char> string) {
136
153
CALL_HEAP_FUNCTION(isolate(),
698
715
// Allocate the function
699
716
Handle<JSFunction> function = NewFunction(name, the_hole_value());
701
// Setup the code pointer in both the shared function info and in
718
// Set up the code pointer in both the shared function info and in
702
719
// the function itself.
703
720
function->shared()->set_code(*code);
704
721
function->set_code(*code);
729
746
// Allocate the function.
730
747
Handle<JSFunction> function = NewFunction(name, prototype);
732
// Setup the code pointer in both the shared function info and in
749
// Set up the code pointer in both the shared function info and in
733
750
// the function itself.
734
751
function->shared()->set_code(*code);
735
752
function->set_code(*code);
751
768
// property that refers to the function.
752
769
SetPrototypeProperty(function, prototype);
753
770
// Currently safe because it is only invoked from Genesis.
754
SetLocalPropertyNoThrow(prototype, constructor_symbol(), function, DONT_ENUM);
771
CHECK_NOT_EMPTY_HANDLE(isolate(),
772
JSObject::SetLocalPropertyIgnoreAttributes(
773
prototype, constructor_symbol(),
774
function, DONT_ENUM));
929
Handle<JSArray> Factory::NewJSArrayWithElements(Handle<FixedArray> elements,
949
Handle<JSArray> Factory::NewJSArrayWithElements(Handle<FixedArrayBase> elements,
930
950
PretenureFlag pretenure) {
931
951
Handle<JSArray> result =
932
952
Handle<JSArray>::cast(NewJSObject(isolate()->array_function(),
954
result->set_length(Smi::FromInt(0));
934
955
SetContent(result, elements);
960
void Factory::SetElementsCapacityAndLength(Handle<JSArray> array,
963
ElementsAccessor* accessor = array->GetElementsAccessor();
964
CALL_HEAP_FUNCTION_VOID(
966
accessor->SetCapacityAndLength(*array, capacity, length));
939
970
void Factory::SetContent(Handle<JSArray> array,
940
Handle<FixedArray> elements) {
971
Handle<FixedArrayBase> elements) {
941
972
CALL_HEAP_FUNCTION_VOID(
943
974
array->SetContent(*elements));
947
void Factory::EnsureCanContainNonSmiElements(Handle<JSArray> array) {
948
CALL_HEAP_FUNCTION_VOID(
950
array->EnsureCanContainNonSmiElements());
978
void Factory::EnsureCanContainHeapObjectElements(Handle<JSArray> array) {
979
CALL_HEAP_FUNCTION_VOID(
981
array->EnsureCanContainHeapObjectElements());
985
void Factory::EnsureCanContainElements(Handle<JSArray> array,
986
Handle<FixedArrayBase> elements,
987
EnsureElementsMode mode) {
988
CALL_HEAP_FUNCTION_VOID(
990
array->EnsureCanContainElements(*elements, mode));
1044
Handle<NumberDictionary> Factory::DictionaryAtNumberPut(
1045
Handle<NumberDictionary> dictionary,
1047
Handle<Object> value) {
1048
CALL_HEAP_FUNCTION(isolate(),
1049
dictionary->AtNumberPut(key, *value),
1084
Handle<SeededNumberDictionary> Factory::DictionaryAtNumberPut(
1085
Handle<SeededNumberDictionary> dictionary,
1087
Handle<Object> value) {
1088
CALL_HEAP_FUNCTION(isolate(),
1089
dictionary->AtNumberPut(key, *value),
1090
SeededNumberDictionary);
1094
Handle<UnseededNumberDictionary> Factory::DictionaryAtNumberPut(
1095
Handle<UnseededNumberDictionary> dictionary,
1097
Handle<Object> value) {
1098
CALL_HEAP_FUNCTION(isolate(),
1099
dictionary->AtNumberPut(key, *value),
1100
UnseededNumberDictionary);