diff --git a/Libraries/Performance/QuickPerformanceLogger.js b/Libraries/Performance/QuickPerformanceLogger.js index 42f75f688..70a7e350a 100644 --- a/Libraries/Performance/QuickPerformanceLogger.js +++ b/Libraries/Performance/QuickPerformanceLogger.js @@ -51,6 +51,28 @@ var QuickPerformanceLogger = { } }, + markerTag(markerId, tag, opts) { + if (typeof markerId !== 'number' || typeof tag !== 'string') { + return; + } + if (global.nativeQPLMarkerTag) { + opts = fixOpts(opts); + global.nativeQPLMarkerTag(markerId, opts.instanceKey, tag); + } + }, + + markerAnnotate(markerId, annotationKey, annotationValue, opts) { + if (typeof markerId !== 'number' || + typeof annotationKey !== 'string' || + typeof annotationValue !== 'string') { + return; + } + if (global.nativeQPLMarkerAnnotate) { + opts = fixOpts(opts); + global.nativeQPLMarkerAnnotate(markerId, opts.instanceKey, annotationKey, annotationValue); + } + }, + markerCancel(markerId, opts) { if (typeof markerId !== 'number') { return; diff --git a/React/Executors/RCTJSCExecutor.mm b/React/Executors/RCTJSCExecutor.mm index 8477e87b5..3fe8ca9a3 100644 --- a/React/Executors/RCTJSCExecutor.mm +++ b/React/Executors/RCTJSCExecutor.mm @@ -40,6 +40,9 @@ RCT_EXTERN NSString *const RCTFBJSValueClassKey = @"_RCTFBJSValueClassKey"; static NSString *const RCTJSCProfilerEnabledDefaultsKey = @"RCTJSCProfilerEnabled"; +__attribute__((weak)) void RCTFBQuickPerformanceLoggerConfigureHooks(JSContext *context); +void RCTFBQuickPerformanceLoggerConfigureHooks(JSContext *context) { } + struct __attribute__((packed)) ModuleData { uint32_t offset; uint32_t size; @@ -356,6 +359,8 @@ static NSThread *newJavaScriptThread(void) threadDictionary[RCTFBJSValueClassKey] = JSC_JSValue(contextRef); } + RCTFBQuickPerformanceLoggerConfigureHooks(context); + __weak RCTJSCExecutor *weakSelf = self; context[@"nativeRequireModuleConfig"] = ^NSArray *(NSString *moduleName) { RCTJSCExecutor *strongSelf = weakSelf;