From dfcc4f8ad5cdf73a0828395ddd298f708ff377f0 Mon Sep 17 00:00:00 2001 From: Mike Armstrong Date: Tue, 29 Dec 2015 22:11:40 -0800 Subject: [PATCH] Log Memory tags using LegacyProfiler Reviewed By: jspahrsummers Differential Revision: D2789647 fb-gh-sync-id: 220a0fc4eccccd92a6b8f45b07b32735a7054614 --- .../src/main/jni/react/JSCTracing.cpp | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/ReactAndroid/src/main/jni/react/JSCTracing.cpp b/ReactAndroid/src/main/jni/react/JSCTracing.cpp index c607cc8c6..70d79d478 100644 --- a/ReactAndroid/src/main/jni/react/JSCTracing.cpp +++ b/ReactAndroid/src/main/jni/react/JSCTracing.cpp @@ -419,18 +419,11 @@ static JSValueRef nativeTraceBeginLegacy( size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - if (FBSYSTRACE_UNLIKELY(argumentCount < 1)) { - if (exception) { - *exception = facebook::react::makeJSCException( - ctx, - "nativeTraceBeginLegacy: requires TAG Argument"); + if (FBSYSTRACE_LIKELY(argumentCount >= 1)) { + uint64_t tag = tagFromJSValue(ctx, arguments[0], exception); + if (!fbsystrace_is_tracing(tag)) { + return JSValueMakeUndefined(ctx); } - return JSValueMakeUndefined(ctx); - } - - uint64_t tag = tagFromJSValue(ctx, arguments[0], exception); - if (!fbsystrace_is_tracing(tag)) { - return JSValueMakeUndefined(ctx); } JSStringRef title = JSStringCreateWithUTF8CString(ENABLED_FBSYSTRACE_PROFILE_NAME); @@ -451,18 +444,11 @@ static JSValueRef nativeTraceEndLegacy( size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - if (FBSYSTRACE_UNLIKELY(argumentCount < 1)) { - if (exception) { - *exception = facebook::react::makeJSCException( - ctx, - "nativeTraceBeginLegacy: requires TAG Argument"); + if (FBSYSTRACE_LIKELY(argumentCount >= 1)) { + uint64_t tag = tagFromJSValue(ctx, arguments[0], exception); + if (!fbsystrace_is_tracing(tag)) { + return JSValueMakeUndefined(ctx); } - return JSValueMakeUndefined(ctx); - } - - uint64_t tag = tagFromJSValue(ctx, arguments[0], exception); - if (!fbsystrace_is_tracing(tag)) { - return JSValueMakeUndefined(ctx); } JSStringRef title = JSStringCreateWithUTF8CString(ENABLED_FBSYSTRACE_PROFILE_NAME);