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

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

Issue 47233002: - Revert parts of r29315 while attempting to reproduce (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « runtime/vm/bootstrap_natives.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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 // communicate with the spawner to receive the initial message before it 527 // communicate with the spawner to receive the initial message before it
528 // executes the real entry point. 528 // executes the real entry point.
529 // Since this function ("RunIsolate") is used for both Isolate.spawn and 529 // Since this function ("RunIsolate") is used for both Isolate.spawn and
530 // Isolate.spawnUri we also send a boolean flag as argument so that the 530 // Isolate.spawnUri we also send a boolean flag as argument so that the
531 // "_startIsolate" function can act corresponding to how the isolate was 531 // "_startIsolate" function can act corresponding to how the isolate was
532 // created. 532 // created.
533 const Array& args = Array::Handle(Array::New(2)); 533 const Array& args = Array::Handle(Array::New(2));
534 args.SetAt(0, Instance::Handle(func.ImplicitStaticClosure())); 534 args.SetAt(0, Instance::Handle(func.ImplicitStaticClosure()));
535 args.SetAt(1, is_spawn_uri ? Bool::True() : Bool::False()); 535 args.SetAt(1, is_spawn_uri ? Bool::True() : Bool::False());
536 536
537 // Dispatching through _startIsolate will open a control port as a live
538 // port. Account for this by increasing the number of open control ports.
539 isolate->message_handler()->increment_control_ports();
540
541 const Library& lib = Library::Handle(Library::IsolateLibrary()); 537 const Library& lib = Library::Handle(Library::IsolateLibrary());
542 const String& entry_name = String::Handle(String::New("_startIsolate")); 538 const String& entry_name = String::Handle(String::New("_startIsolate"));
543 const Function& entry_point = 539 const Function& entry_point =
544 Function::Handle(lib.LookupLocalFunction(entry_name)); 540 Function::Handle(lib.LookupLocalFunction(entry_name));
545 ASSERT(entry_point.IsFunction() && !entry_point.IsNull()); 541 ASSERT(entry_point.IsFunction() && !entry_point.IsNull());
546 542
547 result = DartEntry::InvokeFunction(entry_point, args); 543 result = DartEntry::InvokeFunction(entry_point, args);
548 if (result.IsError()) { 544 if (result.IsError()) {
549 StoreError(isolate, result); 545 StoreError(isolate, result);
550 return false; 546 return false;
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 return func.raw(); 1057 return func.raw();
1062 } 1058 }
1063 1059
1064 1060
1065 void IsolateSpawnState::Cleanup() { 1061 void IsolateSpawnState::Cleanup() {
1066 SwitchIsolateScope switch_scope(isolate()); 1062 SwitchIsolateScope switch_scope(isolate());
1067 Dart::ShutdownIsolate(); 1063 Dart::ShutdownIsolate();
1068 } 1064 }
1069 1065
1070 } // namespace dart 1066 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698