From 006f3f56cbbb5cf1a7867b7427878c436eff3ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marja=20H=C3=B6ltt=C3=A4?= Date: Fri, 27 Apr 2018 09:30:36 +0200 Subject: [PATCH] [cleanup] Remove parser_shell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's old & not used recently & obsolete. It was mainly used for measuring the effect of preparse data, which we no longer have. BUG=v8:7570 Change-Id: Ic31958e736fbf9645e014f6ef61dd6cf72a42c76 Reviewed-on: https://chromium-review.googlesource.com/1032390 Reviewed-by: Georg Neis Commit-Queue: Marja Hölttä Cr-Commit-Position: refs/heads/master@{#52830} --- BUILD.gn | 21 ------ tools/parser-shell.cc | 162 ------------------------------------------ 2 files changed, 183 deletions(-) delete mode 100644 tools/parser-shell.cc diff --git a/BUILD.gn b/BUILD.gn index b3c6c8d24d..34c2ad20f5 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -3392,7 +3392,6 @@ group("gn_all") { ":d8", ":v8_fuzzers", ":v8_hello_world", - ":v8_parser_shell", ":v8_sample_process", "test:gn_all", "tools:gn_all", @@ -3594,26 +3593,6 @@ v8_executable("v8_sample_process") { ] } -v8_executable("v8_parser_shell") { - sources = [ - "tools/parser-shell.cc", - "tools/shell-utils.h", - ] - - configs = [ - ":external_config", - ":internal_config_base", - ] - - deps = [ - ":v8", - ":v8_libbase", - ":v8_libplatform", - "//build/config:exe_and_shlib_deps", - "//build/win:default_exe_manifest", - ] -} - if (want_v8_shell) { v8_executable("v8_shell") { sources = [ diff --git a/tools/parser-shell.cc b/tools/parser-shell.cc deleted file mode 100644 index bcee2b8258..0000000000 --- a/tools/parser-shell.cc +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2014 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include -#include -#include -#include "src/v8.h" - -#include "include/libplatform/libplatform.h" -#include "src/api.h" -#include "src/compiler.h" -#include "src/objects-inl.h" -#include "src/parsing/parse-info.h" -#include "src/parsing/parsing.h" -#include "src/parsing/preparse-data.h" -#include "src/parsing/preparser.h" -#include "src/parsing/scanner-character-streams.h" -#include "tools/shell-utils.h" - -using namespace v8::internal; - -class StringResource8 : public v8::String::ExternalOneByteStringResource { - public: - StringResource8(const char* data, int length) - : data_(data), length_(length) { } - virtual size_t length() const { return length_; } - virtual const char* data() const { return data_; } - - private: - const char* data_; - int length_; -}; - -v8::base::TimeDelta RunBaselineParser(const char* fname, Encoding encoding, - int repeat, v8::Isolate* isolate, - v8::Local context) { - int length = 0; - const byte* source = ReadFileAndRepeat(fname, &length, repeat); - v8::Local source_handle; - switch (encoding) { - case UTF8: { - source_handle = v8::String::NewFromUtf8( - isolate, reinterpret_cast(source), - v8::NewStringType::kNormal).ToLocalChecked(); - break; - } - case UTF16: { - source_handle = - v8::String::NewFromTwoByte( - isolate, reinterpret_cast(source), - v8::NewStringType::kNormal, length / 2).ToLocalChecked(); - break; - } - case LATIN1: { - StringResource8* string_resource = - new StringResource8(reinterpret_cast(source), length); - source_handle = v8::String::NewExternalOneByte(isolate, string_resource) - .ToLocalChecked(); - break; - } - } - v8::base::TimeDelta parse_time1; - Handle