OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HEAP_HEAP_INL_H_ | 5 #ifndef V8_HEAP_HEAP_INL_H_ |
6 #define V8_HEAP_HEAP_INL_H_ | 6 #define V8_HEAP_HEAP_INL_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 const v8::GCCallbackFlags callbackFlags) { | 580 const v8::GCCallbackFlags callbackFlags) { |
581 const char* collector_reason = NULL; | 581 const char* collector_reason = NULL; |
582 GarbageCollector collector = SelectGarbageCollector(space, &collector_reason); | 582 GarbageCollector collector = SelectGarbageCollector(space, &collector_reason); |
583 return CollectGarbage(collector, gc_reason, collector_reason, callbackFlags); | 583 return CollectGarbage(collector, gc_reason, collector_reason, callbackFlags); |
584 } | 584 } |
585 | 585 |
586 | 586 |
587 Isolate* Heap::isolate() { | 587 Isolate* Heap::isolate() { |
588 return reinterpret_cast<Isolate*>( | 588 return reinterpret_cast<Isolate*>( |
589 reinterpret_cast<intptr_t>(this) - | 589 reinterpret_cast<intptr_t>(this) - |
590 reinterpret_cast<size_t>(reinterpret_cast<Isolate*>(4)->heap()) + 4); | 590 reinterpret_cast<size_t>(reinterpret_cast<Isolate*>(16)->heap()) + 16); |
591 } | 591 } |
592 | 592 |
593 | 593 |
594 // Calls the FUNCTION_CALL function and retries it up to three times | 594 // Calls the FUNCTION_CALL function and retries it up to three times |
595 // to guarantee that any allocations performed during the call will | 595 // to guarantee that any allocations performed during the call will |
596 // succeed if there's enough memory. | 596 // succeed if there's enough memory. |
597 | 597 |
598 // Warning: Do not use the identifiers __object__, __maybe_object__ or | 598 // Warning: Do not use the identifiers __object__, __maybe_object__ or |
599 // __scope__ in a call to this macro. | 599 // __scope__ in a call to this macro. |
600 | 600 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 | 769 |
770 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 770 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
771 for (Object** current = start; current < end; current++) { | 771 for (Object** current = start; current < end; current++) { |
772 CHECK((*current)->IsSmi()); | 772 CHECK((*current)->IsSmi()); |
773 } | 773 } |
774 } | 774 } |
775 } | 775 } |
776 } // namespace v8::internal | 776 } // namespace v8::internal |
777 | 777 |
778 #endif // V8_HEAP_HEAP_INL_H_ | 778 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |