OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "serialize.h" | 45 #include "serialize.h" |
46 #include "store-buffer.h" | 46 #include "store-buffer.h" |
47 | 47 |
48 namespace v8 { | 48 namespace v8 { |
49 namespace internal { | 49 namespace internal { |
50 | 50 |
51 V8_DECLARE_ONCE(init_once); | 51 V8_DECLARE_ONCE(init_once); |
52 | 52 |
53 List<CallCompletedCallback>* V8::call_completed_callbacks_ = NULL; | 53 List<CallCompletedCallback>* V8::call_completed_callbacks_ = NULL; |
54 v8::ArrayBuffer::Allocator* V8::array_buffer_allocator_ = NULL; | 54 v8::ArrayBuffer::Allocator* V8::array_buffer_allocator_ = NULL; |
55 v8::Platform* V8::platform_ = NULL; | |
56 | 55 |
57 | 56 |
58 bool V8::Initialize(Deserializer* des) { | 57 bool V8::Initialize(Deserializer* des) { |
59 InitializeOncePerProcess(); | 58 InitializeOncePerProcess(); |
60 | 59 |
61 // The current thread may not yet had entered an isolate to run. | 60 // The current thread may not yet had entered an isolate to run. |
62 // Note the Isolate::Current() may be non-null because for various | 61 // Note the Isolate::Current() may be non-null because for various |
63 // initialization purposes an initializing thread may be assigned an isolate | 62 // initialization purposes an initializing thread may be assigned an isolate |
64 // but not actually enter it. | 63 // but not actually enter it. |
65 if (i::Isolate::CurrentPerIsolateThreadData() == NULL) { | 64 if (i::Isolate::CurrentPerIsolateThreadData() == NULL) { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 SetUpJSCallerSavedCodeData(); | 187 SetUpJSCallerSavedCodeData(); |
189 ExternalReference::SetUp(); | 188 ExternalReference::SetUp(); |
190 Bootstrapper::InitializeOncePerProcess(); | 189 Bootstrapper::InitializeOncePerProcess(); |
191 } | 190 } |
192 | 191 |
193 | 192 |
194 void V8::InitializeOncePerProcess() { | 193 void V8::InitializeOncePerProcess() { |
195 CallOnce(&init_once, &InitializeOncePerProcessImpl); | 194 CallOnce(&init_once, &InitializeOncePerProcessImpl); |
196 } | 195 } |
197 | 196 |
198 | |
199 void V8::InitializePlatform(v8::Platform* platform) { | |
200 ASSERT(platform); | |
201 platform_ = platform; | |
202 } | |
203 | |
204 | |
205 void V8::ShutdownPlatform() { | |
206 ASSERT(platform_); | |
207 platform_ = NULL; | |
208 } | |
209 | |
210 | |
211 v8::Platform* V8::GetCurrentPlatform() { | |
212 ASSERT(platform_); | |
213 return platform_; | |
214 } | |
215 | |
216 } } // namespace v8::internal | 197 } } // namespace v8::internal |
OLD | NEW |