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

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

Issue 38703009: Update VM service to new isolate API (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 #define REUSABLE_HANDLE_INITIALIZERS(object) \ 273 #define REUSABLE_HANDLE_INITIALIZERS(object) \
274 object##_handle_(NULL), 274 object##_handle_(NULL),
275 275
276 Isolate::Isolate() 276 Isolate::Isolate()
277 : store_buffer_(), 277 : store_buffer_(),
278 message_notify_callback_(NULL), 278 message_notify_callback_(NULL),
279 name_(NULL), 279 name_(NULL),
280 start_time_(OS::GetCurrentTimeMicros()), 280 start_time_(OS::GetCurrentTimeMicros()),
281 main_port_(0), 281 main_port_(0),
282 service_port_(0),
282 heap_(NULL), 283 heap_(NULL),
283 object_store_(NULL), 284 object_store_(NULL),
284 top_context_(Context::null()), 285 top_context_(Context::null()),
285 top_exit_frame_info_(0), 286 top_exit_frame_info_(0),
286 init_callback_data_(NULL), 287 init_callback_data_(NULL),
287 library_tag_handler_(NULL), 288 library_tag_handler_(NULL),
288 api_state_(NULL), 289 api_state_(NULL),
289 stub_code_(NULL), 290 stub_code_(NULL),
290 debugger_(NULL), 291 debugger_(NULL),
291 single_step_(false), 292 single_step_(false),
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 ApiState* state = new ApiState(); 379 ApiState* state = new ApiState();
379 ASSERT(state != NULL); 380 ASSERT(state != NULL);
380 result->set_api_state(state); 381 result->set_api_state(state);
381 382
382 // Initialize stack top and limit in case we are running the isolate in the 383 // Initialize stack top and limit in case we are running the isolate in the
383 // main thread. 384 // main thread.
384 // TODO(5411455): Need to figure out how to set the stack limit for the 385 // TODO(5411455): Need to figure out how to set the stack limit for the
385 // main thread. 386 // main thread.
386 result->SetStackLimitFromCurrentTOS(reinterpret_cast<uword>(&result)); 387 result->SetStackLimitFromCurrentTOS(reinterpret_cast<uword>(&result));
387 result->set_main_port(PortMap::CreatePort(result->message_handler())); 388 result->set_main_port(PortMap::CreatePort(result->message_handler()));
389 result->set_service_port(PortMap::CreatePort(result->message_handler()));
Ivan Posva 2013/10/25 00:30:27 What is this service port used for? How does the V
Cutch 2013/10/25 01:21:57 (Florian is closing the main port from Dart code a
388 result->BuildName(name_prefix); 390 result->BuildName(name_prefix);
389 391
390 result->debugger_ = new Debugger(); 392 result->debugger_ = new Debugger();
391 result->debugger_->Initialize(result); 393 result->debugger_->Initialize(result);
392 if (FLAG_trace_isolates) { 394 if (FLAG_trace_isolates) {
393 if (name_prefix == NULL || strcmp(name_prefix, "vm-isolate") != 0) { 395 if (name_prefix == NULL || strcmp(name_prefix, "vm-isolate") != 0) {
394 OS::Print("[+] Starting isolate:\n" 396 OS::Print("[+] Starting isolate:\n"
395 "\tisolate: %s\n", result->name()); 397 "\tisolate: %s\n", result->name());
396 } 398 }
397 } 399 }
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 return func.raw(); 1053 return func.raw();
1052 } 1054 }
1053 1055
1054 1056
1055 void IsolateSpawnState::Cleanup() { 1057 void IsolateSpawnState::Cleanup() {
1056 SwitchIsolateScope switch_scope(isolate()); 1058 SwitchIsolateScope switch_scope(isolate());
1057 Dart::ShutdownIsolate(); 1059 Dart::ShutdownIsolate();
1058 } 1060 }
1059 1061
1060 } // namespace dart 1062 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698