Reviewers: Benedikt Meurer,

Description:
Remove usage of to-be-deprecated APIs from tools

BUG=v8:4134
[email protected]
LOG=n

Please review this at https://codereview.chromium.org/1217123004/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+15, -8 lines):
  M tools/parser-shell.cc
  M tools/parser-shell.gyp


Index: tools/parser-shell.cc
diff --git a/tools/parser-shell.cc b/tools/parser-shell.cc
index 8abe768a36bbb0f778f9f99394ea99bd23844cfc..ead7777022fd52a7ff0646b8602f2c4694edecf7 100644
--- a/tools/parser-shell.cc
+++ b/tools/parser-shell.cc
@@ -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());
     {
Index: tools/parser-shell.gyp
diff --git a/tools/parser-shell.gyp b/tools/parser-shell.gyp
index f0f0b8b650da9a9f95f53f08866c488a830062a3..77ed1eb246055f32ca7b9e06cd4f8305b699b675 100644
--- a/tools/parser-shell.gyp
+++ b/tools/parser-shell.gyp
@@ -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',


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to