feat:add global anchor hook to monitor all performance hook
This commit is contained in:
@@ -58,7 +58,11 @@ @implementation DoricJSEngine
|
||||
- (instancetype)init {
|
||||
if (self = [super init]) {
|
||||
_initialized = NO;
|
||||
_registry = [[DoricRegistry alloc] initWithJSEngine:self];
|
||||
_profile = [[DoricPerformanceProfile alloc] initWithName:@"JSEngine"];
|
||||
if (_registry.globalPerformanceAnchorHook) {
|
||||
[_profile addAnchorHook:_registry.globalPerformanceAnchorHook];
|
||||
}
|
||||
[_profile prepare:@"Init"];
|
||||
_jsThread = [[NSThread alloc] initWithTarget:self selector:@selector(threadRun) object:nil];
|
||||
[_jsThread start];
|
||||
@@ -95,7 +99,6 @@ - (instancetype)init {
|
||||
@"localeLanguage": [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode] ?: @"",
|
||||
@"localeCountry": [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode] ?: @"",
|
||||
}.mutableCopy;
|
||||
self.registry = [[DoricRegistry alloc] initWithJSEngine:self];
|
||||
[self ensureRunOnJSThread:^() {
|
||||
[self.profile start:@"Init"];
|
||||
self.timers = [[NSMutableDictionary alloc] init];
|
||||
|
Reference in New Issue
Block a user