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

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

Issue 10375007: Revert "Implement {Int,Uint}{8,16,32,64} and Float{32,64} typed arrays." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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/bootstrap_natives.h ('k') | runtime/vm/dart_api_impl.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/class_finalizer.h" 5 #include "vm/class_finalizer.h"
6 6
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/heap.h" 8 #include "vm/heap.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 cls = object_store->mint_class(); 215 cls = object_store->mint_class();
216 ASSERT(Mint::InstanceSize() == cls.instance_size()); 216 ASSERT(Mint::InstanceSize() == cls.instance_size());
217 cls = object_store->bigint_class(); 217 cls = object_store->bigint_class();
218 ASSERT(Bigint::InstanceSize() == cls.instance_size()); 218 ASSERT(Bigint::InstanceSize() == cls.instance_size());
219 cls = object_store->bool_class(); 219 cls = object_store->bool_class();
220 ASSERT(Bool::InstanceSize() == cls.instance_size()); 220 ASSERT(Bool::InstanceSize() == cls.instance_size());
221 cls = object_store->array_class(); 221 cls = object_store->array_class();
222 ASSERT(Array::InstanceSize() == cls.instance_size()); 222 ASSERT(Array::InstanceSize() == cls.instance_size());
223 cls = object_store->immutable_array_class(); 223 cls = object_store->immutable_array_class();
224 ASSERT(ImmutableArray::InstanceSize() == cls.instance_size()); 224 ASSERT(ImmutableArray::InstanceSize() == cls.instance_size());
225 cls = object_store->uint8_array_class(); 225 cls = object_store->internal_byte_array_class();
226 ASSERT(Uint8Array::InstanceSize() == cls.instance_size()); 226 ASSERT(InternalByteArray::InstanceSize() == cls.instance_size());
227 cls = object_store->int16_array_class(); 227 cls = object_store->external_byte_array_class();
228 ASSERT(Int16Array::InstanceSize() == cls.instance_size()); 228 ASSERT(ExternalByteArray::InstanceSize() == cls.instance_size());
229 cls = object_store->uint16_array_class();
230 ASSERT(Uint16Array::InstanceSize() == cls.instance_size());
231 cls = object_store->int32_array_class();
232 ASSERT(Int32Array::InstanceSize() == cls.instance_size());
233 cls = object_store->uint32_array_class();
234 ASSERT(Uint32Array::InstanceSize() == cls.instance_size());
235 cls = object_store->int64_array_class();
236 ASSERT(Int64Array::InstanceSize() == cls.instance_size());
237 cls = object_store->uint64_array_class();
238 ASSERT(Uint64Array::InstanceSize() == cls.instance_size());
239 cls = object_store->float32_array_class();
240 ASSERT(Float32Array::InstanceSize() == cls.instance_size());
241 cls = object_store->float64_array_class();
242 ASSERT(Float64Array::InstanceSize() == cls.instance_size());
243 cls = object_store->external_int8_array_class();
244 ASSERT(ExternalInt8Array::InstanceSize() == cls.instance_size());
245 cls = object_store->external_uint8_array_class();
246 ASSERT(ExternalUint8Array::InstanceSize() == cls.instance_size());
247 cls = object_store->external_int16_array_class();
248 ASSERT(ExternalInt16Array::InstanceSize() == cls.instance_size());
249 cls = object_store->external_uint16_array_class();
250 ASSERT(ExternalUint16Array::InstanceSize() == cls.instance_size());
251 cls = object_store->external_int32_array_class();
252 ASSERT(ExternalInt32Array::InstanceSize() == cls.instance_size());
253 cls = object_store->external_uint32_array_class();
254 ASSERT(ExternalUint32Array::InstanceSize() == cls.instance_size());
255 cls = object_store->external_int64_array_class();
256 ASSERT(ExternalInt64Array::InstanceSize() == cls.instance_size());
257 cls = object_store->external_uint64_array_class();
258 ASSERT(ExternalUint64Array::InstanceSize() == cls.instance_size());
259 cls = object_store->external_float32_array_class();
260 ASSERT(ExternalFloat32Array::InstanceSize() == cls.instance_size());
261 cls = object_store->external_float64_array_class();
262 ASSERT(ExternalFloat64Array::InstanceSize() == cls.instance_size());
263 #endif // defined(DEBUG) 229 #endif // defined(DEBUG)
264 230
265 // Remember the currently pending classes. 231 // Remember the currently pending classes.
266 const GrowableObjectArray& class_array = 232 const GrowableObjectArray& class_array =
267 GrowableObjectArray::Handle(object_store->pending_classes()); 233 GrowableObjectArray::Handle(object_store->pending_classes());
268 for (intptr_t i = 0; i < class_array.Length(); i++) { 234 for (intptr_t i = 0; i < class_array.Length(); i++) {
269 // TODO(iposva): Add real checks. 235 // TODO(iposva): Add real checks.
270 cls ^= class_array.At(i); 236 cls ^= class_array.At(i);
271 if (cls.is_finalized() || cls.is_prefinalized()) { 237 if (cls.is_finalized() || cls.is_prefinalized()) {
272 // Pre-finalized bootstrap classes must not define any fields. 238 // Pre-finalized bootstrap classes must not define any fields.
273 ASSERT(!cls.HasInstanceFields()); 239 ASSERT(Array::Handle(cls.fields()).Length() == 0);
274 } 240 }
275 } 241 }
276 242
277 // Finalize classes that aren't pre-finalized by Object::Init(). 243 // Finalize classes that aren't pre-finalized by Object::Init().
278 if (!FinalizePendingClasses()) { 244 if (!FinalizePendingClasses()) {
279 // TODO(srdjan): Exit like a real VM instead. 245 // TODO(srdjan): Exit like a real VM instead.
280 const Error& err = Error::Handle(object_store->sticky_error()); 246 const Error& err = Error::Handle(object_store->sticky_error());
281 OS::PrintErr("Could not verify bootstrap classes : %s\n", 247 OS::PrintErr("Could not verify bootstrap classes : %s\n",
282 err.ToErrorCString()); 248 err.ToErrorCString());
283 OS::Exit(255); 249 OS::Exit(255);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 Class::Handle(core_impl_lib.LookupClass(integer_implementation_name)); 312 Class::Handle(core_impl_lib.LookupClass(integer_implementation_name));
347 const String& growable_object_array_name = 313 const String& growable_object_array_name =
348 String::Handle(String::NewSymbol("GrowableObjectArray")); 314 String::Handle(String::NewSymbol("GrowableObjectArray"));
349 const Class& growable_object_array_class = 315 const Class& growable_object_array_class =
350 Class::Handle(core_impl_lib.LookupClass(growable_object_array_name)); 316 Class::Handle(core_impl_lib.LookupClass(growable_object_array_name));
351 if ((super_class.raw() == object_store->bool_class()) || 317 if ((super_class.raw() == object_store->bool_class()) ||
352 (super_class.raw() == object_store->double_class()) || 318 (super_class.raw() == object_store->double_class()) ||
353 (super_class.raw() == object_store->array_class()) || 319 (super_class.raw() == object_store->array_class()) ||
354 (super_class.raw() == object_store->immutable_array_class()) || 320 (super_class.raw() == object_store->immutable_array_class()) ||
355 (super_class.raw() == growable_object_array_class.raw()) || 321 (super_class.raw() == growable_object_array_class.raw()) ||
356 (super_class.raw() == object_store->int8_array_class()) || 322 (super_class.raw() == object_store->internal_byte_array_class()) ||
357 (super_class.raw() == object_store->uint8_array_class()) || 323 (super_class.raw() == object_store->external_byte_array_class()) ||
358 (super_class.raw() == object_store->int16_array_class()) ||
359 (super_class.raw() == object_store->uint16_array_class()) ||
360 (super_class.raw() == object_store->int32_array_class()) ||
361 (super_class.raw() == object_store->uint32_array_class()) ||
362 (super_class.raw() == object_store->int64_array_class()) ||
363 (super_class.raw() == object_store->uint64_array_class()) ||
364 (super_class.raw() == object_store->float32_array_class()) ||
365 (super_class.raw() == object_store->float64_array_class()) ||
366 (super_class.raw() == object_store->external_int8_array_class()) ||
367 (super_class.raw() == object_store->external_uint8_array_class()) ||
368 (super_class.raw() == object_store->external_int16_array_class()) ||
369 (super_class.raw() == object_store->external_uint16_array_class()) ||
370 (super_class.raw() == object_store->external_int32_array_class()) ||
371 (super_class.raw() == object_store->external_uint32_array_class()) ||
372 (super_class.raw() == object_store->external_int64_array_class()) ||
373 (super_class.raw() == object_store->external_uint64_array_class()) ||
374 (super_class.raw() == object_store->external_float32_array_class()) ||
375 (super_class.raw() == object_store->external_float64_array_class()) ||
376 (super_class.raw() == integer_implementation_class.raw()) || 324 (super_class.raw() == integer_implementation_class.raw()) ||
377 (super_class.raw() == object_store->smi_class()) || 325 (super_class.raw() == object_store->smi_class()) ||
378 (super_class.raw() == object_store->mint_class()) || 326 (super_class.raw() == object_store->mint_class()) ||
379 (super_class.raw() == object_store->bigint_class()) || 327 (super_class.raw() == object_store->bigint_class()) ||
380 (super_class.raw() == object_store->one_byte_string_class()) || 328 (super_class.raw() == object_store->one_byte_string_class()) ||
381 (super_class.raw() == object_store->two_byte_string_class()) || 329 (super_class.raw() == object_store->two_byte_string_class()) ||
382 (super_class.raw() == object_store->four_byte_string_class())) { 330 (super_class.raw() == object_store->four_byte_string_class())) {
383 const Script& script = Script::Handle(cls.script()); 331 const Script& script = Script::Handle(cls.script());
384 ReportError(script, cls.token_index(), 332 ReportError(script, cls.token_index(),
385 "'%s' is not allowed to extend '%s'", 333 "'%s' is not allowed to extend '%s'",
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 void ClassFinalizer::ReportError(const char* format, ...) { 1362 void ClassFinalizer::ReportError(const char* format, ...) {
1415 va_list args; 1363 va_list args;
1416 va_start(args, format); 1364 va_start(args, format);
1417 const Error& error = Error::Handle( 1365 const Error& error = Error::Handle(
1418 Parser::FormatError(Script::Handle(), -1, "Error", format, args)); 1366 Parser::FormatError(Script::Handle(), -1, "Error", format, args));
1419 va_end(args); 1367 va_end(args);
1420 ReportError(error); 1368 ReportError(error);
1421 } 1369 }
1422 1370
1423 } // namespace dart 1371 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698