v8/test/unittests/compiler-dispatcher/compiler-dispatcher-helper.cc
jochen 1bdf908db0 Add a basic compiler dispatcher
It doesn't schedule steps yet, but there are tests.

BUG=v8:5215
R=rmcilroy@chromium.org,marja@chromium.org

Review-Url: https://codereview.chromium.org/2558293004
Cr-Commit-Position: refs/heads/master@{#41650}
2016-12-12 15:36:25 +00:00

28 lines
776 B
C++

// Copyright 2016 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/unittests/compiler-dispatcher/compiler-dispatcher-helper.h"
#include <memory>
#include "include/v8.h"
#include "src/api.h"
namespace v8 {
namespace internal {
Handle<Object> RunJS(v8::Isolate* isolate, const char* script) {
return Utils::OpenHandle(
*v8::Script::Compile(
isolate->GetCurrentContext(),
v8::String::NewFromUtf8(isolate, script, v8::NewStringType::kNormal)
.ToLocalChecked())
.ToLocalChecked()
->Run(isolate->GetCurrentContext())
.ToLocalChecked());
}
} // namespace internal
} // namespace v8