1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit/JitCommon.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,46 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 1.5 + * vim: set ts=8 sts=4 et sw=4 tw=99: 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef jit_JitCommon_h 1.11 +#define jit_JitCommon_h 1.12 + 1.13 +// Various macros used by all JITs, including YARR. 1.14 + 1.15 +#ifdef JS_ARM_SIMULATOR 1.16 +#include "jit/arm/Simulator-arm.h" 1.17 + 1.18 +// Call into cross-jitted code by following the ABI of the simulated architecture. 1.19 +#define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \ 1.20 + (js::jit::Simulator::Current()->call( \ 1.21 + JS_FUNC_TO_DATA_PTR(uint8_t *, entry), 8, p0, p1, p2, p3, p4, p5, p6, p7) & 0xffffffff) 1.22 + 1.23 +#define CALL_GENERATED_YARR_CODE3(entry, p0, p1, p2) \ 1.24 + js::jit::Simulator::Current()->call(JS_FUNC_TO_DATA_PTR(uint8_t *, entry), 3, p0, p1, p2) 1.25 + 1.26 +#define CALL_GENERATED_YARR_CODE4(entry, p0, p1, p2, p3) \ 1.27 + js::jit::Simulator::Current()->call(JS_FUNC_TO_DATA_PTR(uint8_t *, entry), 4, p0, p1, p2, p3) 1.28 + 1.29 +#define CALL_GENERATED_ASMJS(entry, p0, p1) \ 1.30 + (Simulator::Current()->call(JS_FUNC_TO_DATA_PTR(uint8_t *, entry), 2, p0, p1) & 0xffffffff) 1.31 + 1.32 +#else 1.33 + 1.34 +// Call into jitted code by following the ABI of the native architecture. 1.35 +#define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \ 1.36 + entry(p0, p1, p2, p3, p4, p5, p6, p7) 1.37 + 1.38 +#define CALL_GENERATED_YARR_CODE3(entry, p0, p1, p2) \ 1.39 + entry(p0, p1, p2) 1.40 + 1.41 +#define CALL_GENERATED_YARR_CODE4(entry, p0, p1, p2, p3) \ 1.42 + entry(p0, p1, p2, p3) 1.43 + 1.44 +#define CALL_GENERATED_ASMJS(entry, p0, p1) \ 1.45 + entry(p0, p1) 1.46 + 1.47 +#endif 1.48 + 1.49 +#endif // jit_JitCommon_h