| 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 RUNTIME_VM_RAW_OBJECT_H_ | 5 #ifndef RUNTIME_VM_RAW_OBJECT_H_ |
| 6 #define RUNTIME_VM_RAW_OBJECT_H_ | 6 #define RUNTIME_VM_RAW_OBJECT_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/atomic.h" | 9 #include "vm/atomic.h" |
| 10 #include "vm/exceptions.h" | 10 #include "vm/exceptions.h" |
| (...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1776 | 1776 |
| 1777 | 1777 |
| 1778 class RawClosure : public RawInstance { | 1778 class RawClosure : public RawInstance { |
| 1779 private: | 1779 private: |
| 1780 RAW_HEAP_OBJECT_IMPLEMENTATION(Closure); | 1780 RAW_HEAP_OBJECT_IMPLEMENTATION(Closure); |
| 1781 | 1781 |
| 1782 RawObject** from() { | 1782 RawObject** from() { |
| 1783 return reinterpret_cast<RawObject**>(&ptr()->instantiator_type_arguments_); | 1783 return reinterpret_cast<RawObject**>(&ptr()->instantiator_type_arguments_); |
| 1784 } | 1784 } |
| 1785 | 1785 |
| 1786 // No instance fields should be declared before the following 3 fields whose | 1786 // No instance fields should be declared before the following 4 fields whose |
| 1787 // offsets must be identical in Dart and C++. | 1787 // offsets must be identical in Dart and C++. |
| 1788 | 1788 |
| 1789 // These 4 fields are also declared in the Dart source of class _Closure. | 1789 // These 4 fields are also declared in the Dart source of class _Closure. |
| 1790 RawTypeArguments* instantiator_type_arguments_; | 1790 RawTypeArguments* instantiator_type_arguments_; |
| 1791 RawTypeArguments* function_type_arguments_; | 1791 RawTypeArguments* function_type_arguments_; |
| 1792 RawFunction* function_; | 1792 RawFunction* function_; |
| 1793 RawContext* context_; | 1793 RawContext* context_; |
| 1794 | 1794 |
| 1795 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->context_); } | 1795 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->context_); } |
| 1796 |
| 1797 // Note that instantiator_type_arguments_ and function_type_arguments_ are |
| 1798 // used to instantiate the signature of function_ when this closure is |
| 1799 // involved in a type test. In other words, these fields define the function |
| 1800 // type of this closure instance, but they are not used when invoking it. |
| 1801 // If this closure is generic, it can be invoked with function type arguments |
| 1802 // that will be processed in the prolog of the closure function_. For example, |
| 1803 // if the generic closure function_ has a generic parent function, the |
| 1804 // passed-in function type arguments get concatenated to the function type |
| 1805 // arguments of the parent that are found in the context_. |
| 1796 }; | 1806 }; |
| 1797 | 1807 |
| 1798 | 1808 |
| 1799 class RawNumber : public RawInstance { | 1809 class RawNumber : public RawInstance { |
| 1800 RAW_OBJECT_IMPLEMENTATION(Number); | 1810 RAW_OBJECT_IMPLEMENTATION(Number); |
| 1801 }; | 1811 }; |
| 1802 | 1812 |
| 1803 | 1813 |
| 1804 class RawInteger : public RawNumber { | 1814 class RawInteger : public RawNumber { |
| 1805 RAW_OBJECT_IMPLEMENTATION(Integer); | 1815 RAW_OBJECT_IMPLEMENTATION(Integer); |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2436 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2446 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
| 2437 kTypedDataInt8ArrayViewCid + 15); | 2447 kTypedDataInt8ArrayViewCid + 15); |
| 2438 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2448 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
| 2439 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2449 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
| 2440 return (kNullCid - kTypedDataInt8ArrayCid); | 2450 return (kNullCid - kTypedDataInt8ArrayCid); |
| 2441 } | 2451 } |
| 2442 | 2452 |
| 2443 } // namespace dart | 2453 } // namespace dart |
| 2444 | 2454 |
| 2445 #endif // RUNTIME_VM_RAW_OBJECT_H_ | 2455 #endif // RUNTIME_VM_RAW_OBJECT_H_ |
| OLD | NEW |