| 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 5644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5655 private: | 5655 private: |
| 5656 enum { | 5656 enum { |
| 5657 kTypeArguments = 1, | 5657 kTypeArguments = 1, |
| 5658 kDataOffset = 2, | 5658 kDataOffset = 2, |
| 5659 kOffsetInBytesOffset = 3, | 5659 kOffsetInBytesOffset = 3, |
| 5660 kLengthOffset = 4, | 5660 kLengthOffset = 4, |
| 5661 }; | 5661 }; |
| 5662 }; | 5662 }; |
| 5663 | 5663 |
| 5664 | 5664 |
| 5665 // DartFunction represents the abstract Dart class 'Function'. | |
| 5666 class DartFunction : public Instance { | |
| 5667 private: | |
| 5668 FINAL_HEAP_OBJECT_IMPLEMENTATION(DartFunction, Instance); | |
| 5669 friend class Class; | |
| 5670 friend class Instance; | |
| 5671 }; | |
| 5672 | |
| 5673 | |
| 5674 class Closure : public AllStatic { | 5665 class Closure : public AllStatic { |
| 5675 public: | 5666 public: |
| 5676 static RawFunction* function(const Instance& closure) { | 5667 static RawFunction* function(const Instance& closure) { |
| 5677 return *FunctionAddr(closure); | 5668 return *FunctionAddr(closure); |
| 5678 } | 5669 } |
| 5679 static intptr_t function_offset() { | 5670 static intptr_t function_offset() { |
| 5680 return static_cast<intptr_t>(kFunctionOffset * kWordSize); | 5671 return static_cast<intptr_t>(kFunctionOffset * kWordSize); |
| 5681 } | 5672 } |
| 5682 | 5673 |
| 5683 static RawContext* context(const Instance& closure) { | 5674 static RawContext* context(const Instance& closure) { |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6058 | 6049 |
| 6059 | 6050 |
| 6060 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6051 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6061 intptr_t index) { | 6052 intptr_t index) { |
| 6062 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6053 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6063 } | 6054 } |
| 6064 | 6055 |
| 6065 } // namespace dart | 6056 } // namespace dart |
| 6066 | 6057 |
| 6067 #endif // VM_OBJECT_H_ | 6058 #endif // VM_OBJECT_H_ |
| OLD | NEW |