/*
 * Copyright (C) 2008, 2013 Apple Inc. All rights reserved.
 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1.  Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 * 2.  Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
 *     its contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef JITStubs_h
#define JITStubs_h

#include "CallData.h"
#include "Intrinsic.h"
#include "JITExceptions.h"
#include "LowLevelInterpreter.h"
#include "MacroAssemblerCodeRef.h"
#include "Register.h"

namespace JSC {

#if ENABLE(JIT)

struct StructureStubInfo;

class ArrayAllocationProfile;
class CodeBlock;
class ExecutablePool;
class FunctionExecutable;
class Identifier;
class VM;
class JSGlobalObject;
class JSObject;
class JSPropertyNameIterator;
class JSStack;
class JSValue;
class JSValueEncodedAsPointer;
class LegacyProfiler;
class NativeExecutable;
class PropertySlot;
class PutPropertySlot;
class RegExp;
class Structure;

#define STUB_ARGS_DECLARATION void** args
#define STUB_ARGS (args)

#if CPU(X86)
#if COMPILER(MSVC)
#define JIT_STUB __fastcall
#elif COMPILER(GCC)
#define JIT_STUB  __attribute__ ((fastcall))
#elif COMPILER(SUNCC)
#define JIT_STUB
#else
#error "JIT_STUB function calls require fastcall conventions on x86, add appropriate directive/attribute here for your compiler!"
#endif
#else
#define JIT_STUB
#endif

extern "C" void ctiOpThrowNotCaught();
extern "C" EncodedJSValue ctiTrampoline(void* code, JSStack*, CallFrame*, void* /*unused1*/, void* /*unused2*/, VM*);

#if USE(MASM_PROBE)
extern "C" void ctiMasmProbeTrampoline();
#endif

#endif // ENABLE(JIT)

} // namespace JSC

#endif // JITStubs_h
