Commit 9ea182dd authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[interpreter] Support laziness in combination with embedded handlers

Even in the embedded bytecode handler configuration, there's currently
no guarantee that all handlers are eager. Specifically, on ia32
handlers are currently not embedded and thus lazy.

We need to keep lazy deserialization logic around until that is no
longer the case.

Bug: v8:6624
Change-Id: Ie4ec5f0fcd9890ed96a5df3bf3654e85379f92ae
Reviewed-on: https://chromium-review.googlesource.com/1236261Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56110}
parent 1292e8c8
......@@ -62,7 +62,6 @@ void WriteHeader(const char* header_filename) {
CHECK_EQ(wide_count, extra_wide_count);
out << "\n\nconst int kNumberOfBytecodeHandlers = " << single_count << ";\n"
<< "const int kNumberOfWideBytecodeHandlers = " << wide_count << ";\n\n"
<< "#ifndef V8_EMBEDDED_BYTECODE_HANDLERS\n"
<< "// Mapping from (Bytecode + OperandScaleAsIndex * |Bytecodes|) to\n"
<< "// a dense form with all the illegal Bytecode/OperandScale\n"
<< "// combinations removed. Used to index into the builtins table.\n"
......@@ -76,8 +75,7 @@ void WriteHeader(const char* header_filename) {
out << offset_table[i] << ", ";
}
out << "};\n"
<< "#endif //V8_EMBEDDED_BYTECODE_HANDLERS\n\n"
out << "};\n\n"
<< "} // namespace internal\n"
<< "} // namespace v8\n"
<< "#endif // V8_BUILTINS_GENERATED_BYTECODES_BUILTINS_LIST\n";
......
......@@ -60,7 +60,6 @@ Interpreter::Interpreter(Isolate* isolate) : isolate_(isolate) {
}
}
#ifndef V8_EMBEDDED_BYTECODE_HANDLERS
namespace {
int BuiltinIndexFromBytecode(Bytecode bytecode, OperandScale operand_scale) {
......@@ -73,17 +72,9 @@ int BuiltinIndexFromBytecode(Bytecode bytecode, OperandScale operand_scale) {
}
} // namespace
#endif // V8_EMBEDDED_BYTECODE_HANDLERS
Code* Interpreter::GetAndMaybeDeserializeBytecodeHandler(
Bytecode bytecode, OperandScale operand_scale) {
#ifdef V8_EMBEDDED_BYTECODE_HANDLERS
size_t index = GetDispatchTableIndex(bytecode, operand_scale);
Address pc = dispatch_table_[index];
Code* builtin = InstructionStream::TryLookupCode(isolate_, pc);
DCHECK(builtin->IsCode());
return builtin;
#else
int builtin_index = BuiltinIndexFromBytecode(bytecode, operand_scale);
Builtins* builtins = isolate_->builtins();
Code* code = builtins->builtin(builtin_index);
......@@ -102,7 +93,6 @@ Code* Interpreter::GetAndMaybeDeserializeBytecodeHandler(
SetBytecodeHandler(bytecode, operand_scale, code);
return code;
#endif // V8_EMBEDDED_BYTECODE_HANDLERS
}
void Interpreter::SetBytecodeHandler(Bytecode bytecode,
......
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