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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 17503002: Stop unwanted class finalization when using dart:io HttpClient from builtin.dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Block class finalization when calling into library tag handler Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 10692cfea006f363629203fd8091509d0a127cec..fc341821acef602b5eaa58d75803b28d4d613176 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -2966,17 +2966,9 @@ DART_EXPORT Dart_Handle Dart_Invoke(Dart_Handle target,
} else if (obj.IsLibrary()) {
// Check whether class finalization is needed.
- bool finalize_classes = true;
+ bool finalize_classes = isolate->AllowClassFinalization();
const Library& lib = Library::Cast(obj);
- // When calling functions in the dart:builtin library do not finalize as it
- // should have been prefinalized.
- Library& builtin =
- Library::Handle(isolate, isolate->object_store()->builtin_library());
- if (builtin.raw() == lib.raw()) {
- finalize_classes = false;
- }
-
// Finalize all classes if needed.
if (finalize_classes) {
Dart_Handle state = Api::CheckIsolateState(isolate);
@@ -3069,11 +3061,16 @@ DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name) {
RETURN_TYPE_ERROR(isolate, name, String);
}
- // Finalize all classes.
- Dart_Handle state = Api::CheckIsolateState(isolate);
- if (::Dart_IsError(state)) {
- return state;
+ bool finalize_classes = isolate->AllowClassFinalization();
+
+ if (finalize_classes) {
+ // Finalize all classes.
+ Dart_Handle state = Api::CheckIsolateState(isolate);
+ if (::Dart_IsError(state)) {
+ return state;
+ }
}
+
Field& field = Field::Handle(isolate);
Function& getter = Function::Handle(isolate);
const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(container));
« no previous file with comments | « no previous file | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698