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

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

Issue 539153002: Port and integrate the irregexp engine from V8 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed Ivan's comments. Created 6 years, 2 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/regexp.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/object.h" 5 #include "vm/object.h"
6 #include "vm/object_store.h" 6 #include "vm/object_store.h"
7 #include "vm/snapshot.h" 7 #include "vm/snapshot.h"
8 #include "vm/stub_code.h" 8 #include "vm/stub_code.h"
9 #include "vm/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 // Set the object tags. 685 // Set the object tags.
686 func.set_tags(tags); 686 func.set_tags(tags);
687 687
688 // Set all the non object fields. 688 // Set all the non object fields.
689 func.set_token_pos(reader->Read<int32_t>()); 689 func.set_token_pos(reader->Read<int32_t>());
690 func.set_end_token_pos(reader->Read<int32_t>()); 690 func.set_end_token_pos(reader->Read<int32_t>());
691 func.set_usage_counter(reader->Read<int32_t>()); 691 func.set_usage_counter(reader->Read<int32_t>());
692 func.set_num_fixed_parameters(reader->Read<int16_t>()); 692 func.set_num_fixed_parameters(reader->Read<int16_t>());
693 func.set_num_optional_parameters(reader->Read<int16_t>()); 693 func.set_num_optional_parameters(reader->Read<int16_t>());
694 func.set_deoptimization_counter(reader->Read<int16_t>()); 694 func.set_deoptimization_counter(reader->Read<int16_t>());
695 func.set_regexp_cid(reader->Read<int16_t>());
695 func.set_kind_tag(reader->Read<uint32_t>()); 696 func.set_kind_tag(reader->Read<uint32_t>());
696 func.set_optimized_instruction_count(reader->Read<uint16_t>()); 697 func.set_optimized_instruction_count(reader->Read<uint16_t>());
697 func.set_optimized_call_site_count(reader->Read<uint16_t>()); 698 func.set_optimized_call_site_count(reader->Read<uint16_t>());
698 699
699 // Set all the object fields. 700 // Set all the object fields.
700 // TODO(5411462): Need to assert No GC can happen here, even though 701 // TODO(5411462): Need to assert No GC can happen here, even though
701 // allocations may happen. 702 // allocations may happen.
702 intptr_t num_flds = (func.raw()->to_snapshot() - func.raw()->from()); 703 intptr_t num_flds = (func.raw()->to_snapshot() - func.raw()->from());
703 for (intptr_t i = 0; i <= num_flds; i++) { 704 for (intptr_t i = 0; i <= num_flds; i++) {
704 *(func.raw()->from() + i) = reader->ReadObjectRef(); 705 *(func.raw()->from() + i) = reader->ReadObjectRef();
(...skipping 21 matching lines...) Expand all
726 writer->WriteVMIsolateObject(kFunctionCid); 727 writer->WriteVMIsolateObject(kFunctionCid);
727 writer->WriteTags(writer->GetObjectTags(this)); 728 writer->WriteTags(writer->GetObjectTags(this));
728 729
729 // Write out all the non object fields. 730 // Write out all the non object fields.
730 writer->Write<int32_t>(ptr()->token_pos_); 731 writer->Write<int32_t>(ptr()->token_pos_);
731 writer->Write<int32_t>(ptr()->end_token_pos_); 732 writer->Write<int32_t>(ptr()->end_token_pos_);
732 writer->Write<int32_t>(ptr()->usage_counter_); 733 writer->Write<int32_t>(ptr()->usage_counter_);
733 writer->Write<int16_t>(ptr()->num_fixed_parameters_); 734 writer->Write<int16_t>(ptr()->num_fixed_parameters_);
734 writer->Write<int16_t>(ptr()->num_optional_parameters_); 735 writer->Write<int16_t>(ptr()->num_optional_parameters_);
735 writer->Write<int16_t>(ptr()->deoptimization_counter_); 736 writer->Write<int16_t>(ptr()->deoptimization_counter_);
737 writer->Write<int16_t>(ptr()->regexp_cid_);
736 writer->Write<uint32_t>(ptr()->kind_tag_); 738 writer->Write<uint32_t>(ptr()->kind_tag_);
737 writer->Write<uint16_t>(ptr()->optimized_instruction_count_); 739 writer->Write<uint16_t>(ptr()->optimized_instruction_count_);
738 writer->Write<uint16_t>(ptr()->optimized_call_site_count_); 740 writer->Write<uint16_t>(ptr()->optimized_call_site_count_);
739 741
740 // Write out all the object pointer fields. 742 // Write out all the object pointer fields.
741 SnapshotWriterVisitor visitor(writer); 743 SnapshotWriterVisitor visitor(writer);
742 visitor.VisitPointers(from(), to_snapshot()); 744 visitor.VisitPointers(from(), to_snapshot());
743 } 745 }
744 746
745 747
(...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after
2837 // We do not allow objects with native fields in an isolate message. 2839 // We do not allow objects with native fields in an isolate message.
2838 writer->SetWriteException(Exceptions::kArgument, 2840 writer->SetWriteException(Exceptions::kArgument,
2839 "Illegal argument in isolate message" 2841 "Illegal argument in isolate message"
2840 " : (object is a UserTag)"); 2842 " : (object is a UserTag)");
2841 } else { 2843 } else {
2842 UNREACHABLE(); 2844 UNREACHABLE();
2843 } 2845 }
2844 } 2846 }
2845 2847
2846 } // namespace dart 2848 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/regexp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698