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

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

Issue 11567012: Store optimized flow graph statistics on the function itself. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address Srdjan's comments Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/raw_object.h ('k') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/bigint_operations.h" 5 #include "vm/bigint_operations.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/object_store.h" 7 #include "vm/object_store.h"
8 #include "vm/snapshot.h" 8 #include "vm/snapshot.h"
9 #include "vm/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 func.set_tags(tags); 586 func.set_tags(tags);
587 587
588 // Set all the non object fields. 588 // Set all the non object fields.
589 func.set_token_pos(reader->ReadIntptrValue()); 589 func.set_token_pos(reader->ReadIntptrValue());
590 func.set_end_token_pos(reader->ReadIntptrValue()); 590 func.set_end_token_pos(reader->ReadIntptrValue());
591 func.set_usage_counter(reader->ReadIntptrValue()); 591 func.set_usage_counter(reader->ReadIntptrValue());
592 func.set_num_fixed_parameters(reader->ReadIntptrValue()); 592 func.set_num_fixed_parameters(reader->ReadIntptrValue());
593 func.set_num_optional_parameters(reader->ReadIntptrValue()); 593 func.set_num_optional_parameters(reader->ReadIntptrValue());
594 func.set_deoptimization_counter(reader->ReadIntptrValue()); 594 func.set_deoptimization_counter(reader->ReadIntptrValue());
595 func.set_kind_tag(reader->Read<uint16_t>()); 595 func.set_kind_tag(reader->Read<uint16_t>());
596 func.set_optimized_instruction_count(reader->Read<uint16_t>());
597 func.set_optimized_call_site_count(reader->Read<uint16_t>());
596 598
597 // Set all the object fields. 599 // Set all the object fields.
598 // TODO(5411462): Need to assert No GC can happen here, even though 600 // TODO(5411462): Need to assert No GC can happen here, even though
599 // allocations may happen. 601 // allocations may happen.
600 intptr_t num_flds = (func.raw()->to() - func.raw()->from()); 602 intptr_t num_flds = (func.raw()->to() - func.raw()->from());
601 for (intptr_t i = 0; i <= num_flds; i++) { 603 for (intptr_t i = 0; i <= num_flds; i++) {
602 *(func.raw()->from() + i) = reader->ReadObjectRef(); 604 *(func.raw()->from() + i) = reader->ReadObjectRef();
603 } 605 }
604 606
605 return func.raw(); 607 return func.raw();
(...skipping 15 matching lines...) Expand all
621 writer->WriteIntptrValue(writer->GetObjectTags(this)); 623 writer->WriteIntptrValue(writer->GetObjectTags(this));
622 624
623 // Write out all the non object fields. 625 // Write out all the non object fields.
624 writer->WriteIntptrValue(ptr()->token_pos_); 626 writer->WriteIntptrValue(ptr()->token_pos_);
625 writer->WriteIntptrValue(ptr()->end_token_pos_); 627 writer->WriteIntptrValue(ptr()->end_token_pos_);
626 writer->WriteIntptrValue(ptr()->usage_counter_); 628 writer->WriteIntptrValue(ptr()->usage_counter_);
627 writer->WriteIntptrValue(ptr()->num_fixed_parameters_); 629 writer->WriteIntptrValue(ptr()->num_fixed_parameters_);
628 writer->WriteIntptrValue(ptr()->num_optional_parameters_); 630 writer->WriteIntptrValue(ptr()->num_optional_parameters_);
629 writer->WriteIntptrValue(ptr()->deoptimization_counter_); 631 writer->WriteIntptrValue(ptr()->deoptimization_counter_);
630 writer->Write<uint16_t>(ptr()->kind_tag_); 632 writer->Write<uint16_t>(ptr()->kind_tag_);
633 writer->Write<uint16_t>(ptr()->optimized_instruction_count_);
634 writer->Write<uint16_t>(ptr()->optimized_call_site_count_);
631 635
632 // Write out all the object pointer fields. 636 // Write out all the object pointer fields.
633 SnapshotWriterVisitor visitor(writer); 637 SnapshotWriterVisitor visitor(writer);
634 visitor.VisitPointers(from(), to()); 638 visitor.VisitPointers(from(), to());
635 } 639 }
636 640
637 641
638 RawField* Field::ReadFrom(SnapshotReader* reader, 642 RawField* Field::ReadFrom(SnapshotReader* reader,
639 intptr_t object_id, 643 intptr_t object_id,
640 intptr_t tags, 644 intptr_t tags,
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after
2228 // Write out the class and tags information. 2232 // Write out the class and tags information.
2229 writer->WriteIndexedObject(kWeakPropertyCid); 2233 writer->WriteIndexedObject(kWeakPropertyCid);
2230 writer->WriteIntptrValue(writer->GetObjectTags(this)); 2234 writer->WriteIntptrValue(writer->GetObjectTags(this));
2231 2235
2232 // Write out all the other fields. 2236 // Write out all the other fields.
2233 writer->Write<RawObject*>(ptr()->key_); 2237 writer->Write<RawObject*>(ptr()->key_);
2234 writer->Write<RawObject*>(ptr()->value_); 2238 writer->Write<RawObject*>(ptr()->value_);
2235 } 2239 }
2236 2240
2237 } // namespace dart 2241 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698