Commit 3c5998f9 authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[builtins] Simplify InitializeBuiltinEntryTrable

All builtins are now guaranteed to be in the embedded blob. Setup of
the builtins entry table can be simplified to directly fetch
instruction starts from the embedded blob.

Additionally, this CL adds a sanity check for the builtin Code
object's builtin_index (to verify the Code object is uncorrupted). The
CHECK can be removed or changed to a DCHECK once the linked bug is
resolved.

Bug: chromium:1020986
Change-Id: I38832790132e284c7fc23251a5dc2eefb8456de6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1939048
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65194}
parent 971e81ad
......@@ -278,10 +278,14 @@ bool Builtins::IsWasmRuntimeStub(int index) {
// static
void Builtins::InitializeBuiltinEntryTable(Isolate* isolate) {
Heap* heap = isolate->heap();
EmbeddedData d = EmbeddedData::FromBlob();
Address* builtin_entry_table = isolate->builtin_entry_table();
for (int i = 0; i < builtin_count; i++) {
builtin_entry_table[i] = heap->builtin(i).InstructionStart();
// TODO(jgruber,chromium:1020986): Remove the CHECK once the linked issue is
// resolved.
CHECK(Builtins::IsBuiltinId(isolate->heap()->builtin(i).builtin_index()));
DCHECK(isolate->heap()->builtin(i).is_off_heap_trampoline());
builtin_entry_table[i] = d.InstructionStartOfBuiltin(i);
}
}
......
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