Fix LDC, LDC_W, and INSTANCEOF opcodes, more debugging
[jamvm-avr32-jem.git] / src / alloc.h
bloba374dffc124690150779e6a1872aaf3d4643f84e
1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007
3 * Robert Lougher <rob@lougher.org.uk>.
5 * This file is part of JamVM.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2,
10 * or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #define HEADER_SIZE sizeof(uintptr_t)
23 #define LOG_OBJECT_GRAIN 3
24 #define FLC_BIT 2
26 #define HDR_ADDRESS(obj) (uintptr_t*)(((char*)obj)-HEADER_SIZE)
28 #define clearFlcBit(obj) { \
29 uintptr_t *hdr_addr = HDR_ADDRESS(obj); \
30 *hdr_addr &= ~FLC_BIT; \
31 MBARRIER(); \
34 #define setFlcBit(obj) { \
35 uintptr_t *hdr_addr = HDR_ADDRESS(obj); \
36 *hdr_addr |= FLC_BIT; \
37 MBARRIER(); \
40 #define testFlcBit(obj) *HDR_ADDRESS(obj) & FLC_BIT