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

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

Issue 9460015: Do not count invocations but usage of a function, i.e., increment a function's counter at IC calls … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/stub_code.h » ('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) 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/visitor.h" 9 #include "vm/visitor.h"
10 10
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 reader->AddBackwardReference(object_id, &func); 460 reader->AddBackwardReference(object_id, &func);
461 461
462 // Set the object tags. 462 // Set the object tags.
463 func.set_tags(tags); 463 func.set_tags(tags);
464 464
465 // Set all the non object fields. 465 // Set all the non object fields.
466 func.set_token_index(reader->ReadIntptrValue()); 466 func.set_token_index(reader->ReadIntptrValue());
467 func.set_end_token_index(reader->ReadIntptrValue()); 467 func.set_end_token_index(reader->ReadIntptrValue());
468 func.set_num_fixed_parameters(reader->ReadIntptrValue()); 468 func.set_num_fixed_parameters(reader->ReadIntptrValue());
469 func.set_num_optional_parameters(reader->ReadIntptrValue()); 469 func.set_num_optional_parameters(reader->ReadIntptrValue());
470 func.set_invocation_counter(reader->ReadIntptrValue()); 470 func.set_usage_counter(reader->ReadIntptrValue());
471 func.set_deoptimization_counter(reader->ReadIntptrValue()); 471 func.set_deoptimization_counter(reader->ReadIntptrValue());
472 func.set_kind(static_cast<RawFunction::Kind >(reader->ReadIntptrValue())); 472 func.set_kind(static_cast<RawFunction::Kind >(reader->ReadIntptrValue()));
473 func.set_is_static(reader->Read<bool>()); 473 func.set_is_static(reader->Read<bool>());
474 func.set_is_const(reader->Read<bool>()); 474 func.set_is_const(reader->Read<bool>());
475 func.set_is_optimizable(reader->Read<bool>()); 475 func.set_is_optimizable(reader->Read<bool>());
476 476
477 // Set all the object fields. 477 // Set all the object fields.
478 // TODO(5411462): Need to assert No GC can happen here, even though 478 // TODO(5411462): Need to assert No GC can happen here, even though
479 // allocations may happen. 479 // allocations may happen.
480 intptr_t num_flds = (func.raw()->to() - func.raw()->from()); 480 intptr_t num_flds = (func.raw()->to() - func.raw()->from());
(...skipping 15 matching lines...) Expand all
496 writer->WriteSerializationMarker(kInlined, object_id); 496 writer->WriteSerializationMarker(kInlined, object_id);
497 497
498 // Write out the class and tags information. 498 // Write out the class and tags information.
499 writer->WriteObjectHeader(Object::kFunctionClass, ptr()->tags_); 499 writer->WriteObjectHeader(Object::kFunctionClass, ptr()->tags_);
500 500
501 // Write out all the non object fields. 501 // Write out all the non object fields.
502 writer->WriteIntptrValue(ptr()->token_index_); 502 writer->WriteIntptrValue(ptr()->token_index_);
503 writer->WriteIntptrValue(ptr()->end_token_index_); 503 writer->WriteIntptrValue(ptr()->end_token_index_);
504 writer->WriteIntptrValue(ptr()->num_fixed_parameters_); 504 writer->WriteIntptrValue(ptr()->num_fixed_parameters_);
505 writer->WriteIntptrValue(ptr()->num_optional_parameters_); 505 writer->WriteIntptrValue(ptr()->num_optional_parameters_);
506 writer->WriteIntptrValue(ptr()->invocation_counter_); 506 writer->WriteIntptrValue(ptr()->usage_counter_);
507 writer->WriteIntptrValue(ptr()->deoptimization_counter_); 507 writer->WriteIntptrValue(ptr()->deoptimization_counter_);
508 writer->WriteIntptrValue(ptr()->kind_); 508 writer->WriteIntptrValue(ptr()->kind_);
509 writer->Write<bool>(ptr()->is_static_); 509 writer->Write<bool>(ptr()->is_static_);
510 writer->Write<bool>(ptr()->is_const_); 510 writer->Write<bool>(ptr()->is_const_);
511 writer->Write<bool>(ptr()->is_optimizable_); 511 writer->Write<bool>(ptr()->is_optimizable_);
512 512
513 // Write out all the object pointer fields. 513 // Write out all the object pointer fields.
514 SnapshotWriterVisitor visitor(writer); 514 SnapshotWriterVisitor visitor(writer);
515 visitor.VisitPointers(from(), to()); 515 visitor.VisitPointers(from(), to());
516 } 516 }
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 1858
1859 1859
1860 void RawICData::WriteTo(SnapshotWriter* writer, 1860 void RawICData::WriteTo(SnapshotWriter* writer,
1861 intptr_t object_id, 1861 intptr_t object_id,
1862 Snapshot::Kind kind) { 1862 Snapshot::Kind kind) {
1863 UNIMPLEMENTED(); 1863 UNIMPLEMENTED();
1864 } 1864 }
1865 1865
1866 1866
1867 } // namespace dart 1867 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/stub_code.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698