Remove preparser library; link preparser executable against full V8
authorjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 12 Apr 2013 09:05:49 +0000 (09:05 +0000)
committerjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 12 Apr 2013 09:05:49 +0000 (09:05 +0000)
Review URL: https://codereview.chromium.org/13880018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14244 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

preparser/preparser-process.cc
preparser/preparser.gyp
src/preparser-api.cc
tools/gyp/v8.gyp

index 1bcc804..b816744 100644 (file)
@@ -30,6 +30,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#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<uint8_t> buffer;
   size_t length;
 
index 0b03382..2dcbaf9 100644 (file)
     {
       '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',
       ],
     },
   ],
index 03c2d67..f9c26c0 100644 (file)
@@ -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);
-}
index 68c9b93..5e7086b 100644 (file)
             }],
           ],
         },
-        {
-          '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': [