summaryrefslogtreecommitdiffstats
path: root/js/src/gdb/tests/test-ExecutableAllocator.cpp
blob: 7cb7ad364ca46633e8d653770c2ebd3edb7f12e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "gdb-tests.h"
#include "jsapi.h"

#include "jscntxt.h"

#include "jit/ExecutableAllocator.h"

FRAGMENT(ExecutableAllocator, empty) {
    using namespace js::jit;
    ExecutableAllocator execAlloc(cx->runtime());

    breakpoint();

    (void) execAlloc;
}

FRAGMENT(ExecutableAllocator, onepool) {
    using namespace js::jit;
    ExecutablePool* pool = nullptr;
    ExecutableAllocator execAlloc(cx->runtime());
    execAlloc.alloc(16 * 1024, &pool, BASELINE_CODE);

    breakpoint();

    (void) pool;
    (void) execAlloc;
}

FRAGMENT(ExecutableAllocator, twopools) {
    using namespace js::jit;
    ExecutablePool* init = nullptr;
    ExecutablePool* pool = nullptr;
    ExecutableAllocator execAlloc(cx->runtime());

    execAlloc.alloc(16 * 1024, &init, BASELINE_CODE);

    do { // Keep allocating until we get a second pool.
        execAlloc.alloc(32 * 1024, &pool, ION_CODE);
    } while (pool == init);

    breakpoint();

    (void) execAlloc;
}