Basic JIT support for Records
[hiphop-php.git] / hphp / runtime / vm / method-lookup.h
blobdedb2a83cfce1b263b8b9ed721811f1e94774462
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #pragma once
19 namespace HPHP {
21 struct Func;
22 struct Class;
23 struct StringData;
24 struct ObjectData;
26 enum class CallType {
27 ClsMethod,
28 ObjMethod,
29 CtorMethod,
32 enum class LookupResult {
33 MethodFoundWithThis,
34 MethodFoundNoThis,
35 MagicCallFound,
36 MagicCallStaticFound,
37 MethodNotFound,
40 const Func* lookupMethodCtx(const Class* cls,
41 const StringData* methodName,
42 const Class* pctx,
43 CallType lookupType,
44 bool raise = false);
45 LookupResult lookupObjMethod(const Func*& f,
46 const Class* cls,
47 const StringData* methodName,
48 const Class* ctx,
49 bool raise = false);
50 LookupResult lookupClsMethod(const Func*& f,
51 const Class* cls,
52 const StringData* methodName,
53 ObjectData* this_,
54 const Class* ctx,
55 bool raise = false);
56 LookupResult lookupCtorMethod(const Func*& f,
57 const Class* cls,
58 const Class* ctx,
59 bool raise = false);