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

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

Issue 1318803002: Toward precompiled snapshots. (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 | « runtime/vm/benchmark_test.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // Now that the needed stub has been generated, set the stack limit. 140 // Now that the needed stub has been generated, set the stack limit.
141 vm_isolate_->InitializeStackLimit(); 141 vm_isolate_->InitializeStackLimit();
142 if (vm_isolate_snapshot != NULL) { 142 if (vm_isolate_snapshot != NULL) {
143 const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot); 143 const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot);
144 if (snapshot == NULL) { 144 if (snapshot == NULL) {
145 return "Invalid vm isolate snapshot seen."; 145 return "Invalid vm isolate snapshot seen.";
146 } 146 }
147 ASSERT(snapshot->kind() == Snapshot::kFull); 147 ASSERT(snapshot->kind() == Snapshot::kFull);
148 VmIsolateSnapshotReader reader(snapshot->content(), 148 VmIsolateSnapshotReader reader(snapshot->content(),
149 snapshot->length(), 149 snapshot->length(),
150 instructions_snapshot,
150 thread); 151 thread);
151 const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot()); 152 const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot());
152 if (!error.IsNull()) { 153 if (!error.IsNull()) {
153 return error.ToCString(); 154 return error.ToCString();
154 } 155 }
155 if (FLAG_trace_isolates) { 156 if (FLAG_trace_isolates) {
156 OS::Print("Size of vm isolate snapshot = %" Pd "\n", 157 OS::Print("Size of vm isolate snapshot = %" Pd "\n",
157 snapshot->length()); 158 snapshot->length());
158 vm_isolate_->heap()->PrintSizes(); 159 vm_isolate_->heap()->PrintSizes();
159 vm_isolate_->megamorphic_cache_table()->PrintSizes(); 160 vm_isolate_->megamorphic_cache_table()->PrintSizes();
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 const String& message = String::Handle( 283 const String& message = String::Handle(
283 String::New("Invalid snapshot.")); 284 String::New("Invalid snapshot."));
284 return ApiError::New(message); 285 return ApiError::New(message);
285 } 286 }
286 ASSERT(snapshot->kind() == Snapshot::kFull); 287 ASSERT(snapshot->kind() == Snapshot::kFull);
287 if (FLAG_trace_isolates) { 288 if (FLAG_trace_isolates) {
288 OS::Print("Size of isolate snapshot = %" Pd "\n", snapshot->length()); 289 OS::Print("Size of isolate snapshot = %" Pd "\n", snapshot->length());
289 } 290 }
290 IsolateSnapshotReader reader(snapshot->content(), 291 IsolateSnapshotReader reader(snapshot->content(),
291 snapshot->length(), 292 snapshot->length(),
293 Object::instructions_snapshot_buffer(),
292 thread); 294 thread);
293 const Error& error = Error::Handle(reader.ReadFullSnapshot()); 295 const Error& error = Error::Handle(reader.ReadFullSnapshot());
294 if (!error.IsNull()) { 296 if (!error.IsNull()) {
295 return error.raw(); 297 return error.raw();
296 } 298 }
297 if (FLAG_trace_isolates) { 299 if (FLAG_trace_isolates) {
298 isolate->heap()->PrintSizes(); 300 isolate->heap()->PrintSizes();
299 isolate->megamorphic_cache_table()->PrintSizes(); 301 isolate->megamorphic_cache_table()->PrintSizes();
300 } 302 }
301 } else { 303 } else {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 return predefined_handles_->handles_.IsValidScopedHandle(address); 388 return predefined_handles_->handles_.IsValidScopedHandle(address);
387 } 389 }
388 390
389 391
390 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { 392 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) {
391 ASSERT(predefined_handles_ != NULL); 393 ASSERT(predefined_handles_ != NULL);
392 return predefined_handles_->api_handles_.IsValidHandle(handle); 394 return predefined_handles_->api_handles_.IsValidHandle(handle);
393 } 395 }
394 396
395 } // namespace dart 397 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/benchmark_test.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698