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 { ...@@ -157,7 +157,7 @@ class Builtins {
static int GetStackParameterCount(Builtin builtin); 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. // Support for --print-builtin-size and --print-builtin-code.
void PrintBuiltinCode(); void PrintBuiltinCode();
......
...@@ -372,13 +372,6 @@ bool Interpreter::IsDispatchTableInitialized() const { ...@@ -372,13 +372,6 @@ bool Interpreter::IsDispatchTableInitialized() const {
return dispatch_table_[0] != kNullAddress; 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 { uintptr_t Interpreter::GetDispatchCounter(Bytecode from, Bytecode to) const {
int from_index = Bytecodes::ToByte(from); int from_index = Bytecodes::ToByte(from);
int to_index = Bytecodes::ToByte(to); int to_index = Bytecodes::ToByte(to);
......
...@@ -69,9 +69,6 @@ class Interpreter { ...@@ -69,9 +69,6 @@ class Interpreter {
void SetBytecodeHandler(Bytecode bytecode, OperandScale operand_scale, void SetBytecodeHandler(Bytecode bytecode, OperandScale operand_scale,
CodeT handler); CodeT handler);
// Disassembler support.
V8_EXPORT_PRIVATE const char* LookupNameOfBytecodeHandler(const Code code);
V8_EXPORT_PRIVATE Handle<JSObject> GetDispatchCountersObject(); V8_EXPORT_PRIVATE Handle<JSObject> GetDispatchCountersObject();
void ForEachBytecode(const std::function<void(Bytecode, OperandScale)>& f); void ForEachBytecode(const std::function<void(Bytecode, OperandScale)>& f);
......
...@@ -450,8 +450,8 @@ SharedFunctionInfo DeoptimizationData::GetInlinedFunction(int index) { ...@@ -450,8 +450,8 @@ SharedFunctionInfo DeoptimizationData::GetInlinedFunction(int index) {
#ifdef ENABLE_DISASSEMBLER #ifdef ENABLE_DISASSEMBLER
const char* Code::GetName(Isolate* isolate) const { const char* Code::GetName(Isolate* isolate) const {
if (kind() == CodeKind::BYTECODE_HANDLER) { if (is_builtin()) {
return isolate->interpreter()->LookupNameOfBytecodeHandler(*this); return Builtins::name(builtin_id());
} else { } else {
// There are some handlers and ICs that we can also find names for with // There are some handlers and ICs that we can also find names for with
// Builtins::Lookup. // Builtins::Lookup.
......
...@@ -4979,19 +4979,18 @@ TEST_F(InterpreterTest, InterpreterCollectSourcePositions_GenerateStackTrace) { ...@@ -4979,19 +4979,18 @@ TEST_F(InterpreterTest, InterpreterCollectSourcePositions_GenerateStackTrace) {
TEST_F(InterpreterTest, InterpreterLookupNameOfBytecodeHandler) { TEST_F(InterpreterTest, InterpreterLookupNameOfBytecodeHandler) {
Interpreter* interpreter = i_isolate()->interpreter(); Interpreter* interpreter = i_isolate()->interpreter();
Code ldaLookupSlot = FromCodeT(interpreter->GetBytecodeHandler( CodeT ldaLookupSlot = interpreter->GetBytecodeHandler(
Bytecode::kLdaLookupSlot, OperandScale::kSingle)); Bytecode::kLdaLookupSlot, OperandScale::kSingle);
CheckStringEqual("LdaLookupSlotHandler", CheckStringEqual("LdaLookupSlotHandler",
interpreter->LookupNameOfBytecodeHandler(ldaLookupSlot)); Builtins::name(ldaLookupSlot.builtin_id()));
Code wideLdaLookupSlot = FromCodeT(interpreter->GetBytecodeHandler( CodeT wideLdaLookupSlot = interpreter->GetBytecodeHandler(
Bytecode::kLdaLookupSlot, OperandScale::kDouble)); Bytecode::kLdaLookupSlot, OperandScale::kDouble);
CheckStringEqual("LdaLookupSlotWideHandler", CheckStringEqual("LdaLookupSlotWideHandler",
interpreter->LookupNameOfBytecodeHandler(wideLdaLookupSlot)); Builtins::name(wideLdaLookupSlot.builtin_id()));
Code extraWideLdaLookupSlot = FromCodeT(interpreter->GetBytecodeHandler( CodeT extraWideLdaLookupSlot = interpreter->GetBytecodeHandler(
Bytecode::kLdaLookupSlot, OperandScale::kQuadruple)); Bytecode::kLdaLookupSlot, OperandScale::kQuadruple);
CheckStringEqual( CheckStringEqual("LdaLookupSlotExtraWideHandler",
"LdaLookupSlotExtraWideHandler", Builtins::name(extraWideLdaLookupSlot.builtin_id()));
interpreter->LookupNameOfBytecodeHandler(extraWideLdaLookupSlot));
} }
} // namespace interpreter } // 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