diff -r 32ad0523b309 -r f8ac2633b4e3 jitcraft/Structures.cpp --- a/jitcraft/Structures.cpp Tue Jul 24 23:53:34 2012 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* vim: set ts=4 sw=4 tw=99 et - * - * Copyright (C) 2012 David Anderson - * - * This file is part of JITCraft. - * - * JITCraft is free software: you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. - * - * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * JITCraft. If not, see http://www.gnu.org/licenses/. - */ -#include "Structures.h" -#include "Types.h" - -using namespace ke; - -StructureBufferBuilder::StructureBufferBuilder() - : size_(0) -{ -} - -bool -StructureBufferBuilder::add(Handle type, unsigned *offset) -{ - *offset = size_; - - if (!type->isTraceable()) { - // For now, assume the size of primitives is 4-byte. - assert(type->isInt32() || type->isFloat()); - size_ += 4; - return true; - } - - if (!offsets_.append(size_)) - return false; - - size_ += sizeof(Object *); - return true; -}