Fix build bustage.
1 /* vim: set ts=4 sw=4 tw=99 et:
3 * Copyright (C) 2012 David Anderson
5 * This file is part of JITCraft.
7 * JITCraft is free software: you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License as published by the Free
9 * Software Foundation, either version 3 of the License, or (at your option)
12 * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with
17 * JITCraft. If not, see http://www.gnu.org/licenses/.
21 #include "RootScopes.h"
25 RootScopeManager::RootScopeManager()
32 RootScopeManager::~RootScopeManager()
34 while (blocks_ != &first_) {
35 Block *temp = blocks_;
42 RootScopeManager::grow()
44 assert(blocks_->cur == blocks_->end);
46 Block *block = new Block(blocks_);
48 // We are not prepared for this. We'll start dishing out NULL-valued
49 // ScopedRoots, and the engine generally assumes infallbility. Rather
50 // then NULL check all sorts of nodes on parse trees, or add boolean
51 // setters, for now we just abort.
52 fprintf(stderr, "Unrecoverable error: could not allocate a local root scope. Aborting!\n");
62 RootScopeManager::unwindSlow(Object **pos)
65 if (pos >= blocks_->objects && pos <= blocks_->end)
67 assert(blocks_ != &first_);
68 Block *temp = blocks_;
77 RootScopeManager::accept(VirtualObjectVisitor *visitor)
79 Block *block = blocks_;
81 for (Object **ptr = block->objects; ptr < block->cur; ptr++)