Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 : * vim: set ts=8 sts=4 et sw=4 tw=99:
3 : * This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #ifndef gc_Heap_inl_h
8 : #define gc_Heap_inl_h
9 :
10 : #include "gc/Heap.h"
11 :
12 : #include "gc/StoreBuffer.h"
13 : #include "gc/Zone.h"
14 :
15 : inline void
16 6657 : js::gc::Arena::init(JS::Zone* zoneArg, AllocKind kind)
17 : {
18 6657 : MOZ_ASSERT(firstFreeSpan.isEmpty());
19 6657 : MOZ_ASSERT(!zone);
20 6657 : MOZ_ASSERT(!allocated());
21 6657 : MOZ_ASSERT(!hasDelayedMarking);
22 6657 : MOZ_ASSERT(!allocatedDuringIncremental);
23 6657 : MOZ_ASSERT(!markOverflow);
24 6657 : MOZ_ASSERT(!auxNextLink);
25 :
26 6657 : zone = zoneArg;
27 6657 : allocKind = size_t(kind);
28 6657 : setAsFullyUnused();
29 6657 : if (zone->isAtomsZone())
30 654 : zone->runtimeFromAnyThread()->gc.atomMarking.registerArena(this);
31 : else
32 6003 : bufferedCells() = &ArenaCellSet::Empty;
33 6657 : }
34 :
35 : inline void
36 0 : js::gc::Arena::release()
37 : {
38 0 : if (zone->isAtomsZone())
39 0 : zone->runtimeFromAnyThread()->gc.atomMarking.unregisterArena(this);
40 0 : setAsNotAllocated();
41 0 : }
42 :
43 : inline js::gc::ArenaCellSet*&
44 7006 : js::gc::Arena::bufferedCells()
45 : {
46 7006 : MOZ_ASSERT(zone && !zone->isAtomsZone());
47 7006 : return bufferedCells_;
48 : }
49 :
50 : inline size_t&
51 571402 : js::gc::Arena::atomBitmapStart()
52 : {
53 571402 : MOZ_ASSERT(zone && zone->isAtomsZone());
54 571404 : return atomBitmapStart_;
55 : }
56 :
57 : #endif
|