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

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

Issue 10910119: Implement new optional parameters syntax in the vm (issue 4290). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/raw_object.h ('k') | tests/co19/co19-runtime.status » ('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/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 reader->isolate(), NEW_OBJECT(Function)); 478 reader->isolate(), NEW_OBJECT(Function));
479 reader->AddBackRef(object_id, &func, kIsDeserialized); 479 reader->AddBackRef(object_id, &func, kIsDeserialized);
480 480
481 // Set the object tags. 481 // Set the object tags.
482 func.set_tags(tags); 482 func.set_tags(tags);
483 483
484 // Set all the non object fields. 484 // Set all the non object fields.
485 func.set_token_pos(reader->ReadIntptrValue()); 485 func.set_token_pos(reader->ReadIntptrValue());
486 func.set_end_token_pos(reader->ReadIntptrValue()); 486 func.set_end_token_pos(reader->ReadIntptrValue());
487 func.set_num_fixed_parameters(reader->ReadIntptrValue()); 487 func.set_num_fixed_parameters(reader->ReadIntptrValue());
488 func.set_num_optional_parameters(reader->ReadIntptrValue()); 488 func.set_num_optional_positional_parameters(reader->ReadIntptrValue());
489 func.set_num_optional_named_parameters(reader->ReadIntptrValue());
489 func.set_usage_counter(reader->ReadIntptrValue()); 490 func.set_usage_counter(reader->ReadIntptrValue());
490 func.set_deoptimization_counter(reader->ReadIntptrValue()); 491 func.set_deoptimization_counter(reader->ReadIntptrValue());
491 func.set_kind_tag(reader->ReadIntptrValue()); 492 func.set_kind_tag(reader->ReadIntptrValue());
492 493
493 // Set all the object fields. 494 // Set all the object fields.
494 // TODO(5411462): Need to assert No GC can happen here, even though 495 // TODO(5411462): Need to assert No GC can happen here, even though
495 // allocations may happen. 496 // allocations may happen.
496 intptr_t num_flds = (func.raw()->to() - func.raw()->from()); 497 intptr_t num_flds = (func.raw()->to() - func.raw()->from());
497 for (intptr_t i = 0; i <= num_flds; i++) { 498 for (intptr_t i = 0; i <= num_flds; i++) {
498 *(func.raw()->from() + i) = reader->ReadObjectRef(); 499 *(func.raw()->from() + i) = reader->ReadObjectRef();
(...skipping 14 matching lines...) Expand all
513 writer->WriteInlinedObjectHeader(object_id); 514 writer->WriteInlinedObjectHeader(object_id);
514 515
515 // Write out the class and tags information. 516 // Write out the class and tags information.
516 writer->WriteVMIsolateObject(kFunctionCid); 517 writer->WriteVMIsolateObject(kFunctionCid);
517 writer->WriteIntptrValue(writer->GetObjectTags(this)); 518 writer->WriteIntptrValue(writer->GetObjectTags(this));
518 519
519 // Write out all the non object fields. 520 // Write out all the non object fields.
520 writer->WriteIntptrValue(ptr()->token_pos_); 521 writer->WriteIntptrValue(ptr()->token_pos_);
521 writer->WriteIntptrValue(ptr()->end_token_pos_); 522 writer->WriteIntptrValue(ptr()->end_token_pos_);
522 writer->WriteIntptrValue(ptr()->num_fixed_parameters_); 523 writer->WriteIntptrValue(ptr()->num_fixed_parameters_);
523 writer->WriteIntptrValue(ptr()->num_optional_parameters_); 524 writer->WriteIntptrValue(ptr()->num_optional_positional_parameters_);
525 writer->WriteIntptrValue(ptr()->num_optional_named_parameters_);
524 writer->WriteIntptrValue(ptr()->usage_counter_); 526 writer->WriteIntptrValue(ptr()->usage_counter_);
525 writer->WriteIntptrValue(ptr()->deoptimization_counter_); 527 writer->WriteIntptrValue(ptr()->deoptimization_counter_);
526 writer->WriteIntptrValue(ptr()->kind_tag_); 528 writer->WriteIntptrValue(ptr()->kind_tag_);
527 529
528 // Write out all the object pointer fields. 530 // Write out all the object pointer fields.
529 SnapshotWriterVisitor visitor(writer); 531 SnapshotWriterVisitor visitor(writer);
530 visitor.VisitPointers(from(), to()); 532 visitor.VisitPointers(from(), to());
531 } 533 }
532 534
533 535
(...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after
2180 // Write out the class and tags information. 2182 // Write out the class and tags information.
2181 writer->WriteIndexedObject(kWeakPropertyCid); 2183 writer->WriteIndexedObject(kWeakPropertyCid);
2182 writer->WriteIntptrValue(writer->GetObjectTags(this)); 2184 writer->WriteIntptrValue(writer->GetObjectTags(this));
2183 2185
2184 // Write out all the other fields. 2186 // Write out all the other fields.
2185 writer->Write<RawObject*>(ptr()->key_); 2187 writer->Write<RawObject*>(ptr()->key_);
2186 writer->Write<RawObject*>(ptr()->value_); 2188 writer->Write<RawObject*>(ptr()->value_);
2187 } 2189 }
2188 2190
2189 } // namespace dart 2191 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698