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

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

Issue 2044753002: Make compile-time errors catchable (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review comments Created 4 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
« no previous file with comments | « runtime/lib/errors_patch.dart ('k') | runtime/vm/compiler.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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/clustered_snapshot.h" 5 #include "vm/clustered_snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bootstrap.h" 8 #include "vm/bootstrap.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 107
108 void WriteClass(Serializer* s, RawClass* cls) { 108 void WriteClass(Serializer* s, RawClass* cls) {
109 Snapshot::Kind kind = s->kind(); 109 Snapshot::Kind kind = s->kind();
110 RawObject** from = cls->from(); 110 RawObject** from = cls->from();
111 RawObject** to = cls->to_snapshot(kind); 111 RawObject** to = cls->to_snapshot(kind);
112 for (RawObject** p = from; p <= to; p++) { 112 for (RawObject** p = from; p <= to; p++) {
113 s->WriteRef(*p); 113 s->WriteRef(*p);
114 } 114 }
115 intptr_t class_id = cls->ptr()->id_; 115 intptr_t class_id = cls->ptr()->id_;
116 ASSERT(class_id != kIllegalCid);
116 s->WriteCid(class_id); 117 s->WriteCid(class_id);
117 s->Write<int32_t>(cls->ptr()->instance_size_in_words_); 118 s->Write<int32_t>(cls->ptr()->instance_size_in_words_);
118 s->Write<int32_t>(cls->ptr()->next_field_offset_in_words_); 119 s->Write<int32_t>(cls->ptr()->next_field_offset_in_words_);
119 s->Write<int32_t>(cls->ptr()->type_arguments_field_offset_in_words_); 120 s->Write<int32_t>(cls->ptr()->type_arguments_field_offset_in_words_);
120 s->Write<uint16_t>(cls->ptr()->num_type_arguments_); 121 s->Write<uint16_t>(cls->ptr()->num_type_arguments_);
121 s->Write<uint16_t>(cls->ptr()->num_own_type_arguments_); 122 s->Write<uint16_t>(cls->ptr()->num_own_type_arguments_);
122 s->Write<uint16_t>(cls->ptr()->num_native_fields_); 123 s->Write<uint16_t>(cls->ptr()->num_native_fields_);
123 s->WriteTokenPosition(cls->ptr()->token_pos_); 124 s->WriteTokenPosition(cls->ptr()->token_pos_);
124 s->Write<uint16_t>(cls->ptr()->state_bits_); 125 s->Write<uint16_t>(cls->ptr()->state_bits_);
125 } 126 }
(...skipping 4993 matching lines...) Expand 10 before | Expand all | Expand 10 after
5119 5120
5120 deserializer.ReadVMSnapshot(); 5121 deserializer.ReadVMSnapshot();
5121 5122
5122 Dart::set_instructions_snapshot_buffer(instructions_buffer_); 5123 Dart::set_instructions_snapshot_buffer(instructions_buffer_);
5123 Dart::set_data_snapshot_buffer(data_buffer_); 5124 Dart::set_data_snapshot_buffer(data_buffer_);
5124 5125
5125 return ApiError::null(); 5126 return ApiError::null();
5126 } 5127 }
5127 5128
5128 } // namespace dart 5129 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/errors_patch.dart ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698