Enable harmony_typed_arrays for shared build of d8.
authordslomov@chromium.org <dslomov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 13 May 2013 16:32:32 +0000 (16:32 +0000)
committerdslomov@chromium.org <dslomov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 13 May 2013 16:32:32 +0000 (16:32 +0000)
R=mstarzinger@chromium.org

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

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

src/d8.cc

index 92f2dd7..7ac78cc 100644 (file)
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -2167,11 +2167,26 @@ int Shell::RunMain(Isolate* isolate, int argc, char* argv[]) {
 }
 
 
+#ifdef V8_SHARED
+static void EnableHarmonyTypedArraysViaCommandLine() {
+  int fake_argc = 2;
+  char **fake_argv = new char*[2];
+  fake_argv[0] = NULL;
+  fake_argv[1] = strdup("--harmony-typed-arrays");
+  v8::V8::SetFlagsFromCommandLine(&fake_argc, fake_argv, false);
+  free(fake_argv[1]);
+  delete[] fake_argv;
+}
+#endif
+
+
 int Shell::Main(int argc, char* argv[]) {
   if (!SetOptions(argc, argv)) return 1;
 #ifndef V8_SHARED
   i::FLAG_harmony_array_buffer = true;
   i::FLAG_harmony_typed_arrays = true;
+#else
+  EnableHarmonyTypedArraysViaCommandLine();
 #endif
   int result = 0;
   Isolate* isolate = Isolate::GetCurrent();