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 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1439 | 1439 |
1440 uword address = heap->Allocate(size, space); | 1440 uword address = heap->Allocate(size, space); |
1441 if (address == 0) { | 1441 if (address == 0) { |
1442 // Use the preallocated out of memory exception to avoid calling | 1442 // Use the preallocated out of memory exception to avoid calling |
1443 // into dart code or allocating any code. | 1443 // into dart code or allocating any code. |
1444 const Instance& exception = | 1444 const Instance& exception = |
1445 Instance::Handle(isolate->object_store()->out_of_memory()); | 1445 Instance::Handle(isolate->object_store()->out_of_memory()); |
1446 Exceptions::Throw(exception); | 1446 Exceptions::Throw(exception); |
1447 UNREACHABLE(); | 1447 UNREACHABLE(); |
1448 } | 1448 } |
1449 if (space == Heap::kNew) { | |
1450 isolate->class_table()->ReportAllocationNewSpace(cls_id, size); | |
Ivan Posva
2013/12/12 13:53:24
This separation should probably be done in the cla
Cutch
2013/12/13 01:31:09
Agreed, but, #including heap.h into class_table.h
| |
1451 } else { | |
1452 isolate->class_table()->ReportAllocationOldSpace(cls_id, size); | |
1453 } | |
1449 NoGCScope no_gc; | 1454 NoGCScope no_gc; |
1450 InitializeObject(address, cls_id, size); | 1455 InitializeObject(address, cls_id, size); |
1451 RawObject* raw_obj = reinterpret_cast<RawObject*>(address + kHeapObjectTag); | 1456 RawObject* raw_obj = reinterpret_cast<RawObject*>(address + kHeapObjectTag); |
1452 ASSERT(cls_id == RawObject::ClassIdTag::decode(raw_obj->ptr()->tags_)); | 1457 ASSERT(cls_id == RawObject::ClassIdTag::decode(raw_obj->ptr()->tags_)); |
1453 return raw_obj; | 1458 return raw_obj; |
1454 } | 1459 } |
1455 | 1460 |
1456 | 1461 |
1457 class StoreBufferUpdateVisitor : public ObjectPointerVisitor { | 1462 class StoreBufferUpdateVisitor : public ObjectPointerVisitor { |
1458 public: | 1463 public: |
(...skipping 14322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
15781 return "_MirrorReference"; | 15786 return "_MirrorReference"; |
15782 } | 15787 } |
15783 | 15788 |
15784 | 15789 |
15785 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 15790 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
15786 JSONObject jsobj(stream); | 15791 JSONObject jsobj(stream); |
15787 } | 15792 } |
15788 | 15793 |
15789 | 15794 |
15790 } // namespace dart | 15795 } // namespace dart |
OLD | NEW |