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

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

Issue 15772005: - Add different types for persistent and weak persistent handles (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 months 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_observers.h" 7 #include "vm/code_observers.h"
8 #include "vm/dart_api_state.h" 8 #include "vm/dart_api_state.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) 121 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
122 // Dart VM requires at least SSE2. 122 // Dart VM requires at least SSE2.
123 if (!CPUFeatures::sse2_supported()) { 123 if (!CPUFeatures::sse2_supported()) {
124 return "SSE2 is required."; 124 return "SSE2 is required.";
125 } 125 }
126 #endif 126 #endif
127 PremarkingVisitor premarker(vm_isolate_); 127 PremarkingVisitor premarker(vm_isolate_);
128 vm_isolate_->heap()->IterateOldObjects(&premarker); 128 vm_isolate_->heap()->IterateOldObjects(&premarker);
129 vm_isolate_->heap()->WriteProtect(true); 129 vm_isolate_->heap()->WriteProtect(true);
130 } 130 }
131 // There is a planned and known asymmetry here: We enter one scope for the VM
132 // isolate so that we can allocate the "persistent" scoped handles for the
133 // predefined API values (such as Dart_True, Dart_False and Dart_Null).
134 Dart_EnterScope();
135 Api::InitHandles();
136
siva 2013/05/28 17:37:18 At some point we should add Dart::Cleanup function
131 Isolate::SetCurrent(NULL); // Unregister the VM isolate from this thread. 137 Isolate::SetCurrent(NULL); // Unregister the VM isolate from this thread.
132 Isolate::SetCreateCallback(create); 138 Isolate::SetCreateCallback(create);
133 Isolate::SetInterruptCallback(interrupt); 139 Isolate::SetInterruptCallback(interrupt);
134 Isolate::SetUnhandledExceptionCallback(unhandled); 140 Isolate::SetUnhandledExceptionCallback(unhandled);
135 Isolate::SetShutdownCallback(shutdown); 141 Isolate::SetShutdownCallback(shutdown);
136 return NULL; 142 return NULL;
137 } 143 }
138 144
139 145
140 Isolate* Dart::CreateIsolate(const char* name_prefix) { 146 Isolate* Dart::CreateIsolate(const char* name_prefix) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 return predefined_handles_->handles_.AllocateScopedHandle(); 224 return predefined_handles_->handles_.AllocateScopedHandle();
219 } 225 }
220 226
221 227
222 bool Dart::IsReadOnlyHandle(uword address) { 228 bool Dart::IsReadOnlyHandle(uword address) {
223 ASSERT(predefined_handles_ != NULL); 229 ASSERT(predefined_handles_ != NULL);
224 return predefined_handles_->handles_.IsValidScopedHandle(address); 230 return predefined_handles_->handles_.IsValidScopedHandle(address);
225 } 231 }
226 232
227 } // namespace dart 233 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698