Skip to content

Commit 60ec141

Browse files
lavenzgfacebook-github-bot
authored andcommitted
Move dumpOpcodeStats() to jsi::Instrumentation, remove IHermesExtra (facebook#53475)
Summary: This is cleanup of IHermesExtra. Move the last method in IHermesExtra, dumpOpcodeStats(), to jsi::Instrumentation, since other profile stats dumping methods live in that interface as well. Differential Revision: D81087047
1 parent af19c8c commit 60ec141

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,10 @@ class RuntimeDecorator : public Base, private jsi::Instrumentation {
516516
.writeBasicBlockProfileTraceToFile(fileName);
517517
}
518518

519+
void dumpOpcodeStats(std::ostream& os) const override {
520+
const_cast<Plain&>(plain()).instrumentation().dumpOpcodeStats(os);
521+
}
522+
519523
/// Dump external profiler symbols to the given file name.
520524
void dumpProfilerSymbolsToFile(const std::string& fileName) const override {
521525
const_cast<Plain&>(plain()).instrumentation().dumpProfilerSymbolsToFile(

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ class JSI_EXPORT Instrumentation {
121121
virtual void writeBasicBlockProfileTraceToFile(
122122
const std::string& fileName) const = 0;
123123

124+
/// Write the opcode stats to the given stream.
125+
virtual void dumpOpcodeStats(std::ostream& os) const = 0;
126+
124127
/// Dump external profiler symbols to the given file name.
125128
virtual void dumpProfilerSymbolsToFile(const std::string& fileName) const = 0;
126129
};

packages/react-native/ReactCommon/jsi/jsi/jsi.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ Instrumentation& Runtime::instrumentation() {
334334
std::abort();
335335
}
336336

337+
void dumpOpcodeStats(std::ostream&) const override {
338+
std::abort();
339+
}
340+
337341
void dumpProfilerSymbolsToFile(const std::string&) const override {
338342
std::abort();
339343
}

0 commit comments

Comments
 (0)