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

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

Issue 2411823003: VM support for running Kernel binaries. (Closed)
Patch Set: Address comments Created 4 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
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/redundancy_elimination.cc » ('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/native_entry.h" 5 #include "vm/native_entry.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/stub_code.h" 9 #include "vm/stub_code.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 const int32_t end_token_pos = reader->Read<uint32_t>(); 707 const int32_t end_token_pos = reader->Read<uint32_t>();
708 func.set_num_fixed_parameters(reader->Read<int16_t>()); 708 func.set_num_fixed_parameters(reader->Read<int16_t>());
709 func.set_num_optional_parameters(reader->Read<int16_t>()); 709 func.set_num_optional_parameters(reader->Read<int16_t>());
710 func.set_kind_tag(reader->Read<uint32_t>()); 710 func.set_kind_tag(reader->Read<uint32_t>());
711 func.set_token_pos(TokenPosition::SnapshotDecode(token_pos)); 711 func.set_token_pos(TokenPosition::SnapshotDecode(token_pos));
712 func.set_end_token_pos(TokenPosition::SnapshotDecode(end_token_pos)); 712 func.set_end_token_pos(TokenPosition::SnapshotDecode(end_token_pos));
713 func.set_usage_counter(reader->Read<int32_t>()); 713 func.set_usage_counter(reader->Read<int32_t>());
714 func.set_deoptimization_counter(reader->Read<int8_t>()); 714 func.set_deoptimization_counter(reader->Read<int8_t>());
715 func.set_optimized_instruction_count(reader->Read<uint16_t>()); 715 func.set_optimized_instruction_count(reader->Read<uint16_t>());
716 func.set_optimized_call_site_count(reader->Read<uint16_t>()); 716 func.set_optimized_call_site_count(reader->Read<uint16_t>());
717 func.set_kernel_function(NULL);
717 func.set_was_compiled(false); 718 func.set_was_compiled(false);
718 719
719 // Set all the object fields. 720 // Set all the object fields.
720 READ_OBJECT_FIELDS(func, 721 READ_OBJECT_FIELDS(func,
721 func.raw()->from(), func.raw()->to_snapshot(), 722 func.raw()->from(), func.raw()->to_snapshot(),
722 kAsReference); 723 kAsReference);
723 // Initialize all fields that are not part of the snapshot. 724 // Initialize all fields that are not part of the snapshot.
724 bool is_optimized = func.usage_counter() != 0; 725 bool is_optimized = func.usage_counter() != 0;
725 if (is_optimized) { 726 if (is_optimized) {
726 // Read the ic data array as the function is an optimized one. 727 // Read the ic data array as the function is an optimized one.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 // Allocate field object. 814 // Allocate field object.
814 Field& field = Field::ZoneHandle(reader->zone(), Field::New()); 815 Field& field = Field::ZoneHandle(reader->zone(), Field::New());
815 reader->AddBackRef(object_id, &field, kIsDeserialized); 816 reader->AddBackRef(object_id, &field, kIsDeserialized);
816 817
817 // Set all non object fields. 818 // Set all non object fields.
818 field.set_token_pos( 819 field.set_token_pos(
819 TokenPosition::SnapshotDecode(reader->Read<int32_t>())); 820 TokenPosition::SnapshotDecode(reader->Read<int32_t>()));
820 field.set_guarded_cid(reader->Read<int32_t>()); 821 field.set_guarded_cid(reader->Read<int32_t>());
821 field.set_is_nullable(reader->Read<int32_t>()); 822 field.set_is_nullable(reader->Read<int32_t>());
822 field.set_kind_bits(reader->Read<uint8_t>()); 823 field.set_kind_bits(reader->Read<uint8_t>());
824 field.set_kernel_field(NULL);
823 825
824 // Set all the object fields. 826 // Set all the object fields.
825 READ_OBJECT_FIELDS(field, 827 READ_OBJECT_FIELDS(field,
826 field.raw()->from(), 828 field.raw()->from(),
827 field.raw()->to_snapshot(kind), 829 field.raw()->to_snapshot(kind),
828 kAsReference); 830 kAsReference);
829 field.StorePointer(&field.raw_ptr()->dependent_code_, Array::null()); 831 field.StorePointer(&field.raw_ptr()->dependent_code_, Array::null());
830 832
831 if (!FLAG_use_field_guards) { 833 if (!FLAG_use_field_guards) {
832 field.set_guarded_cid(kDynamicCid); 834 field.set_guarded_cid(kDynamicCid);
(...skipping 2238 matching lines...) Expand 10 before | Expand all | Expand 10 after
3071 // We do not allow objects with native fields in an isolate message. 3073 // We do not allow objects with native fields in an isolate message.
3072 writer->SetWriteException(Exceptions::kArgument, 3074 writer->SetWriteException(Exceptions::kArgument,
3073 "Illegal argument in isolate message" 3075 "Illegal argument in isolate message"
3074 " : (object is a UserTag)"); 3076 " : (object is a UserTag)");
3075 } else { 3077 } else {
3076 UNREACHABLE(); 3078 UNREACHABLE();
3077 } 3079 }
3078 } 3080 }
3079 3081
3080 } // namespace dart 3082 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/redundancy_elimination.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698