Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/assert.h" | 8 #include "vm/assert.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/handles.h" | 10 #include "vm/handles.h" |
| (...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1132 bool IsSubtypeOf(const Function& other) const { | 1132 bool IsSubtypeOf(const Function& other) const { |
| 1133 return TestType(kIsSubtypeOf, other); | 1133 return TestType(kIsSubtypeOf, other); |
| 1134 } | 1134 } |
| 1135 | 1135 |
| 1136 // Returns true if the type of this function can be assigned to the type of | 1136 // Returns true if the type of this function can be assigned to the type of |
| 1137 // the destination function. | 1137 // the destination function. |
| 1138 bool IsAssignableTo(const Function& dst) const { | 1138 bool IsAssignableTo(const Function& dst) const { |
| 1139 return TestType(kIsAssignableTo, dst); | 1139 return TestType(kIsAssignableTo, dst); |
| 1140 } | 1140 } |
| 1141 | 1141 |
| 1142 // Returns true if this function represents a closure function. | 1142 // Returns true if this function represents a (possibly implicit) closure |
| 1143 // function. | |
| 1143 bool IsClosureFunction() const { | 1144 bool IsClosureFunction() const { |
| 1144 return kind() == RawFunction::kClosureFunction; | 1145 return kind() == RawFunction::kClosureFunction; |
| 1145 } | 1146 } |
| 1146 | 1147 |
| 1148 // Returns true if this function represents an implicit closure function. | |
| 1149 bool IsImplicitClosureFunction() const; | |
|
siva
2011/10/11 21:00:46
I am wondering if it would be more readable if we
regis
2011/10/11 23:40:19
I'd like to keep IsClosureFunction() to return tru
| |
| 1150 | |
| 1147 // Returns true if this function represents a local function. | 1151 // Returns true if this function represents a local function. |
| 1148 bool IsLocalFunction() const { | 1152 bool IsLocalFunction() const { |
| 1149 return parent_function() != Function::null(); | 1153 return parent_function() != Function::null(); |
| 1150 } | 1154 } |
| 1151 | 1155 |
| 1152 // Returns true if this function represents a signature function without code. | 1156 // Returns true if this function represents a signature function without code. |
| 1153 bool IsSignatureFunction() const { | 1157 bool IsSignatureFunction() const { |
| 1154 return kind() == RawFunction::kSignatureFunction; | 1158 return kind() == RawFunction::kSignatureFunction; |
| 1155 } | 1159 } |
| 1156 | 1160 |
| (...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2789 } | 2793 } |
| 2790 | 2794 |
| 2791 | 2795 |
| 2792 void Context::SetAt(intptr_t index, const Instance& value) const { | 2796 void Context::SetAt(intptr_t index, const Instance& value) const { |
| 2793 StorePointer(InstanceAddr(index), value.raw()); | 2797 StorePointer(InstanceAddr(index), value.raw()); |
| 2794 } | 2798 } |
| 2795 | 2799 |
| 2796 } // namespace dart | 2800 } // namespace dart |
| 2797 | 2801 |
| 2798 #endif // VM_OBJECT_H_ | 2802 #endif // VM_OBJECT_H_ |
| OLD | NEW |