From: jkummerow@chromium.org Date: Fri, 12 Apr 2013 09:05:49 +0000 (+0000) Subject: Remove preparser library; link preparser executable against full V8 X-Git-Tag: upstream/4.7.83~14603 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a183e520852fb181351096be4da203c23b2ec90a;p=platform%2Fupstream%2Fv8.git Remove preparser library; link preparser executable against full V8 Review URL: https://codereview.chromium.org/13880018 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14244 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/preparser/preparser-process.cc b/preparser/preparser-process.cc index 1bcc804..b816744 100644 --- a/preparser/preparser-process.cc +++ b/preparser/preparser-process.cc @@ -30,6 +30,7 @@ #include #include +#include "../include/v8.h" #include "../include/v8stdint.h" #include "../include/v8-preparser.h" @@ -37,8 +38,7 @@ namespace i = v8::internal; -// This file is only used for testing the stand-alone preparser -// library. +// This file is only used for testing the preparser. // The first argument must be the path of a JavaScript source file, or // the flags "-e" and the next argument is then the source of a JavaScript // program. @@ -320,6 +320,8 @@ int main(int argc, const char* argv[]) { ExceptionExpectation expects = ParseExpectation(argc - arg_index, argv + arg_index); + v8::V8::Initialize(); + ScopedPointer buffer; size_t length; diff --git a/preparser/preparser.gyp b/preparser/preparser.gyp index 0b03382..2dcbaf9 100644 --- a/preparser/preparser.gyp +++ b/preparser/preparser.gyp @@ -31,11 +31,22 @@ { 'target_name': 'preparser', 'type': 'executable', - 'dependencies': [ - '../tools/gyp/v8.gyp:preparser_lib', + 'conditions': [ + # preparser can't link against a shared library, so link against + # the underlying static targets. + ['v8_use_snapshot=="true"', { + 'dependencies': ['../tools/gyp/v8.gyp:v8_snapshot'], + }, { + 'dependencies': ['../tools/gyp/v8.gyp:v8_nosnapshot'], + }], + ], + 'include_dirs+': [ + '../src', ], 'sources': [ 'preparser-process.cc', + '../include/v8-preparser.h', + '../src/preparser-api.cc', ], }, ], diff --git a/src/preparser-api.cc b/src/preparser-api.cc index 03c2d67..f9c26c0 100644 --- a/src/preparser-api.cc +++ b/src/preparser-api.cc @@ -168,16 +168,6 @@ class InputStreamUtf16Buffer : public Utf16CharacterStream { unsigned pushback_buffer_backing_size_; }; - -// Functions declared by allocation.h and implemented in both api.cc (for v8) -// or here (for a stand-alone preparser). - -void FatalProcessOutOfMemory(const char* reason) { - V8_Fatal(__FILE__, __LINE__, reason); -} - -bool EnableSlowAsserts() { return true; } - } // namespace internal. @@ -204,9 +194,3 @@ PreParserData Preparse(UnicodeInputStream* input, size_t max_stack) { } } // namespace v8. - - -// Used by ASSERT macros and other immediate exits. -extern "C" void V8_Fatal(const char* file, int line, const char* format, ...) { - exit(EXIT_FAILURE); -} diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp index 68c9b93..5e7086b 100644 --- a/tools/gyp/v8.gyp +++ b/tools/gyp/v8.gyp @@ -927,73 +927,6 @@ }], ], }, - { - 'target_name': 'preparser_lib', - 'type': 'static_library', - 'include_dirs+': [ - '../../src', - ], - 'sources': [ - '../../include/v8-preparser.h', - '../../include/v8stdint.h', - '../../src/allocation.cc', - '../../src/allocation.h', - '../../src/atomicops.h', - '../../src/atomicops_internals_x86_gcc.cc', - '../../src/bignum.cc', - '../../src/bignum.h', - '../../src/bignum-dtoa.cc', - '../../src/bignum-dtoa.h', - '../../src/cached-powers.cc', - '../../src/cached-powers.h', - '../../src/char-predicates-inl.h', - '../../src/char-predicates.h', - '../../src/checks.h', - '../../src/conversions-inl.h', - '../../src/conversions.cc', - '../../src/conversions.h', - '../../src/diy-fp.cc', - '../../src/diy-fp.h', - '../../src/double.h', - '../../src/dtoa.cc', - '../../src/dtoa.h', - '../../src/fast-dtoa.cc', - '../../src/fast-dtoa.h', - '../../src/fixed-dtoa.cc', - '../../src/fixed-dtoa.h', - '../../src/globals.h', - '../../src/hashmap.h', - '../../src/list-inl.h', - '../../src/list.h', - '../../src/once.cc', - '../../src/once.h', - '../../src/preparse-data-format.h', - '../../src/preparse-data.cc', - '../../src/preparse-data.h', - '../../src/preparser.cc', - '../../src/preparser.h', - '../../src/preparser-api.cc', - '../../src/scanner.cc', - '../../src/scanner.h', - '../../src/strtod.cc', - '../../src/strtod.h', - '../../src/token.cc', - '../../src/token.h', - '../../src/unicode-inl.h', - '../../src/unicode.cc', - '../../src/unicode.h', - '../../src/utils-inl.h', - '../../src/utils.cc', - '../../src/utils.h', - ], - 'conditions': [ - ['OS=="win"', { - 'sources': [ - '../../src/win32-math.cc', - '../../src/win32-math.h', - ]}], - ], - }, ], }, { # use_system_v8 != 0 'targets': [