1/* 2 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#include "config.h" 27#include "FTLCommonValues.h" 28 29#if ENABLE(FTL_JIT) 30 31namespace JSC { namespace FTL { 32 33CommonValues::CommonValues(LContext context) 34 : voidType(FTL::voidType(context)) 35 , boolean(int1Type(context)) 36 , int8(int8Type(context)) 37 , int16(int16Type(context)) 38 , int32(int32Type(context)) 39 , int64(int64Type(context)) 40 , intPtr(intPtrType(context)) 41 , floatType(FTL::floatType(context)) 42 , doubleType(FTL::doubleType(context)) 43 , ref8(pointerType(int8)) 44 , ref16(pointerType(int16)) 45 , ref32(pointerType(int32)) 46 , ref64(pointerType(int64)) 47 , refPtr(pointerType(intPtr)) 48 , refFloat(pointerType(floatType)) 49 , refDouble(pointerType(doubleType)) 50 , booleanTrue(constInt(boolean, true, ZeroExtend)) 51 , booleanFalse(constInt(boolean, false, ZeroExtend)) 52 , int8Zero(constInt(int8, 0, SignExtend)) 53 , int32Zero(constInt(int32, 0, SignExtend)) 54 , int32One(constInt(int32, 1, SignExtend)) 55 , int64Zero(constInt(int64, 0, SignExtend)) 56 , intPtrZero(constInt(intPtr, 0, SignExtend)) 57 , intPtrOne(constInt(intPtr, 1, SignExtend)) 58 , intPtrTwo(constInt(intPtr, 2, SignExtend)) 59 , intPtrThree(constInt(intPtr, 3, SignExtend)) 60 , intPtrFour(constInt(intPtr, 4, SignExtend)) 61 , intPtrEight(constInt(intPtr, 8, SignExtend)) 62 , intPtrPtr(constInt(intPtr, sizeof(void*), SignExtend)) 63 , doubleZero(constReal(doubleType, 0)) 64 , rangeKind(mdKindID(context, "range")) 65 , profKind(mdKindID(context, "prof")) 66 , branchWeights(mdString(context, "branch_weights")) 67 , nonNegativeInt32(constInt(int32, 0, SignExtend), constInt(int32, 1ll << 31, SignExtend)) 68 , m_context(context) 69 , m_module(0) 70{ 71} 72 73} } // namespace JSC::FTL 74 75#endif // ENABLE(FTL_JIT) 76 77