Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
dart::ProgramElementKeyValueTrait Class Reference

#include <precompiler.h>

Public Types

typedef const ObjectKey
 
typedef const ObjectValue
 
typedef const ObjectPair
 

Static Public Member Functions

static Key KeyOf (Pair kv)
 
static Value ValueOf (Pair kv)
 
static uword Hash (Key key)
 
static bool IsKeyEqual (Pair pair, Key key)
 

Detailed Description

Definition at line 187 of file precompiler.h.

Member Typedef Documentation

◆ Key

Definition at line 190 of file precompiler.h.

◆ Pair

Definition at line 192 of file precompiler.h.

◆ Value

Definition at line 191 of file precompiler.h.

Member Function Documentation

◆ Hash()

static uword dart::ProgramElementKeyValueTrait::Hash ( Key  key)
inlinestatic

Definition at line 198 of file precompiler.h.

198 {
199 if (key->IsFunction()) {
200 return Function::Cast(*key).Hash();
201 } else if (key->IsField()) {
202 return Utils::WordHash(Field::Cast(*key).kernel_offset());
203 } else if (key->IsClass()) {
204 return Utils::WordHash(Class::Cast(*key).kernel_offset());
205 } else if (key->IsLibrary()) {
206 // This must not use library's index or url hash because both
207 // of these might change during precompilation: urls are changed
208 // by |Precompiler::Obfuscate| and library index is changed by
209 // |Precompiler::DropLibraries|.
210 return Utils::WordHash(Library::Cast(*key).KernelLibraryOffset());
211 }
212 FATAL("Unexpected type: %s\n", key->ToCString());
213 }
static uint32_t WordHash(intptr_t key)
Definition utils.cc:217
#define FATAL(error)

◆ IsKeyEqual()

static bool dart::ProgramElementKeyValueTrait::IsKeyEqual ( Pair  pair,
Key  key 
)
inlinestatic

Definition at line 215 of file precompiler.h.

215 {
216 return pair->ptr() == key->ptr();
217 }

◆ KeyOf()

static Key dart::ProgramElementKeyValueTrait::KeyOf ( Pair  kv)
inlinestatic

Definition at line 194 of file precompiler.h.

194{ return kv; }

◆ ValueOf()

static Value dart::ProgramElementKeyValueTrait::ValueOf ( Pair  kv)
inlinestatic

Definition at line 196 of file precompiler.h.

196{ return kv; }

The documentation for this class was generated from the following file: