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

#include <object.h>

Inheritance diagram for dart::Symbol:
dart::AllStatic

Static Public Member Functions

static bool IsSymbolCid (Thread *thread, classid_t class_id)
 
static uint32_t CanonicalizeHash (Thread *thread, const Instance &instance)
 

Detailed Description

Definition at line 10150 of file object.h.

Member Function Documentation

◆ CanonicalizeHash()

uint32_t dart::Symbol::CanonicalizeHash ( Thread thread,
const Instance instance 
)
static

Definition at line 20299 of file object.cc.

20299 {
20300 ASSERT(IsSymbolCid(thread, instance.GetClassId()));
20301
20302 auto zone = thread->zone();
20303 auto object_store = thread->isolate_group()->object_store();
20304
20305 const auto& symbol_name_field =
20306 Field::Handle(zone, object_store->symbol_name_field());
20307 ASSERT(!symbol_name_field.IsNull());
20308
20309 // Keep in sync with sdk/lib/_internal/vm/lib/symbol_patch.dart.
20310 const auto& name =
20311 String::Cast(Object::Handle(zone, instance.GetField(symbol_name_field)));
20312 const uint32_t arbitrary_prime = 664597;
20313 return 0x1fffffff & (arbitrary_prime * name.CanonicalizeHash());
20314}
static Object & Handle()
Definition: object.h:407
static bool IsSymbolCid(Thread *thread, classid_t class_id)
Definition: object.cc:20293
#define ASSERT(E)
VkInstance instance
Definition: main.cc:48
const char *const name

◆ IsSymbolCid()

bool dart::Symbol::IsSymbolCid ( Thread thread,
classid_t  class_id 
)
static

Definition at line 20293 of file object.cc.

20293 {
20294 auto object_store = thread->isolate_group()->object_store();
20295 return Class::GetClassId(object_store->symbol_class()) == class_id;
20296}
intptr_t GetClassId() const
Definition: object.h:341

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