| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/assembler.h" | 7 #include "src/assembler.h" |
| 8 #include "src/base/once.h" | 8 #include "src/base/once.h" |
| 9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 platform_ = NULL; | 119 platform_ = NULL; |
| 120 } | 120 } |
| 121 | 121 |
| 122 | 122 |
| 123 v8::Platform* V8::GetCurrentPlatform() { | 123 v8::Platform* V8::GetCurrentPlatform() { |
| 124 DCHECK(platform_); | 124 DCHECK(platform_); |
| 125 return platform_; | 125 return platform_; |
| 126 } | 126 } |
| 127 | 127 |
| 128 | 128 |
| 129 void V8::SetPlatformForTesting(v8::Platform* platform) { platform_ = platform; } |
| 130 |
| 131 |
| 129 void V8::SetNativesBlob(StartupData* natives_blob) { | 132 void V8::SetNativesBlob(StartupData* natives_blob) { |
| 130 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 133 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 131 base::CallOnce(&init_natives_once, &SetNativesFromFile, natives_blob); | 134 base::CallOnce(&init_natives_once, &SetNativesFromFile, natives_blob); |
| 132 #else | 135 #else |
| 133 CHECK(false); | 136 CHECK(false); |
| 134 #endif | 137 #endif |
| 135 } | 138 } |
| 136 | 139 |
| 137 | 140 |
| 138 void V8::SetSnapshotBlob(StartupData* snapshot_blob) { | 141 void V8::SetSnapshotBlob(StartupData* snapshot_blob) { |
| 139 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 142 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 140 base::CallOnce(&init_snapshot_once, &SetSnapshotFromFile, snapshot_blob); | 143 base::CallOnce(&init_snapshot_once, &SetSnapshotFromFile, snapshot_blob); |
| 141 #else | 144 #else |
| 142 CHECK(false); | 145 CHECK(false); |
| 143 #endif | 146 #endif |
| 144 } | 147 } |
| 145 } // namespace internal | 148 } // namespace internal |
| 146 } // namespace v8 | 149 } // namespace v8 |
| OLD | NEW |