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/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1451 | 1451 |
1452 uword address = heap->Allocate(size, space); | 1452 uword address = heap->Allocate(size, space); |
1453 if (address == 0) { | 1453 if (address == 0) { |
1454 // Use the preallocated out of memory exception to avoid calling | 1454 // Use the preallocated out of memory exception to avoid calling |
1455 // into dart code or allocating any code. | 1455 // into dart code or allocating any code. |
1456 const Instance& exception = | 1456 const Instance& exception = |
1457 Instance::Handle(isolate->object_store()->out_of_memory()); | 1457 Instance::Handle(isolate->object_store()->out_of_memory()); |
1458 Exceptions::Throw(exception); | 1458 Exceptions::Throw(exception); |
1459 UNREACHABLE(); | 1459 UNREACHABLE(); |
1460 } | 1460 } |
| 1461 if (space == Heap::kNew) { |
| 1462 isolate->class_table()->UpdateAllocatedNew(cls_id, size); |
| 1463 } else { |
| 1464 isolate->class_table()->UpdateAllocatedOld(cls_id, size); |
| 1465 } |
1461 NoGCScope no_gc; | 1466 NoGCScope no_gc; |
1462 InitializeObject(address, cls_id, size); | 1467 InitializeObject(address, cls_id, size); |
1463 RawObject* raw_obj = reinterpret_cast<RawObject*>(address + kHeapObjectTag); | 1468 RawObject* raw_obj = reinterpret_cast<RawObject*>(address + kHeapObjectTag); |
1464 ASSERT(cls_id == RawObject::ClassIdTag::decode(raw_obj->ptr()->tags_)); | 1469 ASSERT(cls_id == RawObject::ClassIdTag::decode(raw_obj->ptr()->tags_)); |
1465 return raw_obj; | 1470 return raw_obj; |
1466 } | 1471 } |
1467 | 1472 |
1468 | 1473 |
1469 class StoreBufferUpdateVisitor : public ObjectPointerVisitor { | 1474 class StoreBufferUpdateVisitor : public ObjectPointerVisitor { |
1470 public: | 1475 public: |
(...skipping 15320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16791 return "_MirrorReference"; | 16796 return "_MirrorReference"; |
16792 } | 16797 } |
16793 | 16798 |
16794 | 16799 |
16795 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 16800 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
16796 Instance::PrintToJSONStream(stream, ref); | 16801 Instance::PrintToJSONStream(stream, ref); |
16797 } | 16802 } |
16798 | 16803 |
16799 | 16804 |
16800 } // namespace dart | 16805 } // namespace dart |
OLD | NEW |