OLD | NEW |
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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 const Dart_IsolateFlags& api_flags) { | 229 const Dart_IsolateFlags& api_flags) { |
230 // Create a new isolate. | 230 // Create a new isolate. |
231 Isolate* isolate = Isolate::Init(name_prefix, api_flags); | 231 Isolate* isolate = Isolate::Init(name_prefix, api_flags); |
232 ASSERT(isolate != NULL); | 232 ASSERT(isolate != NULL); |
233 return isolate; | 233 return isolate; |
234 } | 234 } |
235 | 235 |
236 | 236 |
237 RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) { | 237 RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) { |
238 // Initialize the new isolate. | 238 // Initialize the new isolate. |
239 Isolate* isolate = Isolate::Current(); | 239 Thread* thread = Thread::Current(); |
240 TIMERSCOPE(isolate, time_isolate_initialization); | 240 Isolate* isolate = thread->isolate(); |
| 241 TIMERSCOPE(thread, time_isolate_initialization); |
241 TimelineDurationScope tds(isolate, | 242 TimelineDurationScope tds(isolate, |
242 isolate->GetIsolateStream(), | 243 isolate->GetIsolateStream(), |
243 "InitializeIsolate"); | 244 "InitializeIsolate"); |
244 tds.SetNumArguments(1); | 245 tds.SetNumArguments(1); |
245 tds.CopyArgument(0, "isolateName", isolate->name()); | 246 tds.CopyArgument(0, "isolateName", isolate->name()); |
246 | 247 |
247 ASSERT(isolate != NULL); | 248 ASSERT(isolate != NULL); |
248 StackZone zone(isolate); | 249 StackZone zone(isolate); |
249 HandleScope handle_scope(isolate); | 250 HandleScope handle_scope(isolate); |
250 { | 251 { |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 return predefined_handles_->handles_.IsValidScopedHandle(address); | 378 return predefined_handles_->handles_.IsValidScopedHandle(address); |
378 } | 379 } |
379 | 380 |
380 | 381 |
381 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 382 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
382 ASSERT(predefined_handles_ != NULL); | 383 ASSERT(predefined_handles_ != NULL); |
383 return predefined_handles_->api_handles_.IsValidHandle(handle); | 384 return predefined_handles_->api_handles_.IsValidHandle(handle); |
384 } | 385 } |
385 | 386 |
386 } // namespace dart | 387 } // namespace dart |
OLD | NEW |