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

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

Issue 1541073002: Implement safepointing of threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix-tests Created 4 years, 10 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/bootstrap.h" 5 #include "vm/bootstrap.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/bootstrap_natives.h" 9 #include "vm/bootstrap_natives.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 const Error& error = Error::Handle(zone, Compile(lib, part_script)); 202 const Error& error = Error::Handle(zone, Compile(lib, part_script));
203 return Api::NewHandle(thread, error.raw()); 203 return Api::NewHandle(thread, error.raw());
204 } 204 }
205 205
206 206
207 static Dart_Handle BootstrapLibraryTagHandler(Dart_LibraryTag tag, 207 static Dart_Handle BootstrapLibraryTagHandler(Dart_LibraryTag tag,
208 Dart_Handle library, 208 Dart_Handle library,
209 Dart_Handle uri) { 209 Dart_Handle uri) {
210 Thread* thread = Thread::Current(); 210 Thread* thread = Thread::Current();
211 Zone* zone = thread->zone(); 211 Zone* zone = thread->zone();
212 // This handler calls into the VM directly and does not use the Dart
213 // API so we transition back to VM.
214 TransitionNativeToVM transition(thread);
212 if (!Dart_IsLibrary(library)) { 215 if (!Dart_IsLibrary(library)) {
213 return Api::NewError("not a library"); 216 return Api::NewError("not a library");
214 } 217 }
215 if (!Dart_IsString(uri)) { 218 if (!Dart_IsString(uri)) {
216 return Api::NewError("uri is not a string"); 219 return Api::NewError("uri is not a string");
217 } 220 }
218 if (tag == Dart_kCanonicalizeUrl) { 221 if (tag == Dart_kCanonicalizeUrl) {
219 // In the bootstrap loader we do not try and do any canonicalization. 222 // In the bootstrap loader we do not try and do any canonicalization.
220 return uri; 223 return uri;
221 } 224 }
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 Compiler::CompileClass(cls); 350 Compiler::CompileClass(cls);
348 } 351 }
349 352
350 // Restore the library tag handler for the isolate. 353 // Restore the library tag handler for the isolate.
351 isolate->set_library_tag_handler(saved_tag_handler); 354 isolate->set_library_tag_handler(saved_tag_handler);
352 355
353 return error.raw(); 356 return error.raw();
354 } 357 }
355 358
356 } // namespace dart 359 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698