39 #ifdef V8_USE_DEFAULT_PLATFORM
56 List<CallCompletedCallback>* V8::call_completed_callbacks_ =
NULL;
62 InitializeOncePerProcess();
76 i::Isolate::Current());
78 Isolate* isolate = Isolate::Current();
79 if (isolate->
IsDead())
return false;
82 #ifdef V8_USE_DEFAULT_PLATFORM
89 return isolate->
Init(des);
94 Isolate* isolate = Isolate::Current();
107 ExternalReference::TearDownMathExpData();
111 delete call_completed_callbacks_;
112 call_completed_callbacks_ =
NULL;
116 #ifdef V8_USE_DEFAULT_PLATFORM
126 StackFrame::SetReturnAddressLocationResolver(resolver);
131 if (call_completed_callbacks_ ==
NULL) {
134 for (
int i = 0; i < call_completed_callbacks_->length(); i++) {
135 if (callback == call_completed_callbacks_->
at(i))
return;
137 call_completed_callbacks_->
Add(callback);
142 if (call_completed_callbacks_ ==
NULL)
return;
143 for (
int i = 0; i < call_completed_callbacks_->length(); i++) {
144 if (callback == call_completed_callbacks_->
at(i)) {
145 call_completed_callbacks_->
Remove(i);
152 bool has_call_completed_callbacks = call_completed_callbacks_ !=
NULL;
153 bool run_microtasks = isolate->autorun_microtasks() &&
154 isolate->microtask_pending();
155 if (!has_call_completed_callbacks && !run_microtasks)
return;
163 if (has_call_completed_callbacks) {
164 for (
int i = 0; i < call_completed_callbacks_->length(); i++) {
165 call_completed_callbacks_->
at(i)();
173 if (!isolate->microtask_pending())
187 void V8::InitializeOncePerProcessImpl() {
188 FlagList::EnforceFlagImplications();
190 if (FLAG_predictable && FLAG_random_seed == 0) {
192 FLAG_random_seed = 12347;
195 if (FLAG_stress_compaction) {
196 FLAG_force_marking_deque_overflows =
true;
197 FLAG_gc_global =
true;
201 #ifdef V8_USE_DEFAULT_PLATFORM
202 platform_ =
new DefaultPlatform;
210 ExternalReference::SetUp();
215 void V8::InitializeOncePerProcess() {
216 CallOnce(&init_once, &InitializeOncePerProcessImpl);
223 platform_ = platform;
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
static bool Initialize(Deserializer *des)
void(* CallCompletedCallback)()
static void TearDownCaches()
HandleScopeImplementer * handle_scope_implementer()
V8_DECLARE_ONCE(initialize_gc_once)
static void FireCallCompletedCallback(Isolate *isolate)
void CallOnce(OnceType *once, NoArgFunction init_func)
static void ShutdownPlatform()
bool Init(Deserializer *des)
#define ASSERT(condition)
static PerIsolateThreadData * CurrentPerIsolateThreadData()
static void SetUpCaches()
bool IsDefaultIsolate() const
static ThreadId Current()
static void EnterDefaultIsolate()
void IncrementCallDepth()
uintptr_t(* ReturnAddressLocationResolver)(uintptr_t return_addr_location)
static void InitializeOncePerProcess()
static void RemoveCallCompletedCallback(CallCompletedCallback callback)
static void UnregisterAll()
static void GlobalTearDown()
void SetUpJSCallerSavedCodeData()
static void InitializeOncePerProcess()
static void AddCallCompletedCallback(CallCompletedCallback callback)
static void SetReturnAddressLocationResolver(ReturnAddressLocationResolver resolver)
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
static void InitializePlatform(v8::Platform *platform)
static void RunMicrotasks(Isolate *isolate)
void DecrementCallDepth()
static void RunMicrotasks(Isolate *isolate)
static v8::Platform * GetCurrentPlatform()
static void TearDownExtensions()