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

Side by Side Diff: vm/raw_object_snapshot.cc

Issue 10831248: 1. Write out only the kind_tag_ field of a function in the snapshot instead of the individual bits … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 4 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 | « 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 // Set the object tags. 426 // Set the object tags.
427 func.set_tags(tags); 427 func.set_tags(tags);
428 428
429 // Set all the non object fields. 429 // Set all the non object fields.
430 func.set_token_pos(reader->ReadIntptrValue()); 430 func.set_token_pos(reader->ReadIntptrValue());
431 func.set_end_token_pos(reader->ReadIntptrValue()); 431 func.set_end_token_pos(reader->ReadIntptrValue());
432 func.set_num_fixed_parameters(reader->ReadIntptrValue()); 432 func.set_num_fixed_parameters(reader->ReadIntptrValue());
433 func.set_num_optional_parameters(reader->ReadIntptrValue()); 433 func.set_num_optional_parameters(reader->ReadIntptrValue());
434 func.set_usage_counter(reader->ReadIntptrValue()); 434 func.set_usage_counter(reader->ReadIntptrValue());
435 func.set_deoptimization_counter(reader->ReadIntptrValue()); 435 func.set_deoptimization_counter(reader->ReadIntptrValue());
436 func.set_kind(static_cast<RawFunction::Kind >(reader->ReadIntptrValue())); 436 func.set_kind_tag(reader->ReadIntptrValue());
437 func.set_is_static(reader->Read<bool>());
438 func.set_is_const(reader->Read<bool>());
439 func.set_is_optimizable(reader->Read<bool>());
440 func.set_is_native(reader->Read<bool>());
441 func.set_is_abstract(reader->Read<bool>());
442 437
443 // Set all the object fields. 438 // Set all the object fields.
444 // TODO(5411462): Need to assert No GC can happen here, even though 439 // TODO(5411462): Need to assert No GC can happen here, even though
445 // allocations may happen. 440 // allocations may happen.
446 intptr_t num_flds = (func.raw()->to() - func.raw()->from()); 441 intptr_t num_flds = (func.raw()->to() - func.raw()->from());
447 for (intptr_t i = 0; i <= num_flds; i++) { 442 for (intptr_t i = 0; i <= num_flds; i++) {
448 *(func.raw()->from() + i) = reader->ReadObjectRef(); 443 *(func.raw()->from() + i) = reader->ReadObjectRef();
449 } 444 }
450 445
451 return func.raw(); 446 return func.raw();
(...skipping 14 matching lines...) Expand all
466 writer->WriteVMIsolateObject(kFunctionCid); 461 writer->WriteVMIsolateObject(kFunctionCid);
467 writer->WriteIntptrValue(writer->GetObjectTags(this)); 462 writer->WriteIntptrValue(writer->GetObjectTags(this));
468 463
469 // Write out all the non object fields. 464 // Write out all the non object fields.
470 writer->WriteIntptrValue(ptr()->token_pos_); 465 writer->WriteIntptrValue(ptr()->token_pos_);
471 writer->WriteIntptrValue(ptr()->end_token_pos_); 466 writer->WriteIntptrValue(ptr()->end_token_pos_);
472 writer->WriteIntptrValue(ptr()->num_fixed_parameters_); 467 writer->WriteIntptrValue(ptr()->num_fixed_parameters_);
473 writer->WriteIntptrValue(ptr()->num_optional_parameters_); 468 writer->WriteIntptrValue(ptr()->num_optional_parameters_);
474 writer->WriteIntptrValue(ptr()->usage_counter_); 469 writer->WriteIntptrValue(ptr()->usage_counter_);
475 writer->WriteIntptrValue(ptr()->deoptimization_counter_); 470 writer->WriteIntptrValue(ptr()->deoptimization_counter_);
476 writer->WriteIntptrValue(GetKind()); 471 writer->WriteIntptrValue(ptr()->kind_tag_);
477 writer->Write<bool>(IsStatic());
478 writer->Write<bool>(IsConst());
479 writer->Write<bool>(IsOptimizable());
480 writer->Write<bool>(IsNative());
481 writer->Write<bool>(IsAbstract());
482 472
483 // Write out all the object pointer fields. 473 // Write out all the object pointer fields.
484 SnapshotWriterVisitor visitor(writer); 474 SnapshotWriterVisitor visitor(writer);
485 visitor.VisitPointers(from(), to()); 475 visitor.VisitPointers(from(), to());
486 } 476 }
487 477
488 478
489 RawField* Field::ReadFrom(SnapshotReader* reader, 479 RawField* Field::ReadFrom(SnapshotReader* reader,
490 intptr_t object_id, 480 intptr_t object_id,
491 intptr_t tags, 481 intptr_t tags,
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
2018 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); 2008 writer->Write<RawObject*>(ptr()->num_bracket_expressions_);
2019 writer->WriteObjectImpl(ptr()->pattern_); 2009 writer->WriteObjectImpl(ptr()->pattern_);
2020 writer->WriteIntptrValue(ptr()->type_); 2010 writer->WriteIntptrValue(ptr()->type_);
2021 writer->WriteIntptrValue(ptr()->flags_); 2011 writer->WriteIntptrValue(ptr()->flags_);
2022 2012
2023 // Do not write out the data part which is native. 2013 // Do not write out the data part which is native.
2024 } 2014 }
2025 2015
2026 2016
2027 } // namespace dart 2017 } // namespace dart
OLDNEW
« no previous file with comments | « vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698