OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4555 reinterpret_cast<FixedDoubleArray*>(result)->set_map_no_write_barrier( | 4555 reinterpret_cast<FixedDoubleArray*>(result)->set_map_no_write_barrier( |
4556 fixed_double_array_map()); | 4556 fixed_double_array_map()); |
4557 reinterpret_cast<FixedDoubleArray*>(result)->set_length(0); | 4557 reinterpret_cast<FixedDoubleArray*>(result)->set_length(0); |
4558 return result; | 4558 return result; |
4559 } | 4559 } |
4560 | 4560 |
4561 | 4561 |
4562 MaybeObject* Heap::AllocateUninitializedFixedDoubleArray( | 4562 MaybeObject* Heap::AllocateUninitializedFixedDoubleArray( |
4563 int length, | 4563 int length, |
4564 PretenureFlag pretenure) { | 4564 PretenureFlag pretenure) { |
4565 if (length == 0) return empty_fixed_double_array(); | 4565 if (length == 0) return empty_fixed_array(); |
4566 | 4566 |
4567 Object* elements_object; | 4567 Object* elements_object; |
4568 MaybeObject* maybe_obj = AllocateRawFixedDoubleArray(length, pretenure); | 4568 MaybeObject* maybe_obj = AllocateRawFixedDoubleArray(length, pretenure); |
4569 if (!maybe_obj->ToObject(&elements_object)) return maybe_obj; | 4569 if (!maybe_obj->ToObject(&elements_object)) return maybe_obj; |
4570 FixedDoubleArray* elements = | 4570 FixedDoubleArray* elements = |
4571 reinterpret_cast<FixedDoubleArray*>(elements_object); | 4571 reinterpret_cast<FixedDoubleArray*>(elements_object); |
4572 | 4572 |
4573 elements->set_map_no_write_barrier(fixed_double_array_map()); | 4573 elements->set_map_no_write_barrier(fixed_double_array_map()); |
4574 elements->set_length(length); | 4574 elements->set_length(length); |
4575 return elements; | 4575 return elements; |
4576 } | 4576 } |
4577 | 4577 |
4578 | 4578 |
4579 MaybeObject* Heap::AllocateFixedDoubleArrayWithHoles( | 4579 MaybeObject* Heap::AllocateFixedDoubleArrayWithHoles( |
4580 int length, | 4580 int length, |
4581 PretenureFlag pretenure) { | 4581 PretenureFlag pretenure) { |
4582 if (length == 0) return empty_fixed_double_array(); | 4582 if (length == 0) return empty_fixed_array(); |
4583 | 4583 |
4584 Object* elements_object; | 4584 Object* elements_object; |
4585 MaybeObject* maybe_obj = AllocateRawFixedDoubleArray(length, pretenure); | 4585 MaybeObject* maybe_obj = AllocateRawFixedDoubleArray(length, pretenure); |
4586 if (!maybe_obj->ToObject(&elements_object)) return maybe_obj; | 4586 if (!maybe_obj->ToObject(&elements_object)) return maybe_obj; |
4587 FixedDoubleArray* elements = | 4587 FixedDoubleArray* elements = |
4588 reinterpret_cast<FixedDoubleArray*>(elements_object); | 4588 reinterpret_cast<FixedDoubleArray*>(elements_object); |
4589 | 4589 |
4590 for (int i = 0; i < length; ++i) { | 4590 for (int i = 0; i < length; ++i) { |
4591 elements->set_the_hole(i); | 4591 elements->set_the_hole(i); |
4592 } | 4592 } |
(...skipping 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6881 isolate_->heap()->store_buffer()->Compact(); | 6881 isolate_->heap()->store_buffer()->Compact(); |
6882 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); | 6882 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); |
6883 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { | 6883 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { |
6884 next = chunk->next_chunk(); | 6884 next = chunk->next_chunk(); |
6885 isolate_->memory_allocator()->Free(chunk); | 6885 isolate_->memory_allocator()->Free(chunk); |
6886 } | 6886 } |
6887 chunks_queued_for_free_ = NULL; | 6887 chunks_queued_for_free_ = NULL; |
6888 } | 6888 } |
6889 | 6889 |
6890 } } // namespace v8::internal | 6890 } } // namespace v8::internal |
OLD | NEW |