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

#include <kernel_fingerprints.h>

Inheritance diagram for dart::kernel::KernelSourceFingerprintHelper:
dart::AllStatic

Static Public Member Functions

static uint32_t CalculateClassFingerprint (const Class &klass)
 
static uint32_t CalculateFieldFingerprint (const Field &field)
 
static uint32_t CalculateFunctionFingerprint (const Function &func)
 

Detailed Description

Definition at line 18 of file kernel_fingerprints.h.

Member Function Documentation

◆ CalculateClassFingerprint()

uint32_t dart::kernel::KernelSourceFingerprintHelper::CalculateClassFingerprint ( const Class klass)
static

Definition at line 957 of file kernel_fingerprints.cc.

958 {
959 Zone* zone = Thread::Current()->zone();
960 String& name = String::Handle(zone, klass.Name());
961 const Array& fields = Array::Handle(zone, klass.fields());
962 const Array& functions = Array::Handle(zone, klass.current_functions());
963 const Array& interfaces = Array::Handle(zone, klass.interfaces());
964 AbstractType& type = AbstractType::Handle(zone);
965
966 uint32_t hash = 0;
968
969 type = klass.super_type();
970 if (!type.IsNull()) {
971 name = type.Name();
973 }
974
975 Field& field = Field::Handle(zone);
976 // Calculate fingerprint for the class fields.
977 for (intptr_t i = 0; i < fields.Length(); ++i) {
978 field ^= fields.At(i);
979 uint32_t fingerprint = CalculateFieldFingerprint(field);
981 }
982
983 // Calculate fingerprint for the class functions.
984 Function& func = Function::Handle(zone);
985 for (intptr_t i = 0; i < functions.Length(); ++i) {
986 func ^= functions.At(i);
987 uint32_t fingerprint = CalculateFunctionFingerprint(func);
989 }
990
991 // Calculate fingerprint for the interfaces.
992 for (intptr_t i = 0; i < interfaces.Length(); ++i) {
993 type ^= interfaces.At(i);
994 name = type.Name();
996 }
997
998 return hash;
999}
static uint32_t hash(const SkShaderBase::GradientInfo &v)
GLenum type
static Object & Handle()
Definition: object.h:407
Zone * zone() const
Definition: thread_state.h:37
static Thread * Current()
Definition: thread.h:362
static uint32_t CalculateHash(uint32_t current, uint32_t val)
static uint32_t CalculateFunctionFingerprint(const Function &func)
static uint32_t CalculateFieldFingerprint(const Field &field)
const char *const name

◆ CalculateFieldFingerprint()

uint32_t dart::kernel::KernelSourceFingerprintHelper::CalculateFieldFingerprint ( const Field field)
static

Definition at line 1001 of file kernel_fingerprints.cc.

1002 {
1003 Thread* thread = Thread::Current();
1004 Zone* zone = thread->zone();
1005 const auto& info = KernelProgramInfo::Handle(zone, field.KernelProgramInfo());
1006
1007 TranslationHelper translation_helper(thread);
1008 translation_helper.InitFromKernelProgramInfo(info);
1009
1010 KernelFingerprintHelper helper(
1011 zone, &translation_helper,
1012 TypedDataView::Handle(zone, field.KernelLibrary()),
1013 field.KernelLibraryOffset());
1014 helper.SetOffset(field.kernel_offset());
1015 return helper.CalculateFieldFingerprint();
1016}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213

◆ CalculateFunctionFingerprint()

uint32_t dart::kernel::KernelSourceFingerprintHelper::CalculateFunctionFingerprint ( const Function func)
static

Definition at line 1018 of file kernel_fingerprints.cc.

1019 {
1020 Thread* thread = Thread::Current();
1021 Zone* zone = thread->zone();
1022 const auto& info = KernelProgramInfo::Handle(zone, func.KernelProgramInfo());
1023
1024 TranslationHelper translation_helper(thread);
1025 translation_helper.InitFromKernelProgramInfo(info);
1026
1027 KernelFingerprintHelper helper(
1028 zone, &translation_helper,
1029 TypedDataView::Handle(zone, func.KernelLibrary()),
1030 func.KernelLibraryOffset());
1031 helper.SetOffset(func.kernel_offset());
1032 return helper.CalculateFunctionFingerprint();
1033}

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