Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
dart-lang
sdk
runtime
lib
invocation_mirror.h
Go to the documentation of this file.
1
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2
// for details. All rights reserved. Use of this source code is governed by a
3
// BSD-style license that can be found in the LICENSE file.
4
5
#ifndef RUNTIME_LIB_INVOCATION_MIRROR_H_
6
#define RUNTIME_LIB_INVOCATION_MIRROR_H_
7
8
#include "
vm/allocation.h
"
9
10
namespace
dart
{
11
12
class
InvocationMirror
:
public
AllStatic
{
13
public
:
14
// These enum correspond to the constants in invocation_mirror_patch.dart.
15
// It is used to communicate the reason for statically thrown
16
// NoSuchMethodErrors by the compiler.
17
enum
Kind
{
18
// Constants describing the invocation type.
19
// kField cannot be generated by regular invocation mirrors.
20
kMethod
= 0,
21
kGetter
= 1,
22
kSetter
= 2,
23
kField
= 3,
24
kLocalVar
= 4,
25
kKindShift
= 0,
26
kKindBits
= 3,
27
kKindMask
= (1 <<
kKindBits
) - 1
28
};
29
30
enum
Level
{
31
// These values, except kDynamic and kSuper, are only used when throwing
32
// NoSuchMethodError for compile-time resolution failures.
33
kDynamic
= 0,
34
kSuper
= 1,
35
kStatic
= 2,
36
kConstructor
= 3,
37
kTopLevel
= 4,
38
kLevelShift
=
kKindBits
,
39
kLevelBits
= 3,
40
kLevelMask
= (1 <<
kLevelBits
) - 1
41
};
42
43
static
int
EncodeType
(
Level
level,
Kind
kind) {
44
return
(level <<
kLevelShift
) | kind;
45
}
46
47
static
void
DecodeType
(
int
type
,
Level
* level,
Kind
* kind) {
48
*level =
static_cast<
Level
>
(
type
>>
kLevelShift
);
49
*kind =
static_cast<
Kind
>
(
type
&
kKindMask
);
50
}
51
};
52
53
}
// namespace dart
54
55
#endif
// RUNTIME_LIB_INVOCATION_MIRROR_H_
dart::AllStatic
Definition
allocation.h:33
dart::InvocationMirror
Definition
invocation_mirror.h:12
dart::InvocationMirror::DecodeType
static void DecodeType(int type, Level *level, Kind *kind)
Definition
invocation_mirror.h:47
dart::InvocationMirror::Kind
Kind
Definition
invocation_mirror.h:17
dart::InvocationMirror::kKindBits
@ kKindBits
Definition
invocation_mirror.h:26
dart::InvocationMirror::kLocalVar
@ kLocalVar
Definition
invocation_mirror.h:24
dart::InvocationMirror::kGetter
@ kGetter
Definition
invocation_mirror.h:21
dart::InvocationMirror::kKindMask
@ kKindMask
Definition
invocation_mirror.h:27
dart::InvocationMirror::kField
@ kField
Definition
invocation_mirror.h:23
dart::InvocationMirror::kSetter
@ kSetter
Definition
invocation_mirror.h:22
dart::InvocationMirror::kMethod
@ kMethod
Definition
invocation_mirror.h:20
dart::InvocationMirror::kKindShift
@ kKindShift
Definition
invocation_mirror.h:25
dart::InvocationMirror::EncodeType
static int EncodeType(Level level, Kind kind)
Definition
invocation_mirror.h:43
dart::InvocationMirror::Level
Level
Definition
invocation_mirror.h:30
dart::InvocationMirror::kTopLevel
@ kTopLevel
Definition
invocation_mirror.h:37
dart::InvocationMirror::kConstructor
@ kConstructor
Definition
invocation_mirror.h:36
dart::InvocationMirror::kDynamic
@ kDynamic
Definition
invocation_mirror.h:33
dart::InvocationMirror::kLevelBits
@ kLevelBits
Definition
invocation_mirror.h:39
dart::InvocationMirror::kSuper
@ kSuper
Definition
invocation_mirror.h:34
dart::InvocationMirror::kLevelShift
@ kLevelShift
Definition
invocation_mirror.h:38
dart::InvocationMirror::kStatic
@ kStatic
Definition
invocation_mirror.h:35
dart::InvocationMirror::kLevelMask
@ kLevelMask
Definition
invocation_mirror.h:40
type
uint8_t type
Definition
fl_standard_message_codec_test.cc:1115
dart
Definition
dart_vm.cc:33
allocation.h
Generated on Fri Apr 26 2024 06:14:44 for Flutter Engine by
1.9.8