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

Side by Side Diff: runtime/lib/isolate.cc

Issue 1541073002: Implement safepointing of threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: self-review-comments Created 4 years, 11 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
« no previous file with comments | « no previous file | runtime/lib/vmservice.cc » ('j') | runtime/vm/dart_api_impl.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "include/dart_native_api.h" 5 #include "include/dart_native_api.h"
6 #include "platform/assert.h" 6 #include "platform/assert.h"
7 #include "vm/bootstrap_natives.h" 7 #include "vm/bootstrap_natives.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/dart.h" 9 #include "vm/dart.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 static const char* CanonicalizeUri(Thread* thread, 270 static const char* CanonicalizeUri(Thread* thread,
271 const Library& library, 271 const Library& library,
272 const String& uri, 272 const String& uri,
273 char** error) { 273 char** error) {
274 const char* result = NULL; 274 const char* result = NULL;
275 Zone* zone = thread->zone(); 275 Zone* zone = thread->zone();
276 Isolate* isolate = thread->isolate(); 276 Isolate* isolate = thread->isolate();
277 Dart_LibraryTagHandler handler = isolate->library_tag_handler(); 277 Dart_LibraryTagHandler handler = isolate->library_tag_handler();
278 if (handler != NULL) { 278 if (handler != NULL) {
279 TransitionVMToNative transition(thread);
279 Dart_EnterScope(); 280 Dart_EnterScope();
280 Dart_Handle handle = handler(Dart_kCanonicalizeUrl, 281 Dart_Handle handle = handler(Dart_kCanonicalizeUrl,
281 Api::NewHandle(thread, library.raw()), 282 Api::NewHandle(thread, library.raw()),
282 Api::NewHandle(thread, uri.raw())); 283 Api::NewHandle(thread, uri.raw()));
283 const Object& obj = Object::Handle(Api::UnwrapHandle(handle)); 284 const Object& obj = Object::Handle(Api::UnwrapHandle(handle));
284 if (obj.IsString()) { 285 if (obj.IsString()) {
285 result = String2UTF8(String::Cast(obj)); 286 result = String2UTF8(String::Cast(obj));
286 } else if (obj.IsError()) { 287 } else if (obj.IsError()) {
287 Error& error_obj = Error::Handle(); 288 Error& error_obj = Error::Handle();
288 error_obj ^= obj.raw(); 289 error_obj ^= obj.raw();
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 MessageWriter writer(&data, &allocator, false); 425 MessageWriter writer(&data, &allocator, false);
425 writer.WriteMessage(msg); 426 writer.WriteMessage(msg);
426 427
427 PortMap::PostMessage(new Message(port.Id(), 428 PortMap::PostMessage(new Message(port.Id(),
428 data, writer.BytesWritten(), 429 data, writer.BytesWritten(),
429 Message::kOOBPriority)); 430 Message::kOOBPriority));
430 return Object::null(); 431 return Object::null();
431 } 432 }
432 433
433 } // namespace dart 434 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/vmservice.cc » ('j') | runtime/vm/dart_api_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698