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

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: Make precompiler work with new error class 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
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 105 }
106 106
107 void WriteClass(Serializer* s, RawClass* cls) { 107 void WriteClass(Serializer* s, RawClass* cls) {
108 Snapshot::Kind kind = s->kind(); 108 Snapshot::Kind kind = s->kind();
109 RawObject** from = cls->from(); 109 RawObject** from = cls->from();
110 RawObject** to = cls->to_snapshot(kind); 110 RawObject** to = cls->to_snapshot(kind);
111 for (RawObject** p = from; p <= to; p++) { 111 for (RawObject** p = from; p <= to; p++) {
112 s->WriteRef(*p); 112 s->WriteRef(*p);
113 } 113 }
114 intptr_t class_id = cls->ptr()->id_; 114 intptr_t class_id = cls->ptr()->id_;
115 ASSERT(class_id != kIllegalCid);
115 s->WriteCid(class_id); 116 s->WriteCid(class_id);
116 s->Write<int32_t>(cls->ptr()->instance_size_in_words_); 117 s->Write<int32_t>(cls->ptr()->instance_size_in_words_);
117 s->Write<int32_t>(cls->ptr()->next_field_offset_in_words_); 118 s->Write<int32_t>(cls->ptr()->next_field_offset_in_words_);
118 s->Write<int32_t>(cls->ptr()->type_arguments_field_offset_in_words_); 119 s->Write<int32_t>(cls->ptr()->type_arguments_field_offset_in_words_);
119 s->Write<uint16_t>(cls->ptr()->num_type_arguments_); 120 s->Write<uint16_t>(cls->ptr()->num_type_arguments_);
120 s->Write<uint16_t>(cls->ptr()->num_own_type_arguments_); 121 s->Write<uint16_t>(cls->ptr()->num_own_type_arguments_);
121 s->Write<uint16_t>(cls->ptr()->num_native_fields_); 122 s->Write<uint16_t>(cls->ptr()->num_native_fields_);
122 s->WriteTokenPosition(cls->ptr()->token_pos_); 123 s->WriteTokenPosition(cls->ptr()->token_pos_);
123 s->Write<uint16_t>(cls->ptr()->state_bits_); 124 s->Write<uint16_t>(cls->ptr()->state_bits_);
124 } 125 }
(...skipping 4890 matching lines...) Expand 10 before | Expand all | Expand 10 after
5015 5016
5016 deserializer.ReadVMSnapshot(); 5017 deserializer.ReadVMSnapshot();
5017 5018
5018 Dart::set_instructions_snapshot_buffer(instructions_buffer_); 5019 Dart::set_instructions_snapshot_buffer(instructions_buffer_);
5019 Dart::set_data_snapshot_buffer(data_buffer_); 5020 Dart::set_data_snapshot_buffer(data_buffer_);
5020 5021
5021 return ApiError::null(); 5022 return ApiError::null();
5022 } 5023 }
5023 5024
5024 } // namespace dart 5025 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698