| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // Now that the needed stub has been generated, set the stack limit. | 135 // Now that the needed stub has been generated, set the stack limit. |
| 136 vm_isolate_->InitializeStackLimit(); | 136 vm_isolate_->InitializeStackLimit(); |
| 137 if (vm_isolate_snapshot != NULL) { | 137 if (vm_isolate_snapshot != NULL) { |
| 138 const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot); | 138 const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot); |
| 139 if (snapshot == NULL) { | 139 if (snapshot == NULL) { |
| 140 return "Invalid vm isolate snapshot seen."; | 140 return "Invalid vm isolate snapshot seen."; |
| 141 } | 141 } |
| 142 ASSERT(snapshot->kind() == Snapshot::kFull); | 142 ASSERT(snapshot->kind() == Snapshot::kFull); |
| 143 VmIsolateSnapshotReader reader(snapshot->content(), | 143 VmIsolateSnapshotReader reader(snapshot->content(), |
| 144 snapshot->length(), | 144 snapshot->length(), |
| 145 instructions_snapshot, |
| 145 zone.GetZone()); | 146 zone.GetZone()); |
| 146 const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot()); | 147 const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot()); |
| 147 if (!error.IsNull()) { | 148 if (!error.IsNull()) { |
| 148 return error.ToCString(); | 149 return error.ToCString(); |
| 149 } | 150 } |
| 150 if (FLAG_trace_isolates) { | 151 if (FLAG_trace_isolates) { |
| 151 OS::Print("Size of vm isolate snapshot = %" Pd "\n", | 152 OS::Print("Size of vm isolate snapshot = %" Pd "\n", |
| 152 snapshot->length()); | 153 snapshot->length()); |
| 153 vm_isolate_->heap()->PrintSizes(); | 154 vm_isolate_->heap()->PrintSizes(); |
| 154 vm_isolate_->megamorphic_cache_table()->PrintSizes(); | 155 vm_isolate_->megamorphic_cache_table()->PrintSizes(); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 const String& message = String::Handle( | 278 const String& message = String::Handle( |
| 278 String::New("Invalid snapshot.")); | 279 String::New("Invalid snapshot.")); |
| 279 return ApiError::New(message); | 280 return ApiError::New(message); |
| 280 } | 281 } |
| 281 ASSERT(snapshot->kind() == Snapshot::kFull); | 282 ASSERT(snapshot->kind() == Snapshot::kFull); |
| 282 if (FLAG_trace_isolates) { | 283 if (FLAG_trace_isolates) { |
| 283 OS::Print("Size of isolate snapshot = %" Pd "\n", snapshot->length()); | 284 OS::Print("Size of isolate snapshot = %" Pd "\n", snapshot->length()); |
| 284 } | 285 } |
| 285 IsolateSnapshotReader reader(snapshot->content(), | 286 IsolateSnapshotReader reader(snapshot->content(), |
| 286 snapshot->length(), | 287 snapshot->length(), |
| 288 Object::instructions_snapshot_buffer(), |
| 287 isolate, | 289 isolate, |
| 288 zone.GetZone()); | 290 zone.GetZone()); |
| 289 const Error& error = Error::Handle(reader.ReadFullSnapshot()); | 291 const Error& error = Error::Handle(reader.ReadFullSnapshot()); |
| 290 if (!error.IsNull()) { | 292 if (!error.IsNull()) { |
| 291 return error.raw(); | 293 return error.raw(); |
| 292 } | 294 } |
| 293 if (FLAG_trace_isolates) { | 295 if (FLAG_trace_isolates) { |
| 294 isolate->heap()->PrintSizes(); | 296 isolate->heap()->PrintSizes(); |
| 295 isolate->megamorphic_cache_table()->PrintSizes(); | 297 isolate->megamorphic_cache_table()->PrintSizes(); |
| 296 } | 298 } |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 return predefined_handles_->handles_.IsValidScopedHandle(address); | 384 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 383 } | 385 } |
| 384 | 386 |
| 385 | 387 |
| 386 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 388 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
| 387 ASSERT(predefined_handles_ != NULL); | 389 ASSERT(predefined_handles_ != NULL); |
| 388 return predefined_handles_->api_handles_.IsValidHandle(handle); | 390 return predefined_handles_->api_handles_.IsValidHandle(handle); |
| 389 } | 391 } |
| 390 | 392 |
| 391 } // namespace dart | 393 } // namespace dart |
| OLD | NEW |