Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1170)

Side by Side Diff: runtime/vm/dart.cc

Issue 8713012: Introduce Dart_SetVMFlags API function. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/dart.h" 5 #include "vm/dart.h"
6 6
7 #include "vm/code_index_table.h" 7 #include "vm/code_index_table.h"
8 #include "vm/flags.h" 8 #include "vm/flags.h"
9 #include "vm/handles.h" 9 #include "vm/handles.h"
10 #include "vm/heap.h" 10 #include "vm/heap.h"
11 #include "vm/isolate.h" 11 #include "vm/isolate.h"
12 #include "vm/longjump.h" 12 #include "vm/longjump.h"
13 #include "vm/object.h" 13 #include "vm/object.h"
14 #include "vm/object_store.h" 14 #include "vm/object_store.h"
15 #include "vm/port.h" 15 #include "vm/port.h"
16 #include "vm/snapshot.h" 16 #include "vm/snapshot.h"
17 #include "vm/stub_code.h" 17 #include "vm/stub_code.h"
18 #include "vm/virtual_memory.h" 18 #include "vm/virtual_memory.h"
19 #include "vm/zone.h" 19 #include "vm/zone.h"
20 20
21 namespace dart { 21 namespace dart {
22 22
23 Isolate* Dart::vm_isolate_ = NULL; 23 Isolate* Dart::vm_isolate_ = NULL;
24 DebugInfo* Dart::pprof_symbol_generator_ = NULL; 24 DebugInfo* Dart::pprof_symbol_generator_ = NULL;
25 25
26 bool Dart::InitOnce(int argc, const char** argv, 26 bool Dart::InitOnce(Dart_IsolateInitCallback callback) {
27 Dart_IsolateInitCallback callback) {
28 // TODO(iposva): Fix race condition here. 27 // TODO(iposva): Fix race condition here.
29 if (vm_isolate_ != NULL) { 28 if (vm_isolate_ != NULL) {
30 return false; 29 return false;
31 } 30 }
32 OS::InitOnce(); 31 OS::InitOnce();
33 Flags::ProcessCommandLineFlags(argc, argv);
34 VirtualMemory::InitOnce(); 32 VirtualMemory::InitOnce();
35 Isolate::InitOnce(); 33 Isolate::InitOnce();
36 // Create the VM isolate and finish the VM initialization. 34 // Create the VM isolate and finish the VM initialization.
37 { 35 {
38 ASSERT(vm_isolate_ == NULL); 36 ASSERT(vm_isolate_ == NULL);
39 vm_isolate_ = Isolate::Init(); 37 vm_isolate_ = Isolate::Init();
40 Zone zone(vm_isolate_); 38 Zone zone(vm_isolate_);
41 HandleScope handle_scope(vm_isolate_); 39 HandleScope handle_scope(vm_isolate_);
42 Heap::Init(vm_isolate_); 40 Heap::Init(vm_isolate_);
43 ObjectStore::Init(vm_isolate_); 41 ObjectStore::Init(vm_isolate_);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 91 }
94 92
95 93
96 void Dart::ShutdownIsolate() { 94 void Dart::ShutdownIsolate() {
97 Isolate* isolate = Isolate::Current(); 95 Isolate* isolate = Isolate::Current();
98 isolate->Shutdown(); 96 isolate->Shutdown();
99 delete isolate; 97 delete isolate;
100 } 98 }
101 99
102 } // namespace dart 100 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/dart_api_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698