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

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

Issue 1346203003: Isolate::Init() can return NULL (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | 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/dart.h" 5 #include "vm/dart.h"
6 6
7 #include "vm/code_observers.h" 7 #include "vm/code_observers.h"
8 #include "vm/cpu.h" 8 #include "vm/cpu.h"
9 #include "vm/dart_api_state.h" 9 #include "vm/dart_api_state.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 Metric::Cleanup(); 261 Metric::Cleanup();
262 262
263 return NULL; 263 return NULL;
264 } 264 }
265 265
266 266
267 Isolate* Dart::CreateIsolate(const char* name_prefix, 267 Isolate* Dart::CreateIsolate(const char* name_prefix,
268 const Dart_IsolateFlags& api_flags) { 268 const Dart_IsolateFlags& api_flags) {
269 // Create a new isolate. 269 // Create a new isolate.
270 Isolate* isolate = Isolate::Init(name_prefix, api_flags); 270 Isolate* isolate = Isolate::Init(name_prefix, api_flags);
271 ASSERT(isolate != NULL);
272 return isolate; 271 return isolate;
273 } 272 }
274 273
275 274
276 RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) { 275 RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) {
277 // Initialize the new isolate. 276 // Initialize the new isolate.
278 Thread* T = Thread::Current(); 277 Thread* T = Thread::Current();
279 Isolate* I = T->isolate(); 278 Isolate* I = T->isolate();
280 TIMERSCOPE(T, time_isolate_initialization); 279 TIMERSCOPE(T, time_isolate_initialization);
281 TimelineDurationScope tds(I, I->GetIsolateStream(), "InitializeIsolate"); 280 TimelineDurationScope tds(I, I->GetIsolateStream(), "InitializeIsolate");
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 return predefined_handles_->handles_.IsValidScopedHandle(address); 408 return predefined_handles_->handles_.IsValidScopedHandle(address);
410 } 409 }
411 410
412 411
413 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { 412 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) {
414 ASSERT(predefined_handles_ != NULL); 413 ASSERT(predefined_handles_ != NULL);
415 return predefined_handles_->api_handles_.IsValidHandle(handle); 414 return predefined_handles_->api_handles_.IsValidHandle(handle);
416 } 415 }
417 416
418 } // namespace dart 417 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698