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

Side by Side Diff: vm/dart.cc

Issue 8787012: - Add free list to be used for sweep phase of mark-sweep collector. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
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
« no previous file with comments | « no previous file | vm/freelist.h » ('j') | vm/freelist.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/freelist.h"
antonm 2011/12/15 10:00:25 nit: sorting
Ivan Posva 2011/12/16 23:22:14 Done.
8 #include "vm/flags.h" 9 #include "vm/flags.h"
9 #include "vm/handles.h" 10 #include "vm/handles.h"
10 #include "vm/heap.h" 11 #include "vm/heap.h"
11 #include "vm/isolate.h" 12 #include "vm/isolate.h"
12 #include "vm/longjump.h" 13 #include "vm/longjump.h"
13 #include "vm/object.h" 14 #include "vm/object.h"
14 #include "vm/object_store.h" 15 #include "vm/object_store.h"
15 #include "vm/port.h" 16 #include "vm/port.h"
16 #include "vm/snapshot.h" 17 #include "vm/snapshot.h"
17 #include "vm/stub_code.h" 18 #include "vm/stub_code.h"
18 #include "vm/virtual_memory.h" 19 #include "vm/virtual_memory.h"
19 #include "vm/zone.h" 20 #include "vm/zone.h"
20 21
21 namespace dart { 22 namespace dart {
22 23
23 Isolate* Dart::vm_isolate_ = NULL; 24 Isolate* Dart::vm_isolate_ = NULL;
24 DebugInfo* Dart::pprof_symbol_generator_ = NULL; 25 DebugInfo* Dart::pprof_symbol_generator_ = NULL;
25 26
26 bool Dart::InitOnce(Dart_IsolateCreateCallback callback) { 27 bool Dart::InitOnce(Dart_IsolateCreateCallback callback) {
27 // TODO(iposva): Fix race condition here. 28 // TODO(iposva): Fix race condition here.
28 if (vm_isolate_ != NULL || !Flags::Initialized()) { 29 if (vm_isolate_ != NULL || !Flags::Initialized()) {
29 return false; 30 return false;
30 } 31 }
31 OS::InitOnce(); 32 OS::InitOnce();
32 VirtualMemory::InitOnce(); 33 VirtualMemory::InitOnce();
33 Isolate::InitOnce(); 34 Isolate::InitOnce();
34 PortMap::InitOnce(); 35 PortMap::InitOnce();
36 FreeListElement::InitOnce();
35 // Create the VM isolate and finish the VM initialization. 37 // Create the VM isolate and finish the VM initialization.
36 { 38 {
37 ASSERT(vm_isolate_ == NULL); 39 ASSERT(vm_isolate_ == NULL);
38 ASSERT(Flags::Initialized()); 40 ASSERT(Flags::Initialized());
39 vm_isolate_ = Isolate::Init(); 41 vm_isolate_ = Isolate::Init();
40 Zone zone(vm_isolate_); 42 Zone zone(vm_isolate_);
41 HandleScope handle_scope(vm_isolate_); 43 HandleScope handle_scope(vm_isolate_);
42 Heap::Init(vm_isolate_); 44 Heap::Init(vm_isolate_);
43 ObjectStore::Init(vm_isolate_); 45 ObjectStore::Init(vm_isolate_);
44 Object::InitOnce(); 46 Object::InitOnce();
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 89 }
88 90
89 91
90 void Dart::ShutdownIsolate() { 92 void Dart::ShutdownIsolate() {
91 Isolate* isolate = Isolate::Current(); 93 Isolate* isolate = Isolate::Current();
92 isolate->Shutdown(); 94 isolate->Shutdown();
93 delete isolate; 95 delete isolate;
94 } 96 }
95 97
96 } // namespace dart 98 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | vm/freelist.h » ('j') | vm/freelist.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698