Lines Matching full:heap
36 #include "heap-profiler.h"
179 return isolate->heap()->undefined_value(); // Make compiler happy.
184 return isolate->heap()->undefined_value();
191 Heap* heap = isolate->heap();
200 array->set_elements(heap->empty_fixed_array());
210 MaybeObject* maybe_obj = heap->AllocateJSObject(constructor);
222 { MaybeObject* maybe_obj = heap->AllocateFixedArrayWithHoles(len);
254 maybe_elms = heap->AllocateUninitializedFixedDoubleArray(
257 maybe_elms = heap->AllocateFixedArrayWithHoles(number_of_elements);
314 static void MoveElements(Heap* heap,
322 ASSERT(dst->map() != HEAP->fixed_cow_array_map());
328 heap->RecordWrites(dst->address(), dst->OffsetOfElementAt(dst_index), len);
330 heap->incremental_marking()->RecordWrites(dst);
334 static void FillWithHoles(Heap* heap, FixedArray* dst, int from, int to) {
335 ASSERT(dst->map() != heap->fixed_cow_array_map());
336 MemsetPointer(dst->data_start() + from, heap->the_hole_value(), to - from);
340 static FixedArray* LeftTrimFixedArray(Heap* heap,
343 ASSERT(elms->map() != HEAP->fixed_cow_array_map());
347 ASSERT(!HEAP->lo_space()->Contains(elms));
358 !heap->new_space()->Contains(elms)) {
369 // debug mode which iterates through the heap), but to play safer
371 heap->CreateFillerObjectAt(elms->address(), to_trim * kPointerSize);
373 former_start[to_trim] = heap->fixed_array_map();
379 if (heap->marking()->TransferMark(elms->address(),
384 HEAP_PROFILE(heap, ObjectMoveEvent(elms->address(),
391 static bool ArrayPrototypeHasNoElements(Heap* heap,
396 if (array_proto->elements() != heap->empty_fixed_array()) return false;
399 if (proto == heap->null_value()) return false;
402 if (array_proto->elements() != heap->empty_fixed_array()) return false;
409 Heap* heap, Object* receiver, Arguments* args, int first_added_arg) {
414 if (map == heap->fixed_array_map()) {
417 ASSERT(elms == heap->empty_fixed_array());
423 } else if (map == heap->fixed_cow_array_map()) {
448 static inline bool IsJSArrayFastElementMovingAllowed(Heap* heap,
451 Context* global_context = heap->isolate()->context()->global_context();
455 ArrayPrototypeHasNoElements(heap, global_context, array_proto);
486 Heap* heap = isolate->heap();
490 EnsureJSArrayWithWritableFastElements(heap, receiver, &args, 1);
514 { MaybeObject* maybe_obj = heap->AllocateUninitializedFixedArray(capacity);
521 FillWithHoles(heap, new_elms, new_length, capacity);
544 Heap* heap = isolate->heap();
548 EnsureJSArrayWithWritableFastElements(heap, receiver, NULL, 0);
556 if (len == 0) return heap->undefined_value();
577 Heap* heap = isolate->heap();
581 EnsureJSArrayWithWritableFastElements(heap, receiver, NULL, 0);
586 if (!IsJSArrayFastElementMovingAllowed(heap, JSArray::cast(receiver))) {
594 if (len == 0) return heap->undefined_value();
599 first = heap->undefined_value();
602 if (!heap->lo_space()->Contains(elms)) {
603 array->set_elements(LeftTrimFixedArray(heap, elms, 1));
607 MoveElements(heap, &no_gc, elms, 0, elms, 1, len - 1);
608 elms->set(len - 1, heap->the_hole_value());
619 Heap* heap = isolate->heap();
623 EnsureJSArrayWithWritableFastElements(heap, receiver, NULL, 0);
628 if (!IsJSArrayFastElementMovingAllowed(heap, JSArray::cast(receiver))) {
651 { MaybeObject* maybe_obj = heap->AllocateUninitializedFixedArray(capacity);
657 FillWithHoles(heap, new_elms, new_length, capacity);
662 MoveElements(heap, &no_gc, elms, to_add, elms, 0, len);
679 Heap* heap = isolate->heap();
686 !IsJSArrayFastElementMovingAllowed(heap, array)) {
707 ->InObjectPropertyAt(Heap::kArgumentsLengthIndex);
716 if (elms->get(i) == heap->the_hole_value()) {
760 heap->AllocateJSArrayAndStorage(elements_kind,
775 Heap* heap = isolate->heap();
779 EnsureJSArrayWithWritableFastElements(heap, receiver, &args, 3);
784 if (!IsJSArrayFastElementMovingAllowed(heap, JSArray::cast(receiver))) {
833 heap->AllocateJSArrayAndStorage(elements_kind,
851 const bool trim_array = !heap->lo_space()->Contains(elms) &&
859 MoveElements(heap, &no_gc, elms, delta, elms, 0, actual_start);
862 elms = LeftTrimFixedArray(heap, elms, delta);
867 MoveElements(heap, &no_gc,
871 FillWithHoles(heap, elms, new_length, len);
884 heap->AllocateUninitializedFixedArray(capacity);
900 FillWithHoles(heap, new_elms, new_length, capacity);
906 MoveElements(heap, &no_gc,
931 Heap* heap = isolate->heap();
935 if (!ArrayPrototypeHasNoElements(heap, global_context, array_proto)) {
972 heap->AllocateJSArrayAndStorage(elements_kind,
1011 // with this receiver. Returns Heap::null_value() if the call is
1016 static inline Object* TypeCheck(Heap* heap,
1022 if (!recv->IsJSObject()) return heap->null_value();
1031 for (; holder != heap->null_value(); holder = holder->GetPrototype()) {
1036 if (holder == heap->null_value()) return holder;
1049 for (; current != heap->null_value(); current = current->GetPrototype()) {
1055 if (current == heap->null_value()) *arg = heap->undefined_value();
1065 Heap* heap = isolate->heap();
1082 Object* raw_holder = TypeCheck(heap, args.length(), &args[0], fun_data);
1123 result = heap->undefined_value();
1165 Heap* heap = isolate->heap();
1198 result = heap->undefined_value();
1218 Heap* heap = isolate->heap();
1261 result = heap->undefined_value();
1637 Heap* heap = isolate->heap();
1662 // Move the code into the object heap.
1672 heap->CreateCode(desc, flags, masm.CodeObject());