| 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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 isolate->object_store()->set_immutable_array_class(cls); | 490 isolate->object_store()->set_immutable_array_class(cls); |
| 491 cls.set_type_arguments_field_offset(Array::type_arguments_offset()); | 491 cls.set_type_arguments_field_offset(Array::type_arguments_offset()); |
| 492 cls = Class::NewStringClass(kOneByteStringCid); | 492 cls = Class::NewStringClass(kOneByteStringCid); |
| 493 isolate->object_store()->set_one_byte_string_class(cls); | 493 isolate->object_store()->set_one_byte_string_class(cls); |
| 494 cls = Class::NewStringClass(kTwoByteStringCid); | 494 cls = Class::NewStringClass(kTwoByteStringCid); |
| 495 isolate->object_store()->set_two_byte_string_class(cls); | 495 isolate->object_store()->set_two_byte_string_class(cls); |
| 496 | 496 |
| 497 // Allocate and initialize the empty_array instance. | 497 // Allocate and initialize the empty_array instance. |
| 498 { | 498 { |
| 499 uword address = heap->Allocate(Array::InstanceSize(0), Heap::kOld); | 499 uword address = heap->Allocate(Array::InstanceSize(0), Heap::kOld); |
| 500 *empty_array_ = reinterpret_cast<RawArray*>(address + kHeapObjectTag); | |
| 501 InitializeObject(address, kArrayCid, Array::InstanceSize(0)); | 500 InitializeObject(address, kArrayCid, Array::InstanceSize(0)); |
| 501 Array::initializeHandle( |
| 502 empty_array_, |
| 503 reinterpret_cast<RawArray*>(address + kHeapObjectTag)); |
| 502 empty_array_->raw()->ptr()->length_ = Smi::New(0); | 504 empty_array_->raw()->ptr()->length_ = Smi::New(0); |
| 503 } | 505 } |
| 504 | 506 |
| 505 // Allocate and initialize singleton true and false boolean objects. | 507 // Allocate and initialize singleton true and false boolean objects. |
| 506 cls = Class::New<Bool>(); | 508 cls = Class::New<Bool>(); |
| 507 isolate->object_store()->set_bool_class(cls); | 509 isolate->object_store()->set_bool_class(cls); |
| 508 *bool_true_ = Bool::New(true); | 510 *bool_true_ = Bool::New(true); |
| 509 *bool_false_ = Bool::New(false); | 511 *bool_false_ = Bool::New(false); |
| 512 ASSERT(!empty_array_->IsSmi()); |
| 513 ASSERT(empty_array_->IsArray()); |
| 514 ASSERT(!sentinel_->IsSmi()); |
| 515 ASSERT(sentinel_->IsInstance()); |
| 516 ASSERT(!transition_sentinel_->IsSmi()); |
| 517 ASSERT(transition_sentinel_->IsInstance()); |
| 518 ASSERT(!bool_true_->IsSmi()); |
| 519 ASSERT(bool_true_->IsBool()); |
| 520 ASSERT(!bool_false_->IsSmi()); |
| 521 ASSERT(bool_false_->IsBool()); |
| 510 } | 522 } |
| 511 | 523 |
| 512 | 524 |
| 513 #define SET_CLASS_NAME(class_name, name) \ | 525 #define SET_CLASS_NAME(class_name, name) \ |
| 514 cls = class_name##_class(); \ | 526 cls = class_name##_class(); \ |
| 515 cls.set_name(Symbols::name()); \ | 527 cls.set_name(Symbols::name()); \ |
| 516 | 528 |
| 517 void Object::RegisterSingletonClassNames() { | 529 void Object::RegisterSingletonClassNames() { |
| 518 Class& cls = Class::Handle(); | 530 Class& cls = Class::Handle(); |
| 519 | 531 |
| (...skipping 12582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13102 } | 13114 } |
| 13103 return result.raw(); | 13115 return result.raw(); |
| 13104 } | 13116 } |
| 13105 | 13117 |
| 13106 | 13118 |
| 13107 const char* WeakProperty::ToCString() const { | 13119 const char* WeakProperty::ToCString() const { |
| 13108 return "_WeakProperty"; | 13120 return "_WeakProperty"; |
| 13109 } | 13121 } |
| 13110 | 13122 |
| 13111 } // namespace dart | 13123 } // namespace dart |
| OLD | NEW |