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

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

Issue 350923005: Defer marking libraries as ‘loaded’ (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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.h ('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) 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 "vm/isolate.h" 5 #include "vm/isolate.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/json.h" 9 #include "platform/json.h"
10 #include "lib/mirrors.h" 10 #include "lib/mirrors.h"
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 mutex_->Lock(); 543 mutex_->Lock();
544 ASSERT((interrupt_bits & ~kInterruptsMask) == 0); // Must fit in mask. 544 ASSERT((interrupt_bits & ~kInterruptsMask) == 0); // Must fit in mask.
545 if (stack_limit_ == saved_stack_limit_) { 545 if (stack_limit_ == saved_stack_limit_) {
546 stack_limit_ = (~static_cast<uword>(0)) & ~kInterruptsMask; 546 stack_limit_ = (~static_cast<uword>(0)) & ~kInterruptsMask;
547 } 547 }
548 stack_limit_ |= interrupt_bits; 548 stack_limit_ |= interrupt_bits;
549 mutex_->Unlock(); 549 mutex_->Unlock();
550 } 550 }
551 551
552 552
553 void Isolate::DoneLoading() {
554 GrowableObjectArray& libs =
555 GrowableObjectArray::Handle(this, object_store()->libraries());
556 Library& lib = Library::Handle(this);
557 intptr_t num_libs = libs.Length();
558 for (intptr_t i = 0; i < num_libs; i++) {
559 lib ^= libs.At(i);
560 // If this library was loaded with Dart_LoadLibrary, it was marked
561 // as 'load in progres'. Set the status to 'loaded'.
562 if (lib.LoadInProgress()) {
563 lib.SetLoaded();
564 }
565 }
566 }
567
568
553 bool Isolate::MakeRunnable() { 569 bool Isolate::MakeRunnable() {
554 ASSERT(Isolate::Current() == NULL); 570 ASSERT(Isolate::Current() == NULL);
555 // Can't use MutexLocker here because MutexLocker is 571 // Can't use MutexLocker here because MutexLocker is
556 // a StackResource, which requires a current isolate. 572 // a StackResource, which requires a current isolate.
557 mutex_->Lock(); 573 mutex_->Lock();
558 // Check if we are in a valid state to make the isolate runnable. 574 // Check if we are in a valid state to make the isolate runnable.
559 if (is_runnable_ == true) { 575 if (is_runnable_ == true) {
560 mutex_->Unlock(); 576 mutex_->Unlock();
561 return false; // Already runnable. 577 return false; // Already runnable.
562 } 578 }
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 return func.raw(); 1252 return func.raw();
1237 } 1253 }
1238 1254
1239 1255
1240 void IsolateSpawnState::Cleanup() { 1256 void IsolateSpawnState::Cleanup() {
1241 SwitchIsolateScope switch_scope(isolate()); 1257 SwitchIsolateScope switch_scope(isolate());
1242 Dart::ShutdownIsolate(); 1258 Dart::ShutdownIsolate();
1243 } 1259 }
1244 1260
1245 } // namespace dart 1261 } // namespace dart
OLDNEW
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698