Add postinc-ref test.
2 * Copyright (C) 2012 David Anderson
4 * This file is part of JITCraft.
6 * JITCraft is free software: you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License as published by the Free
8 * Software Foundation, either version 3 of the License, or (at your option)
11 * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * JITCraft. If not, see http://www.gnu.org/licenses/.
18 #ifndef _include_jc_module_h_
19 #define _include_jc_module_h_
23 #include "Functions.h"
30 class Module : public Object
32 Barriered<String> file_;
33 Barriered<Code> code_;
34 Barriered<Struct> globals_;
35 void *nativeIdentity_;
38 static Module *New(Zone *zone);
50 void setPath(Handle<String> path) {
53 void setCode(Handle<Code> code) {
56 void setGlobals(Handle<Struct> globals) {
60 void *nativeIdentity() {
61 return nativeIdentity_;
63 void setNativeIdentity(void *identity) {
64 nativeIdentity_ = identity;
67 // Begin GC Descriptor.
68 static inline size_t offsetOfFile() {
69 return OFFSETOF(Module, file_);
71 static inline size_t offsetOfCode() {
72 return OFFSETOF(Module, code_);
74 static inline size_t offsetOfGlobals() {
75 return OFFSETOF(Module, globals_);
79 static inline Module *cast(Object *obj) {
80 assert(!obj || obj->is(MapKind_Module));
81 return reinterpret_cast<Module *>(obj);
87 #endif // _include_jc_module_h_