Commit 4c05639e authored by rmcilroy's avatar rmcilroy Committed by Commit bot

Remove deprecated API functions from cctests/interpreter

Removes deprecated functions from the following files:
 test/cctest/interpreter/test-bytecode-generator.cc
 test/cctest/interpreter/test-interpreter.cc

BUG=v8:4134
LOG=N

Review URL: https://codereview.chromium.org/1421223005

Cr-Commit-Position: refs/heads/master@{#31688}
parent 40f8605f
......@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(rmcilroy): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include "src/v8.h"
#include "src/compiler.h"
......@@ -47,8 +50,10 @@ class BytecodeGeneratorHelper {
Handle<BytecodeArray> MakeBytecode(const char* script,
const char* function_name) {
CompileRun(script);
Local<Function> function =
Local<Function>::Cast(CcTest::global()->Get(v8_str(function_name)));
v8::Local<v8::Context> context =
v8::Isolate::GetCurrent()->GetCurrentContext();
Local<Function> function = Local<Function>::Cast(
CcTest::global()->Get(context, v8_str(function_name)).ToLocalChecked());
i::Handle<i::JSFunction> js_function =
i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*function));
return handle(js_function->shared()->bytecode_array(), CcTest::i_isolate());
......
......@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(rmcilroy): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include "src/v8.h"
#include "src/execution.h"
......@@ -126,8 +129,12 @@ class InterpreterTester {
Handle<JSFunction> function;
if (source_) {
CompileRun(source_);
v8::Local<v8::Context> context =
v8::Isolate::GetCurrent()->GetCurrentContext();
Local<Function> api_function =
Local<Function>::Cast(CcTest::global()->Get(v8_str(kFunctionName)));
Local<Function>::Cast(CcTest::global()
->Get(context, v8_str(kFunctionName))
.ToLocalChecked());
function = Handle<JSFunction>::cast(v8::Utils::OpenHandle(*api_function));
} else {
int arg_count = sizeof...(A);
......@@ -137,7 +144,7 @@ class InterpreterTester {
}
source += "){})";
function = Handle<JSFunction>::cast(v8::Utils::OpenHandle(
*v8::Handle<v8::Function>::Cast(CompileRun(source.c_str()))));
*v8::Local<v8::Function>::Cast(CompileRun(source.c_str()))));
function->ReplaceCode(
*isolate_->builtins()->InterpreterEntryTrampoline());
}
......
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