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

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

Issue 8776020: Ongoing renaming of type classes: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/snapshot.h" 5 #include "vm/snapshot.h"
6 6
7 #include "vm/assert.h" 7 #include "vm/assert.h"
8 #include "vm/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 TEST_CASE(SerializeSingletons) { 162 TEST_CASE(SerializeSingletons) {
163 // Write snapshot with object content. 163 // Write snapshot with object content.
164 uint8_t* buffer; 164 uint8_t* buffer;
165 SnapshotWriter writer(false, &buffer, &allocator); 165 SnapshotWriter writer(false, &buffer, &allocator);
166 writer.WriteObject(Object::class_class()); 166 writer.WriteObject(Object::class_class());
167 writer.WriteObject(Object::null_class()); 167 writer.WriteObject(Object::null_class());
168 writer.WriteObject(Object::type_class()); 168 writer.WriteObject(Object::type_class());
169 writer.WriteObject(Object::type_parameter_class()); 169 writer.WriteObject(Object::type_parameter_class());
170 writer.WriteObject(Object::instantiated_type_class()); 170 writer.WriteObject(Object::instantiated_type_class());
171 writer.WriteObject(Object::type_arguments_class()); 171 writer.WriteObject(Object::abstract_type_arguments_class());
172 writer.WriteObject(Object::type_array_class()); 172 writer.WriteObject(Object::type_array_class());
regis 2011/12/01 22:20:16 type_arguments_class()
srdjan 2011/12/01 22:44:08 Done.
173 writer.WriteObject(Object::instantiated_type_arguments_class()); 173 writer.WriteObject(Object::instantiated_type_arguments_class());
174 writer.WriteObject(Object::function_class()); 174 writer.WriteObject(Object::function_class());
175 writer.WriteObject(Object::field_class()); 175 writer.WriteObject(Object::field_class());
176 writer.WriteObject(Object::token_stream_class()); 176 writer.WriteObject(Object::token_stream_class());
177 writer.WriteObject(Object::script_class()); 177 writer.WriteObject(Object::script_class());
178 writer.WriteObject(Object::library_class()); 178 writer.WriteObject(Object::library_class());
179 writer.WriteObject(Object::code_class()); 179 writer.WriteObject(Object::code_class());
180 writer.WriteObject(Object::instructions_class()); 180 writer.WriteObject(Object::instructions_class());
181 writer.WriteObject(Object::pc_descriptors_class()); 181 writer.WriteObject(Object::pc_descriptors_class());
182 writer.WriteObject(Object::exception_handlers_class()); 182 writer.WriteObject(Object::exception_handlers_class());
183 writer.WriteObject(Object::context_class()); 183 writer.WriteObject(Object::context_class());
184 writer.WriteObject(Object::context_scope_class()); 184 writer.WriteObject(Object::context_scope_class());
185 writer.FinalizeBuffer(); 185 writer.FinalizeBuffer();
186 186
187 // Create a snapshot object using the buffer. 187 // Create a snapshot object using the buffer.
188 const Snapshot* snapshot = Snapshot::SetupFromBuffer(buffer); 188 const Snapshot* snapshot = Snapshot::SetupFromBuffer(buffer);
189 189
190 // Read object back from the snapshot. 190 // Read object back from the snapshot.
191 Isolate* isolate= Isolate::Current(); 191 Isolate* isolate= Isolate::Current();
192 SnapshotReader reader(snapshot, isolate->heap(), isolate->object_store()); 192 SnapshotReader reader(snapshot, isolate->heap(), isolate->object_store());
193 EXPECT(Object::class_class() == reader.ReadObject()); 193 EXPECT(Object::class_class() == reader.ReadObject());
194 EXPECT(Object::null_class() == reader.ReadObject()); 194 EXPECT(Object::null_class() == reader.ReadObject());
195 EXPECT(Object::type_class() == reader.ReadObject()); 195 EXPECT(Object::type_class() == reader.ReadObject());
196 EXPECT(Object::type_parameter_class() == reader.ReadObject()); 196 EXPECT(Object::type_parameter_class() == reader.ReadObject());
197 EXPECT(Object::instantiated_type_class() == reader.ReadObject()); 197 EXPECT(Object::instantiated_type_class() == reader.ReadObject());
198 EXPECT(Object::type_arguments_class() == reader.ReadObject()); 198 EXPECT(Object::abstract_type_arguments_class() == reader.ReadObject());
199 EXPECT(Object::type_array_class() == reader.ReadObject()); 199 EXPECT(Object::type_array_class() == reader.ReadObject());
regis 2011/12/01 22:20:16 ditto
srdjan 2011/12/01 22:44:08 Done.
200 EXPECT(Object::instantiated_type_arguments_class() == reader.ReadObject()); 200 EXPECT(Object::instantiated_type_arguments_class() == reader.ReadObject());
201 EXPECT(Object::function_class() == reader.ReadObject()); 201 EXPECT(Object::function_class() == reader.ReadObject());
202 EXPECT(Object::field_class() == reader.ReadObject()); 202 EXPECT(Object::field_class() == reader.ReadObject());
203 EXPECT(Object::token_stream_class() == reader.ReadObject()); 203 EXPECT(Object::token_stream_class() == reader.ReadObject());
204 EXPECT(Object::script_class() == reader.ReadObject()); 204 EXPECT(Object::script_class() == reader.ReadObject());
205 EXPECT(Object::library_class() == reader.ReadObject()); 205 EXPECT(Object::library_class() == reader.ReadObject());
206 EXPECT(Object::code_class() == reader.ReadObject()); 206 EXPECT(Object::code_class() == reader.ReadObject());
207 EXPECT(Object::instructions_class() == reader.ReadObject()); 207 EXPECT(Object::instructions_class() == reader.ReadObject());
208 EXPECT(Object::pc_descriptors_class() == reader.ReadObject()); 208 EXPECT(Object::pc_descriptors_class() == reader.ReadObject());
209 EXPECT(Object::exception_handlers_class() == reader.ReadObject()); 209 EXPECT(Object::exception_handlers_class() == reader.ReadObject());
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 } 434 }
435 EXPECT_VALID(result); 435 EXPECT_VALID(result);
436 Dart_ExitScope(); 436 Dart_ExitScope();
437 } 437 }
438 Dart_ShutdownIsolate(); 438 Dart_ShutdownIsolate();
439 free(buffer); 439 free(buffer);
440 } 440 }
441 #endif // TARGET_ARCH_IA32. 441 #endif // TARGET_ARCH_IA32.
442 442
443 } // namespace dart 443 } // namespace dart
OLDNEW
« runtime/vm/raw_object_snapshot.cc ('K') | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698