michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * vim: set ts=8 sts=4 et sw=4 tw=99: michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef jit_JitCommon_h michael@0: #define jit_JitCommon_h michael@0: michael@0: // Various macros used by all JITs, including YARR. michael@0: michael@0: #ifdef JS_ARM_SIMULATOR michael@0: #include "jit/arm/Simulator-arm.h" michael@0: michael@0: // Call into cross-jitted code by following the ABI of the simulated architecture. michael@0: #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \ michael@0: (js::jit::Simulator::Current()->call( \ michael@0: JS_FUNC_TO_DATA_PTR(uint8_t *, entry), 8, p0, p1, p2, p3, p4, p5, p6, p7) & 0xffffffff) michael@0: michael@0: #define CALL_GENERATED_YARR_CODE3(entry, p0, p1, p2) \ michael@0: js::jit::Simulator::Current()->call(JS_FUNC_TO_DATA_PTR(uint8_t *, entry), 3, p0, p1, p2) michael@0: michael@0: #define CALL_GENERATED_YARR_CODE4(entry, p0, p1, p2, p3) \ michael@0: js::jit::Simulator::Current()->call(JS_FUNC_TO_DATA_PTR(uint8_t *, entry), 4, p0, p1, p2, p3) michael@0: michael@0: #define CALL_GENERATED_ASMJS(entry, p0, p1) \ michael@0: (Simulator::Current()->call(JS_FUNC_TO_DATA_PTR(uint8_t *, entry), 2, p0, p1) & 0xffffffff) michael@0: michael@0: #else michael@0: michael@0: // Call into jitted code by following the ABI of the native architecture. michael@0: #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \ michael@0: entry(p0, p1, p2, p3, p4, p5, p6, p7) michael@0: michael@0: #define CALL_GENERATED_YARR_CODE3(entry, p0, p1, p2) \ michael@0: entry(p0, p1, p2) michael@0: michael@0: #define CALL_GENERATED_YARR_CODE4(entry, p0, p1, p2, p3) \ michael@0: entry(p0, p1, p2, p3) michael@0: michael@0: #define CALL_GENERATED_ASMJS(entry, p0, p1) \ michael@0: entry(p0, p1) michael@0: michael@0: #endif michael@0: michael@0: #endif // jit_JitCommon_h