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

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

Issue 10928160: Limit the maximum number of formal parameters (32K fixed and 32K optional) (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
« runtime/vm/object.cc ('K') | « 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 Function& func = Function::ZoneHandle( 477 Function& func = Function::ZoneHandle(
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_usage_counter(reader->ReadIntptrValue());
487 func.set_num_fixed_parameters(reader->ReadIntptrValue()); 488 func.set_num_fixed_parameters(reader->ReadIntptrValue());
488 func.set_num_optional_positional_parameters(reader->ReadIntptrValue()); 489 func.set_num_optional_parameters(reader->ReadIntptrValue());
489 func.set_num_optional_named_parameters(reader->ReadIntptrValue());
490 func.set_usage_counter(reader->ReadIntptrValue());
491 func.set_deoptimization_counter(reader->ReadIntptrValue()); 490 func.set_deoptimization_counter(reader->ReadIntptrValue());
492 func.set_kind_tag(reader->ReadIntptrValue()); 491 func.set_kind_tag(reader->ReadIntptrValue());
493 492
494 // Set all the object fields. 493 // Set all the object fields.
495 // TODO(5411462): Need to assert No GC can happen here, even though 494 // TODO(5411462): Need to assert No GC can happen here, even though
496 // allocations may happen. 495 // allocations may happen.
497 intptr_t num_flds = (func.raw()->to() - func.raw()->from()); 496 intptr_t num_flds = (func.raw()->to() - func.raw()->from());
498 for (intptr_t i = 0; i <= num_flds; i++) { 497 for (intptr_t i = 0; i <= num_flds; i++) {
499 *(func.raw()->from() + i) = reader->ReadObjectRef(); 498 *(func.raw()->from() + i) = reader->ReadObjectRef();
500 } 499 }
(...skipping 12 matching lines...) Expand all
513 // Write out the serialization header value for this object. 512 // Write out the serialization header value for this object.
514 writer->WriteInlinedObjectHeader(object_id); 513 writer->WriteInlinedObjectHeader(object_id);
515 514
516 // Write out the class and tags information. 515 // Write out the class and tags information.
517 writer->WriteVMIsolateObject(kFunctionCid); 516 writer->WriteVMIsolateObject(kFunctionCid);
518 writer->WriteIntptrValue(writer->GetObjectTags(this)); 517 writer->WriteIntptrValue(writer->GetObjectTags(this));
519 518
520 // Write out all the non object fields. 519 // Write out all the non object fields.
521 writer->WriteIntptrValue(ptr()->token_pos_); 520 writer->WriteIntptrValue(ptr()->token_pos_);
522 writer->WriteIntptrValue(ptr()->end_token_pos_); 521 writer->WriteIntptrValue(ptr()->end_token_pos_);
522 writer->WriteIntptrValue(ptr()->usage_counter_);
523 writer->WriteIntptrValue(ptr()->num_fixed_parameters_); 523 writer->WriteIntptrValue(ptr()->num_fixed_parameters_);
524 writer->WriteIntptrValue(ptr()->num_optional_positional_parameters_); 524 writer->WriteIntptrValue(ptr()->num_optional_parameters_);
525 writer->WriteIntptrValue(ptr()->num_optional_named_parameters_);
526 writer->WriteIntptrValue(ptr()->usage_counter_);
527 writer->WriteIntptrValue(ptr()->deoptimization_counter_); 525 writer->WriteIntptrValue(ptr()->deoptimization_counter_);
528 writer->WriteIntptrValue(ptr()->kind_tag_); 526 writer->WriteIntptrValue(ptr()->kind_tag_);
529 527
530 // Write out all the object pointer fields. 528 // Write out all the object pointer fields.
531 SnapshotWriterVisitor visitor(writer); 529 SnapshotWriterVisitor visitor(writer);
532 visitor.VisitPointers(from(), to()); 530 visitor.VisitPointers(from(), to());
533 } 531 }
534 532
535 533
536 RawField* Field::ReadFrom(SnapshotReader* reader, 534 RawField* Field::ReadFrom(SnapshotReader* reader,
(...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after
2182 // Write out the class and tags information. 2180 // Write out the class and tags information.
2183 writer->WriteIndexedObject(kWeakPropertyCid); 2181 writer->WriteIndexedObject(kWeakPropertyCid);
2184 writer->WriteIntptrValue(writer->GetObjectTags(this)); 2182 writer->WriteIntptrValue(writer->GetObjectTags(this));
2185 2183
2186 // Write out all the other fields. 2184 // Write out all the other fields.
2187 writer->Write<RawObject*>(ptr()->key_); 2185 writer->Write<RawObject*>(ptr()->key_);
2188 writer->Write<RawObject*>(ptr()->value_); 2186 writer->Write<RawObject*>(ptr()->value_);
2189 } 2187 }
2190 2188
2191 } // namespace dart 2189 } // namespace dart
OLDNEW
« runtime/vm/object.cc ('K') | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698