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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 // Call the slow part of scavenge object. | 548 // Call the slow part of scavenge object. |
549 return ScavengeObjectSlow(p, object); | 549 return ScavengeObjectSlow(p, object); |
550 } | 550 } |
551 | 551 |
552 | 552 |
553 bool Heap::CollectGarbage(AllocationSpace space, | 553 bool Heap::CollectGarbage(AllocationSpace space, |
554 const char* gc_reason, | 554 const char* gc_reason, |
555 const v8::GCCallbackFlags callbackFlags) { | 555 const v8::GCCallbackFlags callbackFlags) { |
556 const char* collector_reason = NULL; | 556 const char* collector_reason = NULL; |
557 GarbageCollector collector = SelectGarbageCollector(space, &collector_reason); | 557 GarbageCollector collector = SelectGarbageCollector(space, &collector_reason); |
558 return CollectGarbage( | 558 return CollectGarbage(collector, gc_reason, collector_reason, callbackFlags); |
559 space, collector, gc_reason, collector_reason, callbackFlags); | |
560 } | 559 } |
561 | 560 |
562 | 561 |
563 MaybeObject* Heap::PrepareForCompare(String* str) { | 562 MaybeObject* Heap::PrepareForCompare(String* str) { |
564 // Always flatten small strings and force flattening of long strings | 563 // Always flatten small strings and force flattening of long strings |
565 // after we have accumulated a certain amount we failed to flatten. | 564 // after we have accumulated a certain amount we failed to flatten. |
566 static const int kMaxAlwaysFlattenLength = 32; | 565 static const int kMaxAlwaysFlattenLength = 32; |
567 static const int kFlattenLongThreshold = 16*KB; | 566 static const int kFlattenLongThreshold = 16*KB; |
568 | 567 |
569 const int length = str->length(); | 568 const int length = str->length(); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 #ifdef DEBUG | 838 #ifdef DEBUG |
840 Isolate* isolate = Isolate::Current(); | 839 Isolate* isolate = Isolate::Current(); |
841 isolate->heap()->disallow_allocation_failure_ = old_state_; | 840 isolate->heap()->disallow_allocation_failure_ = old_state_; |
842 #endif | 841 #endif |
843 } | 842 } |
844 | 843 |
845 | 844 |
846 } } // namespace v8::internal | 845 } } // namespace v8::internal |
847 | 846 |
848 #endif // V8_HEAP_INL_H_ | 847 #endif // V8_HEAP_INL_H_ |
OLD | NEW |