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

Side by Side Diff: runtime/vm/parser.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 unified diff | Download patch | Annotate | Revision Log
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/isolate.cc ('k') | no next file » | 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 "vm/parser.h" 5 #include "vm/parser.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 4360 matching lines...) Expand 10 before | Expand all | Expand 10 after
4371 Dart_LibraryTagHandler handler = isolate()->library_tag_handler(); 4371 Dart_LibraryTagHandler handler = isolate()->library_tag_handler();
4372 if (handler == NULL) { 4372 if (handler == NULL) {
4373 if (url.StartsWith(Symbols::DartScheme())) { 4373 if (url.StartsWith(Symbols::DartScheme())) {
4374 if (tag == Dart_kCanonicalizeUrl) { 4374 if (tag == Dart_kCanonicalizeUrl) {
4375 return url.raw(); 4375 return url.raw();
4376 } 4376 }
4377 return Object::null(); 4377 return Object::null();
4378 } 4378 }
4379 ErrorMsg(token_pos, "no library handler registered"); 4379 ErrorMsg(token_pos, "no library handler registered");
4380 } 4380 }
4381 // Block class finalization attempts when calling into the library
4382 // tag handler.
4383 isolate()->BlockClassFinalization();
4381 Dart_Handle result = handler(tag, 4384 Dart_Handle result = handler(tag,
4382 Api::NewHandle(isolate(), library_.raw()), 4385 Api::NewHandle(isolate(), library_.raw()),
4383 Api::NewHandle(isolate(), url.raw())); 4386 Api::NewHandle(isolate(), url.raw()));
4387 isolate()->UnblockClassFinalization();
4384 if (Dart_IsError(result)) { 4388 if (Dart_IsError(result)) {
4385 // In case of an error we append an explanatory error message to the 4389 // In case of an error we append an explanatory error message to the
4386 // error obtained from the library tag handler. 4390 // error obtained from the library tag handler.
4387 Error& prev_error = Error::Handle(); 4391 Error& prev_error = Error::Handle();
4388 prev_error ^= Api::UnwrapHandle(result); 4392 prev_error ^= Api::UnwrapHandle(result);
4389 AppendErrorMsg(prev_error, token_pos, "library handler failed"); 4393 AppendErrorMsg(prev_error, token_pos, "library handler failed");
4390 } 4394 }
4391 if (tag == Dart_kCanonicalizeUrl) { 4395 if (tag == Dart_kCanonicalizeUrl) {
4392 if (!Dart_IsString(result)) { 4396 if (!Dart_IsString(result)) {
4393 ErrorMsg(token_pos, "library handler failed URI canonicalization"); 4397 ErrorMsg(token_pos, "library handler failed URI canonicalization");
(...skipping 5711 matching lines...) Expand 10 before | Expand all | Expand 10 after
10105 void Parser::SkipQualIdent() { 10109 void Parser::SkipQualIdent() {
10106 ASSERT(IsIdentifier()); 10110 ASSERT(IsIdentifier());
10107 ConsumeToken(); 10111 ConsumeToken();
10108 if (CurrentToken() == Token::kPERIOD) { 10112 if (CurrentToken() == Token::kPERIOD) {
10109 ConsumeToken(); // Consume the kPERIOD token. 10113 ConsumeToken(); // Consume the kPERIOD token.
10110 ExpectIdentifier("identifier expected after '.'"); 10114 ExpectIdentifier("identifier expected after '.'");
10111 } 10115 }
10112 } 10116 }
10113 10117
10114 } // namespace dart 10118 } // namespace dart
OLDNEW
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/isolate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698