OLD | NEW |
---|---|
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/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
489 | 489 |
490 // Set up names for object array and one byte string class which are | 490 // Set up names for object array and one byte string class which are |
491 // pre-allocated in the vm isolate also. | 491 // pre-allocated in the vm isolate also. |
492 cls = Dart::vm_isolate()->object_store()->array_class(); | 492 cls = Dart::vm_isolate()->object_store()->array_class(); |
493 cls.set_name(Symbols::ObjectArray()); | 493 cls.set_name(Symbols::ObjectArray()); |
494 cls = Dart::vm_isolate()->object_store()->one_byte_string_class(); | 494 cls = Dart::vm_isolate()->object_store()->one_byte_string_class(); |
495 cls.set_name(Symbols::OneByteString()); | 495 cls.set_name(Symbols::OneByteString()); |
496 } | 496 } |
497 | 497 |
498 | 498 |
499 void Object::CreateInternalMetaData() { | |
500 // Initialize meta data for VM internal classes. | |
501 Class& cls = Class::Handle(); | |
502 Array& fields = Array::Handle(); | |
503 Field& fld = Field::Handle(); | |
504 String& name = String::Handle(); | |
505 | |
506 // TODO(iposva): Add more of the VM classes here. | |
507 cls = context_class_; | |
508 fields = Array::New(1); | |
509 name = Symbols::New("parent _"); | |
cshapiro
2013/01/11 21:23:21
Maybe use @ instead of ' ' in the identifier so we
Ivan Posva
2013/01/11 23:05:37
Done.
| |
510 fld = Field::New(name, false, false, false, cls, 0); | |
511 fields.SetAt(0, fld); | |
512 cls. SetFields(fields); | |
cshapiro
2013/01/11 21:23:21
Horizontal space!
Ivan Posva
2013/01/11 23:05:37
Done.
| |
513 } | |
514 | |
515 | |
499 // Make unused space in an object whose type has been transformed safe | 516 // Make unused space in an object whose type has been transformed safe |
500 // for traversing during GC. | 517 // for traversing during GC. |
501 // The unused part of the transformed object is marked as an Array | 518 // The unused part of the transformed object is marked as an Array |
502 // object or a regular Object so that it can be traversed during garbage | 519 // object or a regular Object so that it can be traversed during garbage |
503 // collection. | 520 // collection. |
504 void Object::MakeUnusedSpaceTraversable(const Object& obj, | 521 void Object::MakeUnusedSpaceTraversable(const Object& obj, |
505 intptr_t original_size, | 522 intptr_t original_size, |
506 intptr_t used_size) { | 523 intptr_t used_size) { |
507 ASSERT(Isolate::Current()->no_gc_scope_depth() > 0); | 524 ASSERT(Isolate::Current()->no_gc_scope_depth() > 0); |
508 ASSERT(!obj.IsNull()); | 525 ASSERT(!obj.IsNull()); |
(...skipping 11942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
12451 } | 12468 } |
12452 return result.raw(); | 12469 return result.raw(); |
12453 } | 12470 } |
12454 | 12471 |
12455 | 12472 |
12456 const char* WeakProperty::ToCString() const { | 12473 const char* WeakProperty::ToCString() const { |
12457 return "_WeakProperty"; | 12474 return "_WeakProperty"; |
12458 } | 12475 } |
12459 | 12476 |
12460 } // namespace dart | 12477 } // namespace dart |
OLD | NEW |