Commit b3179fe7 authored by ishell@chromium.org's avatar ishell@chromium.org Committed by V8 LUCI CQ

[cleanup] Remove Interpreter::LookupNameOfBytecodeHandler

... in favour of Builtins::name().

Bug: v8:11880
Change-Id: I1e06314aec71ea367cd8096316e8fb9aceb63feb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3776686
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81854}
parent 7b4c2ff5
......@@ -157,7 +157,7 @@ class Builtins {
static int GetStackParameterCount(Builtin builtin);
static const char* name(Builtin builtin);
V8_EXPORT_PRIVATE static const char* name(Builtin builtin);
// Support for --print-builtin-size and --print-builtin-code.
void PrintBuiltinCode();
......
......@@ -372,13 +372,6 @@ bool Interpreter::IsDispatchTableInitialized() const {
return dispatch_table_[0] != kNullAddress;
}
const char* Interpreter::LookupNameOfBytecodeHandler(const Code code) {
if (code.kind() == CodeKind::BYTECODE_HANDLER) {
return Builtins::name(code.builtin_id());
}
return nullptr;
}
uintptr_t Interpreter::GetDispatchCounter(Bytecode from, Bytecode to) const {
int from_index = Bytecodes::ToByte(from);
int to_index = Bytecodes::ToByte(to);
......
......@@ -69,9 +69,6 @@ class Interpreter {
void SetBytecodeHandler(Bytecode bytecode, OperandScale operand_scale,
CodeT handler);
// Disassembler support.
V8_EXPORT_PRIVATE const char* LookupNameOfBytecodeHandler(const Code code);
V8_EXPORT_PRIVATE Handle<JSObject> GetDispatchCountersObject();
void ForEachBytecode(const std::function<void(Bytecode, OperandScale)>& f);
......
......@@ -450,8 +450,8 @@ SharedFunctionInfo DeoptimizationData::GetInlinedFunction(int index) {
#ifdef ENABLE_DISASSEMBLER
const char* Code::GetName(Isolate* isolate) const {
if (kind() == CodeKind::BYTECODE_HANDLER) {
return isolate->interpreter()->LookupNameOfBytecodeHandler(*this);
if (is_builtin()) {
return Builtins::name(builtin_id());
} else {
// There are some handlers and ICs that we can also find names for with
// Builtins::Lookup.
......
......@@ -4979,19 +4979,18 @@ TEST_F(InterpreterTest, InterpreterCollectSourcePositions_GenerateStackTrace) {
TEST_F(InterpreterTest, InterpreterLookupNameOfBytecodeHandler) {
Interpreter* interpreter = i_isolate()->interpreter();
Code ldaLookupSlot = FromCodeT(interpreter->GetBytecodeHandler(
Bytecode::kLdaLookupSlot, OperandScale::kSingle));
CodeT ldaLookupSlot = interpreter->GetBytecodeHandler(
Bytecode::kLdaLookupSlot, OperandScale::kSingle);
CheckStringEqual("LdaLookupSlotHandler",
interpreter->LookupNameOfBytecodeHandler(ldaLookupSlot));
Code wideLdaLookupSlot = FromCodeT(interpreter->GetBytecodeHandler(
Bytecode::kLdaLookupSlot, OperandScale::kDouble));
Builtins::name(ldaLookupSlot.builtin_id()));
CodeT wideLdaLookupSlot = interpreter->GetBytecodeHandler(
Bytecode::kLdaLookupSlot, OperandScale::kDouble);
CheckStringEqual("LdaLookupSlotWideHandler",
interpreter->LookupNameOfBytecodeHandler(wideLdaLookupSlot));
Code extraWideLdaLookupSlot = FromCodeT(interpreter->GetBytecodeHandler(
Bytecode::kLdaLookupSlot, OperandScale::kQuadruple));
CheckStringEqual(
"LdaLookupSlotExtraWideHandler",
interpreter->LookupNameOfBytecodeHandler(extraWideLdaLookupSlot));
Builtins::name(wideLdaLookupSlot.builtin_id()));
CodeT extraWideLdaLookupSlot = interpreter->GetBytecodeHandler(
Bytecode::kLdaLookupSlot, OperandScale::kQuadruple);
CheckStringEqual("LdaLookupSlotExtraWideHandler",
Builtins::name(extraWideLdaLookupSlot.builtin_id()));
}
} // namespace interpreter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment