Skip to content

Commit 9e0d549

Browse files
lavenzgfacebook-github-bot
authored andcommitted
Move debugJavaScript to IHermes, remove unused dumpBasicBlockProfileTrace (#53473)
Summary: I'm still keeping the empty DebugFlags, since changing that requires more changes. It's also possible that we may need it in the future. `dumpBasicBlockProfileTrace` is completely removed, use writeBasicBlockProfileTraceToFile` if users need to dump the profile. Differential Revision: D81075460
1 parent a57e900 commit 9e0d549

File tree

1 file changed

+21
-0
lines changed
  • packages/react-native/ReactCommon/jsi/jsi

1 file changed

+21
-0
lines changed

packages/react-native/ReactCommon/jsi/jsi/hermes.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ class GCExecTrace;
1818

1919
namespace facebook::hermes {
2020

21+
namespace sampling_profiler {
22+
class Profile;
23+
}
24+
2125
namespace debugger {
2226
class Debugger;
2327
}
@@ -33,10 +37,27 @@ class IHermes : public jsi::ICast {
3337
0xa6f7,
3438
0x325096b39f47};
3539

40+
struct DebugFlags {
41+
// Looking for the .lazy flag? It's no longer necessary.
42+
// Source is evaluated lazily by default. See
43+
// RuntimeConfig::CompilationMode.
44+
};
45+
46+
/// Evaluate the given code in an unoptimized form, used for debugging.
47+
/// This will be no-op if the implementation does not have debugger enabled.
48+
virtual void debugJavaScript(
49+
const std::string& src,
50+
const std::string& sourceURL,
51+
const DebugFlags& debugFlags) = 0;
52+
3653
/// Return a ICast pointer to an object that be cast into the interface
3754
/// IHermesRootAPI. This root API object has static lifetime.
3855
virtual ICast* getHermesRootAPI() = 0;
3956

57+
/// Dump sampled stack trace for a given runtime to a data structure that can
58+
/// be used by third parties.
59+
virtual sampling_profiler::Profile dumpSampledTraceToProfile() = 0;
60+
4061
/// Serialize the sampled stack to the format expected by DevTools'
4162
/// Profiler.stop return type.
4263
virtual void sampledTraceToStreamInDevToolsFormat(std::ostream& stream) = 0;

0 commit comments

Comments
 (0)