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

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

Issue 1311403009: More precompiled snapshotting. (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/object.cc ('k') | runtime/vm/raw_object_snapshot.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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/precompiler.h" 5 #include "vm/precompiler.h"
6 6
7 #include "vm/compiler.h" 7 #include "vm/compiler.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/log.h" 9 #include "vm/log.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 432
433 void Precompiler::AddField(const Field& field) { 433 void Precompiler::AddField(const Field& field) {
434 if (field.is_static()) { 434 if (field.is_static()) {
435 // Potential const object. Uninitialized field will harmlessly do a 435 // Potential const object. Uninitialized field will harmlessly do a
436 // redundant add of the Null class. 436 // redundant add of the Null class.
437 const Object& value = Object::Handle(Z, field.StaticValue()); 437 const Object& value = Object::Handle(Z, field.StaticValue());
438 const Class& cls = Class::Handle(Z, value.clazz()); 438 const Class& cls = Class::Handle(Z, value.clazz());
439 AddClass(cls); 439 AddClass(cls);
440 440
441 if (field.has_initializer()) { 441 if (field.has_initializer()) {
442 if (field.PrecompiledInitializer() != Function::null()) return; 442 if (field.HasPrecompiledInitializer()) return;
443 443
444 if (FLAG_trace_precompiler) { 444 if (FLAG_trace_precompiler) {
445 THR_Print("Precompiling initializer for %s\n", field.ToCString()); 445 THR_Print("Precompiling initializer for %s\n", field.ToCString());
446 } 446 }
447 ASSERT(Object::instructions_snapshot_buffer() == NULL);
448 field.SetStaticValue(Instance::Handle(field.SavedInitialStaticValue()));
447 Compiler::CompileStaticInitializer(field); 449 Compiler::CompileStaticInitializer(field);
448 450
449 const Function& function = 451 const Function& function =
450 Function::Handle(Z, field.PrecompiledInitializer()); 452 Function::Handle(Z, field.PrecompiledInitializer());
451 AddCalleesOf(function); 453 AddCalleesOf(function);
452 } 454 }
453 } 455 }
454 } 456 }
455 457
456 458
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 for (intptr_t j = 0; j < closures.Length(); j++) { 634 for (intptr_t j = 0; j < closures.Length(); j++) {
633 function ^= closures.At(j); 635 function ^= closures.At(j);
634 ASSERT(function.HasCode()); 636 ASSERT(function.HasCode());
635 } 637 }
636 } 638 }
637 } 639 }
638 } 640 }
639 } 641 }
640 642
641 } // namespace dart 643 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698