blob: 44ec349f23fbb9214821b41e91f4929d66b6dd6b [file] [log] [blame]
fpizlo@apple.com67791a22015-11-04 00:28:23 +00001/*
fpizlo@apple.com28c71002016-01-15 19:41:56 +00002 * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
fpizlo@apple.com67791a22015-11-04 00:28:23 +00003 *
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
ryanhaddad@apple.com22104f52016-09-28 17:08:17 +000026#pragma once
fpizlo@apple.com67791a22015-11-04 00:28:23 +000027
28#if ENABLE(B3_JIT)
29
30#include "B3Effects.h"
31#include "B3Value.h"
32
33namespace JSC { namespace B3 {
34
35class JS_EXPORT_PRIVATE CCallValue : public Value {
36public:
fpizlo@apple.com11fa0092016-09-29 18:44:53 +000037 static bool accepts(Kind kind) { return kind == CCall; }
fpizlo@apple.com67791a22015-11-04 00:28:23 +000038
39 ~CCallValue();
40
beidson@apple.combffa9032016-05-22 22:21:38 +000041 Effects effects;
fpizlo@apple.com67791a22015-11-04 00:28:23 +000042
fpizlo@apple.com8f47e9e2016-01-21 03:12:55 +000043protected:
44 Value* cloneImpl() const override;
45
fpizlo@apple.com67791a22015-11-04 00:28:23 +000046private:
47 friend class Procedure;
48
49 template<typename... Arguments>
fpizlo@apple.comdb423142016-02-02 23:21:12 +000050 CCallValue(Type type, Origin origin, Arguments... arguments)
51 : Value(CheckedOpcode, CCall, type, origin, arguments...)
beidson@apple.combffa9032016-05-22 22:21:38 +000052 , effects(Effects::forCall())
fpizlo@apple.com67791a22015-11-04 00:28:23 +000053 {
fpizlo@apple.comffa67502015-12-11 04:03:28 +000054 RELEASE_ASSERT(numChildren() >= 1);
fpizlo@apple.com67791a22015-11-04 00:28:23 +000055 }
benjamin@webkit.orga05c7bb2015-12-02 22:12:35 +000056
57 template<typename... Arguments>
fpizlo@apple.comdb423142016-02-02 23:21:12 +000058 CCallValue(Type type, Origin origin, const Effects& effects, Arguments... arguments)
59 : Value(CheckedOpcode, CCall, type, origin, arguments...)
benjamin@webkit.orgc69c2d62015-12-02 22:35:38 +000060 , effects(effects)
benjamin@webkit.orga05c7bb2015-12-02 22:12:35 +000061 {
fpizlo@apple.comffa67502015-12-11 04:03:28 +000062 RELEASE_ASSERT(numChildren() >= 1);
benjamin@webkit.orga05c7bb2015-12-02 22:12:35 +000063 }
fpizlo@apple.com67791a22015-11-04 00:28:23 +000064};
65
66} } // namespace JSC::B3
67
68#endif // ENABLE(B3_JIT)