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

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

Issue 1152833002: Add a runtime flag to control availability of dart:mirrors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 5448 matching lines...) Expand 10 before | Expand all | Expand 10 after
5459 // Now that the newly loaded classes are finalized, notify the debugger 5459 // Now that the newly loaded classes are finalized, notify the debugger
5460 // that new code has been loaded. If there are latent breakpoints in 5460 // that new code has been loaded. If there are latent breakpoints in
5461 // the new code, the debugger convert them to unresolved source breakpoints. 5461 // the new code, the debugger convert them to unresolved source breakpoints.
5462 // The code that completes the futures (invoked below) may call into the 5462 // The code that completes the futures (invoked below) may call into the
5463 // newly loaded code and trigger one of these breakpoints. 5463 // newly loaded code and trigger one of these breakpoints.
5464 isolate->debugger()->NotifyDoneLoading(); 5464 isolate->debugger()->NotifyDoneLoading();
5465 5465
5466 // Notify mirrors that MirrorSystem.libraries needs to be recomputed. 5466 // Notify mirrors that MirrorSystem.libraries needs to be recomputed.
5467 const Library& libmirrors = 5467 const Library& libmirrors =
5468 Library::Handle(isolate, Library::MirrorsLibrary()); 5468 Library::Handle(isolate, Library::MirrorsLibrary());
5469 const Field& dirty_bit = Field::Handle(isolate, 5469 if (!libmirrors.IsNull()) {
Ivan Posva 2015/05/29 06:02:25 Here we are not relying on the flag being set, but
5470 libmirrors.LookupLocalField(String::Handle(String::New("dirty")))); 5470 const Field& dirty_bit = Field::Handle(isolate,
5471 ASSERT(!dirty_bit.IsNull() && dirty_bit.is_static()); 5471 libmirrors.LookupLocalField(String::Handle(String::New("dirty"))));
5472 dirty_bit.set_value(Bool::True()); 5472 ASSERT(!dirty_bit.IsNull() && dirty_bit.is_static());
5473 dirty_bit.set_value(Bool::True());
5474 }
5473 5475
5474 if (complete_futures) { 5476 if (complete_futures) {
5475 const Library& corelib = Library::Handle(isolate, Library::CoreLibrary()); 5477 const Library& corelib = Library::Handle(isolate, Library::CoreLibrary());
5476 const String& function_name = 5478 const String& function_name =
5477 String::Handle(isolate, String::New("_completeDeferredLoads")); 5479 String::Handle(isolate, String::New("_completeDeferredLoads"));
5478 const Function& function = 5480 const Function& function =
5479 Function::Handle(isolate, 5481 Function::Handle(isolate,
5480 corelib.LookupFunctionAllowPrivate(function_name)); 5482 corelib.LookupFunctionAllowPrivate(function_name));
5481 ASSERT(!function.IsNull()); 5483 ASSERT(!function.IsNull());
5482 const Array& args = Array::empty_array(); 5484 const Array& args = Array::empty_array();
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
5575 5577
5576 5578
5577 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( 5579 DART_EXPORT void Dart_RegisterRootServiceRequestCallback(
5578 const char* name, 5580 const char* name,
5579 Dart_ServiceRequestCallback callback, 5581 Dart_ServiceRequestCallback callback,
5580 void* user_data) { 5582 void* user_data) {
5581 Service::RegisterRootEmbedderCallback(name, callback, user_data); 5583 Service::RegisterRootEmbedderCallback(name, callback, user_data);
5582 } 5584 }
5583 5585
5584 } // namespace dart 5586 } // namespace dart
OLDNEW
« runtime/vm/dart.cc ('K') | « runtime/vm/dart.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698