Flutter Engine
The Flutter Engine
Public Types | Static Public Member Functions | List of all members
dart::ArrayKeyValueTrait Class Reference

Public Types

typedef const ArrayKey
 
typedef const ArrayValue
 
typedef const ArrayPair
 

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 1047 of file program_visitor.cc.

Member Typedef Documentation

◆ Key

Definition at line 1050 of file program_visitor.cc.

◆ Pair

Definition at line 1052 of file program_visitor.cc.

◆ Value

Definition at line 1051 of file program_visitor.cc.

Member Function Documentation

◆ Hash()

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

Definition at line 1058 of file program_visitor.cc.

1058 {
1059 ASSERT(!key->IsNull());
1060 ASSERT(Thread::Current()->no_safepoint_scope_depth() > 0);
1061 const intptr_t len = key->Length();
1062 uint32_t hash = Utils::WordHash(len);
1063 for (intptr_t i = 0; i < len; ++i) {
1064 hash =
1065 CombineHashes(hash, Utils::WordHash(static_cast<uword>(key->At(i))));
1066 }
1067 return hash;
1068 }
static uint32_t hash(const SkShaderBase::GradientInfo &v)
static Thread * Current()
Definition: thread.h:362
static uint32_t WordHash(intptr_t key)
Definition: utils.cc:217
#define ASSERT(E)
uint32_t CombineHashes(uint32_t hash, uint32_t other_hash)
Definition: hash.h:12
uintptr_t uword
Definition: globals.h:501

◆ IsKeyEqual()

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

Definition at line 1070 of file program_visitor.cc.

1070 {
1071 ASSERT(!pair->IsNull() && !key->IsNull());
1072 if (pair->Length() != key->Length()) return false;
1073 for (intptr_t i = 0; i < pair->Length(); i++) {
1074 if (pair->At(i) != key->At(i)) return false;
1075 }
1076 return true;
1077 }

◆ KeyOf()

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

Definition at line 1054 of file program_visitor.cc.

1054{ return kv; }

◆ ValueOf()

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

Definition at line 1056 of file program_visitor.cc.

1056{ return kv; }

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