v8/test/cctest/setup-isolate-for-tests.cc
Dan Elphick b4b5e785c0 [embed handlers] Initialize dispatch table
When v8_enable_embedded_bytecode_handlers is true, initialize the
bytecode dispatch table from the builtins table. Also stops creating
the handlers more than once as the SetupInterpreter will now always do
nothing even when not starting from a snapshot.

In the short term, with the flag enabled all the bytecode handlers are
eagerly deserialized.

Finally, the bytecode handlers are marked as non-isolate independent to
prevent them being embedded in the binary until they can be converted.

Bug: v8:8068
Change-Id: I9e5ef7f1dce1b2d11c7aa26526f06b53f8939697
Reviewed-on: https://chromium-review.googlesource.com/1188477
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55581}
2018-09-03 08:18:10 +00:00

36 lines
889 B
C++

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "test/cctest/setup-isolate-for-tests.h"
#include "src/interpreter/setup-interpreter.h"
namespace v8 {
namespace internal {
void SetupIsolateDelegateForTests::SetupBuiltins(Isolate* isolate) {
if (create_heap_objects_) {
SetupBuiltinsInternal(isolate);
}
}
void SetupIsolateDelegateForTests::SetupInterpreter(
interpreter::Interpreter* interpreter) {
#ifndef V8_EMBEDDED_BYTECODE_HANDLERS
if (create_heap_objects_) {
interpreter::SetupInterpreter::InstallBytecodeHandlers(interpreter);
}
#endif
}
bool SetupIsolateDelegateForTests::SetupHeap(Heap* heap) {
if (create_heap_objects_) {
return SetupHeapInternal(heap);
}
return true;
}
} // namespace internal
} // namespace v8