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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 return; | 525 return; |
526 } | 526 } |
527 | 527 |
528 // TODO(hpayer): temporary debugging code for issue 284577. | 528 // TODO(hpayer): temporary debugging code for issue 284577. |
529 CHECK(object->map() != object->GetHeap()->allocation_memento_map()); | 529 CHECK(object->map() != object->GetHeap()->allocation_memento_map()); |
530 // Call the slow part of scavenge object. | 530 // Call the slow part of scavenge object. |
531 return ScavengeObjectSlow(p, object); | 531 return ScavengeObjectSlow(p, object); |
532 } | 532 } |
533 | 533 |
534 | 534 |
535 MaybeObject* Heap::AllocateEmptyJSArrayWithAllocationSite( | |
536 ElementsKind elements_kind, | |
537 Handle<AllocationSite> allocation_site) { | |
538 return AllocateJSArrayAndStorageWithAllocationSite(elements_kind, 0, 0, | |
539 allocation_site, DONT_INITIALIZE_ARRAY_ELEMENTS); | |
540 } | |
541 | |
542 | |
543 bool Heap::CollectGarbage(AllocationSpace space, const char* gc_reason) { | 535 bool Heap::CollectGarbage(AllocationSpace space, const char* gc_reason) { |
544 const char* collector_reason = NULL; | 536 const char* collector_reason = NULL; |
545 GarbageCollector collector = SelectGarbageCollector(space, &collector_reason); | 537 GarbageCollector collector = SelectGarbageCollector(space, &collector_reason); |
546 return CollectGarbage(space, collector, gc_reason, collector_reason); | 538 return CollectGarbage(space, collector, gc_reason, collector_reason); |
547 } | 539 } |
548 | 540 |
549 | 541 |
550 MaybeObject* Heap::PrepareForCompare(String* str) { | 542 MaybeObject* Heap::PrepareForCompare(String* str) { |
551 // Always flatten small strings and force flattening of long strings | 543 // Always flatten small strings and force flattening of long strings |
552 // after we have accumulated a certain amount we failed to flatten. | 544 // after we have accumulated a certain amount we failed to flatten. |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 #ifdef DEBUG | 881 #ifdef DEBUG |
890 Isolate* isolate = Isolate::Current(); | 882 Isolate* isolate = Isolate::Current(); |
891 isolate->heap()->disallow_allocation_failure_ = old_state_; | 883 isolate->heap()->disallow_allocation_failure_ = old_state_; |
892 #endif | 884 #endif |
893 } | 885 } |
894 | 886 |
895 | 887 |
896 } } // namespace v8::internal | 888 } } // namespace v8::internal |
897 | 889 |
898 #endif // V8_HEAP_INL_H_ | 890 #endif // V8_HEAP_INL_H_ |
OLD | NEW |