| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #include "include/v8.h" | 28 #include "include/v8.h" |
| 29 #include "test/cctest/cctest.h" | 29 #include "test/cctest/cctest.h" |
| 30 | 30 |
| 31 #include "include/libplatform/libplatform.h" | 31 #include "include/libplatform/libplatform.h" |
| 32 #include "src/debug.h" | 32 #include "src/debug.h" |
| 33 #include "test/cctest/print-extension.h" | 33 #include "test/cctest/print-extension.h" |
| 34 #include "test/cctest/profiler-extension.h" | 34 #include "test/cctest/profiler-extension.h" |
| 35 #include "test/cctest/trace-extension.h" | 35 #include "test/cctest/trace-extension.h" |
| 36 | 36 |
| 37 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 38 #include "src/startup-data-util.h" |
| 39 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 40 |
| 37 #if V8_OS_WIN | 41 #if V8_OS_WIN |
| 38 #include <windows.h> // NOLINT | 42 #include <windows.h> // NOLINT |
| 39 #if V8_CC_MSVC | 43 #if V8_CC_MSVC |
| 40 #include <crtdbg.h> | 44 #include <crtdbg.h> |
| 41 #endif | 45 #endif |
| 42 #endif | 46 #endif |
| 43 | 47 |
| 44 enum InitializationState {kUnset, kUnintialized, kInitialized}; | 48 enum InitializationState {kUnset, kUnintialized, kInitialized}; |
| 45 static InitializationState initialization_state_ = kUnset; | 49 static InitializationState initialization_state_ = kUnset; |
| 46 static bool disable_automatic_dispose_ = false; | 50 static bool disable_automatic_dispose_ = false; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); | 163 _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); |
| 160 _set_error_mode(_OUT_TO_STDERR); | 164 _set_error_mode(_OUT_TO_STDERR); |
| 161 #endif // V8_CC_MSVC | 165 #endif // V8_CC_MSVC |
| 162 #endif // V8_OS_WIN | 166 #endif // V8_OS_WIN |
| 163 | 167 |
| 164 v8::V8::InitializeICU(); | 168 v8::V8::InitializeICU(); |
| 165 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); | 169 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); |
| 166 v8::V8::InitializePlatform(platform); | 170 v8::V8::InitializePlatform(platform); |
| 167 v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true); | 171 v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
| 168 v8::V8::Initialize(); | 172 v8::V8::Initialize(); |
| 173 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 174 v8::StartupDataHandler startup_data(argv[0], NULL, NULL); |
| 175 #endif |
| 169 | 176 |
| 170 CcTestArrayBufferAllocator array_buffer_allocator; | 177 CcTestArrayBufferAllocator array_buffer_allocator; |
| 171 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); | 178 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); |
| 172 | 179 |
| 173 i::PrintExtension print_extension; | 180 i::PrintExtension print_extension; |
| 174 v8::RegisterExtension(&print_extension); | 181 v8::RegisterExtension(&print_extension); |
| 175 i::ProfilerExtension profiler_extension; | 182 i::ProfilerExtension profiler_extension; |
| 176 v8::RegisterExtension(&profiler_extension); | 183 v8::RegisterExtension(&profiler_extension); |
| 177 i::TraceExtension trace_extension; | 184 i::TraceExtension trace_extension; |
| 178 v8::RegisterExtension(&trace_extension); | 185 v8::RegisterExtension(&trace_extension); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 CcTest::TearDown(); | 234 CcTest::TearDown(); |
| 228 // TODO(svenpanne) See comment above. | 235 // TODO(svenpanne) See comment above. |
| 229 // if (!disable_automatic_dispose_) v8::V8::Dispose(); | 236 // if (!disable_automatic_dispose_) v8::V8::Dispose(); |
| 230 v8::V8::ShutdownPlatform(); | 237 v8::V8::ShutdownPlatform(); |
| 231 delete platform; | 238 delete platform; |
| 232 return 0; | 239 return 0; |
| 233 } | 240 } |
| 234 | 241 |
| 235 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; | 242 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; |
| 236 int RegisterThreadedTest::count_ = 0; | 243 int RegisterThreadedTest::count_ = 0; |
| OLD | NEW |