| 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 | |
| 41 #if V8_OS_WIN | 37 #if V8_OS_WIN |
| 42 #include <windows.h> // NOLINT | 38 #include <windows.h> // NOLINT |
| 43 #if V8_CC_MSVC | 39 #if V8_CC_MSVC |
| 44 #include <crtdbg.h> | 40 #include <crtdbg.h> |
| 45 #endif | 41 #endif |
| 46 #endif | 42 #endif |
| 47 | 43 |
| 48 enum InitializationState {kUnset, kUnintialized, kInitialized}; | 44 enum InitializationState {kUnset, kUnintialized, kInitialized}; |
| 49 static InitializationState initialization_state_ = kUnset; | 45 static InitializationState initialization_state_ = kUnset; |
| 50 static bool disable_automatic_dispose_ = false; | 46 static bool disable_automatic_dispose_ = false; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); | 162 _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); |
| 167 _set_error_mode(_OUT_TO_STDERR); | 163 _set_error_mode(_OUT_TO_STDERR); |
| 168 #endif // V8_CC_MSVC | 164 #endif // V8_CC_MSVC |
| 169 #endif // V8_OS_WIN | 165 #endif // V8_OS_WIN |
| 170 | 166 |
| 171 v8::V8::InitializeICU(); | 167 v8::V8::InitializeICU(); |
| 172 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); | 168 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); |
| 173 v8::V8::InitializePlatform(platform); | 169 v8::V8::InitializePlatform(platform); |
| 174 v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true); | 170 v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
| 175 v8::V8::Initialize(); | 171 v8::V8::Initialize(); |
| 176 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 172 v8::V8::InitializeExternalStartupData(argv[0]); |
| 177 v8::StartupDataHandler startup_data(argv[0], NULL, NULL); | |
| 178 #endif | |
| 179 | 173 |
| 180 CcTestArrayBufferAllocator array_buffer_allocator; | 174 CcTestArrayBufferAllocator array_buffer_allocator; |
| 181 CcTest::set_array_buffer_allocator(&array_buffer_allocator); | 175 CcTest::set_array_buffer_allocator(&array_buffer_allocator); |
| 182 | 176 |
| 183 i::PrintExtension print_extension; | 177 i::PrintExtension print_extension; |
| 184 v8::RegisterExtension(&print_extension); | 178 v8::RegisterExtension(&print_extension); |
| 185 i::ProfilerExtension profiler_extension; | 179 i::ProfilerExtension profiler_extension; |
| 186 v8::RegisterExtension(&profiler_extension); | 180 v8::RegisterExtension(&profiler_extension); |
| 187 i::TraceExtension trace_extension; | 181 i::TraceExtension trace_extension; |
| 188 v8::RegisterExtension(&trace_extension); | 182 v8::RegisterExtension(&trace_extension); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 CcTest::TearDown(); | 231 CcTest::TearDown(); |
| 238 // TODO(svenpanne) See comment above. | 232 // TODO(svenpanne) See comment above. |
| 239 // if (!disable_automatic_dispose_) v8::V8::Dispose(); | 233 // if (!disable_automatic_dispose_) v8::V8::Dispose(); |
| 240 v8::V8::ShutdownPlatform(); | 234 v8::V8::ShutdownPlatform(); |
| 241 delete platform; | 235 delete platform; |
| 242 return 0; | 236 return 0; |
| 243 } | 237 } |
| 244 | 238 |
| 245 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; | 239 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; |
| 246 int RegisterThreadedTest::count_ = 0; | 240 int RegisterThreadedTest::count_ = 0; |
| OLD | NEW |