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 #ifndef VM_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
(...skipping 6451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6462 } | 6462 } |
6463 static intptr_t NextFieldOffset() { | 6463 static intptr_t NextFieldOffset() { |
6464 // Indicates this class cannot be extended by dart code. | 6464 // Indicates this class cannot be extended by dart code. |
6465 return -kWordSize; | 6465 return -kWordSize; |
6466 } | 6466 } |
6467 | 6467 |
6468 friend class Class; | 6468 friend class Class; |
6469 }; | 6469 }; |
6470 | 6470 |
6471 | 6471 |
| 6472 class Capability : public Instance { |
| 6473 public: |
| 6474 uint64_t Id() const { return raw_ptr()->id_; } |
| 6475 |
| 6476 static intptr_t InstanceSize() { |
| 6477 return RoundedAllocationSize(sizeof(RawCapability)); |
| 6478 } |
| 6479 static RawCapability* New(uint64_t id, Heap::Space space = Heap::kNew); |
| 6480 |
| 6481 private: |
| 6482 FINAL_HEAP_OBJECT_IMPLEMENTATION(Capability, Instance); |
| 6483 friend class Class; |
| 6484 }; |
| 6485 |
| 6486 |
| 6487 class ReceivePort : public Instance { |
| 6488 public: |
| 6489 RawSendPort* send_port() const { return raw_ptr()->send_port_; } |
| 6490 Dart_Port Id() const { return send_port()->ptr()->id_; } |
| 6491 |
| 6492 RawInstance* handler() const { return raw_ptr()->handler_; } |
| 6493 void set_handler(const Instance& value) const; |
| 6494 |
| 6495 static intptr_t InstanceSize() { |
| 6496 return RoundedAllocationSize(sizeof(RawReceivePort)); |
| 6497 } |
| 6498 static RawReceivePort* New(Dart_Port id, Heap::Space space = Heap::kNew); |
| 6499 |
| 6500 private: |
| 6501 FINAL_HEAP_OBJECT_IMPLEMENTATION(ReceivePort, Instance); |
| 6502 friend class Class; |
| 6503 }; |
| 6504 |
| 6505 |
| 6506 class SendPort : public Instance { |
| 6507 public: |
| 6508 Dart_Port Id() const { return raw_ptr()->id_; } |
| 6509 |
| 6510 static intptr_t InstanceSize() { |
| 6511 return RoundedAllocationSize(sizeof(RawSendPort)); |
| 6512 } |
| 6513 static RawSendPort* New(Dart_Port id, Heap::Space space = Heap::kNew); |
| 6514 |
| 6515 private: |
| 6516 FINAL_HEAP_OBJECT_IMPLEMENTATION(SendPort, Instance); |
| 6517 friend class Class; |
| 6518 }; |
| 6519 |
| 6520 |
6472 // Internal stacktrace object used in exceptions for printing stack traces. | 6521 // Internal stacktrace object used in exceptions for printing stack traces. |
6473 class Stacktrace : public Instance { | 6522 class Stacktrace : public Instance { |
6474 public: | 6523 public: |
6475 static const int kPreallocatedStackdepth = 10; | 6524 static const int kPreallocatedStackdepth = 10; |
6476 | 6525 |
6477 intptr_t Length() const; | 6526 intptr_t Length() const; |
6478 | 6527 |
6479 RawFunction* FunctionAtFrame(intptr_t frame_index) const; | 6528 RawFunction* FunctionAtFrame(intptr_t frame_index) const; |
6480 | 6529 |
6481 RawCode* CodeAtFrame(intptr_t frame_index) const; | 6530 RawCode* CodeAtFrame(intptr_t frame_index) const; |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6835 | 6884 |
6836 | 6885 |
6837 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6886 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
6838 intptr_t index) { | 6887 intptr_t index) { |
6839 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6888 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
6840 } | 6889 } |
6841 | 6890 |
6842 } // namespace dart | 6891 } // namespace dart |
6843 | 6892 |
6844 #endif // VM_OBJECT_H_ | 6893 #endif // VM_OBJECT_H_ |
OLD | NEW |