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

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

Issue 1259893006: Hack around dart:io being loaded into non-service isolates in Dartium. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | tests/lib/mirrors/io_html_mutual_exclusion_test.dart » ('j') | no next file with comments »
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 "lib/mirrors.h" 5 #include "lib/mirrors.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/bootstrap_natives.h" 8 #include "vm/bootstrap_natives.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 const Array& args = Array::Handle(Array::New(3)); 377 const Array& args = Array::Handle(Array::New(3));
378 args.SetAt(0, MirrorReference::Handle(MirrorReference::New(lib))); 378 args.SetAt(0, MirrorReference::Handle(MirrorReference::New(lib)));
379 String& str = String::Handle(); 379 String& str = String::Handle();
380 str = lib.name(); 380 str = lib.name();
381 args.SetAt(1, str); 381 args.SetAt(1, str);
382 str = lib.url(); 382 str = lib.url();
383 if (str.Equals("dart:_builtin") || str.Equals("dart:_blink")) { 383 if (str.Equals("dart:_builtin") || str.Equals("dart:_blink")) {
384 // Censored library (grumble). 384 // Censored library (grumble).
385 return Instance::null(); 385 return Instance::null();
386 } 386 }
387 if (str.Equals("dart:io")) {
388 // Hack around dart:io being loaded into non-service isolates in Dartium.
389 Isolate* isolate = Isolate::Current();
siva 2015/08/03 23:37:21 We are trying to deprecate the Isolate api when cr
rmacnak 2015/08/03 23:59:20 Done.
390 const GrowableObjectArray& libraries = GrowableObjectArray::Handle(
391 isolate, isolate->object_store()->libraries());
392 Library& other_lib = Library::Handle(isolate);
393 String& other_uri = String::Handle(isolate);
394 for (intptr_t i = 0; i < libraries.Length(); i++) {
395 other_lib ^= libraries.At(i);
396 other_uri = other_lib.url();
397 if (other_uri.Equals("dart:html")) {
398 return Instance::null();
399 }
400 }
401 }
387 args.SetAt(2, str); 402 args.SetAt(2, str);
388 return CreateMirror(Symbols::_LocalLibraryMirror(), args); 403 return CreateMirror(Symbols::_LocalLibraryMirror(), args);
389 } 404 }
390 405
391 406
392 static RawInstance* CreateCombinatorMirror(const Object& identifiers, 407 static RawInstance* CreateCombinatorMirror(const Object& identifiers,
393 bool is_show) { 408 bool is_show) {
394 const Array& args = Array::Handle(Array::New(2)); 409 const Array& args = Array::Handle(Array::New(2));
395 args.SetAt(0, identifiers); 410 args.SetAt(0, identifiers);
396 args.SetAt(1, Bool::Get(is_show)); 411 args.SetAt(1, Bool::Get(is_show));
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after
2080 } 2095 }
2081 2096
2082 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { 2097 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) {
2083 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); 2098 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0));
2084 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); 2099 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1));
2085 return Bool::Get(a.IsSubtypeOf(b, NULL)).raw(); 2100 return Bool::Get(a.IsSubtypeOf(b, NULL)).raw();
2086 } 2101 }
2087 2102
2088 2103
2089 } // namespace dart 2104 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/lib/mirrors/io_html_mutual_exclusion_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698