Commit da529a12 authored by jochen's avatar jochen Committed by Commit bot

Remove usage of to-be-deprecated APIs from tools

BUG=v8:4134
R=bmeurer@chromium.org
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#29474}
parent f022e53b
......@@ -69,26 +69,29 @@ class StringResource8 : public v8::String::ExternalOneByteStringResource {
std::pair<v8::base::TimeDelta, v8::base::TimeDelta> RunBaselineParser(
const char* fname, Encoding encoding, int repeat, v8::Isolate* isolate,
v8::Handle<v8::Context> context) {
v8::Local<v8::Context> context) {
int length = 0;
const byte* source = ReadFileAndRepeat(fname, &length, repeat);
v8::Handle<v8::String> source_handle;
v8::Local<v8::String> source_handle;
switch (encoding) {
case UTF8: {
source_handle = v8::String::NewFromUtf8(
isolate, reinterpret_cast<const char*>(source));
isolate, reinterpret_cast<const char*>(source),
v8::NewStringType::kNormal).ToLocalChecked();
break;
}
case UTF16: {
source_handle = v8::String::NewFromTwoByte(
isolate, reinterpret_cast<const uint16_t*>(source),
v8::String::kNormalString, length / 2);
source_handle =
v8::String::NewFromTwoByte(
isolate, reinterpret_cast<const uint16_t*>(source),
v8::NewStringType::kNormal, length / 2).ToLocalChecked();
break;
}
case LATIN1: {
StringResource8* string_resource =
new StringResource8(reinterpret_cast<const char*>(source), length);
source_handle = v8::String::NewExternal(isolate, string_resource);
source_handle = v8::String::NewExternalOneByte(isolate, string_resource)
.ToLocalChecked();
break;
}
}
......@@ -170,7 +173,7 @@ int main(int argc, char* argv[]) {
{
v8::Isolate::Scope isolate_scope(isolate);
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate);
v8::Local<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate);
v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global);
DCHECK(!context.IsEmpty());
{
......
......@@ -50,6 +50,10 @@
'include_dirs+': [
'..',
],
'defines': [
# TODO(jochen): Remove again after this is globally turned on.
'V8_IMMINENT_DEPRECATION_WARNINGS',
],
'sources': [
'parser-shell.cc',
'shell-utils.h',
......
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