Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Side by Side Diff: runtime/vm/object.h

Issue 11642003: Create and cache method extraction stub in the ICData. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove hand written assembly stub Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 // Signature class of this closure function or signature function. 1188 // Signature class of this closure function or signature function.
1189 RawClass* signature_class() const; 1189 RawClass* signature_class() const;
1190 void set_signature_class(const Class& value) const; 1190 void set_signature_class(const Class& value) const;
1191 1191
1192 RawInstance* implicit_static_closure() const; 1192 RawInstance* implicit_static_closure() const;
1193 void set_implicit_static_closure(const Instance& closure) const; 1193 void set_implicit_static_closure(const Instance& closure) const;
1194 1194
1195 RawCode* closure_allocation_stub() const; 1195 RawCode* closure_allocation_stub() const;
1196 void set_closure_allocation_stub(const Code& value) const; 1196 void set_closure_allocation_stub(const Code& value) const;
1197 1197
1198 RawFunction* method_extractor() const;
1199 void set_method_extractor(const Function& value) const;
1200
1201 void set_extracted_method_closure(const Function& function) const;
1202 RawFunction* extracted_method_closure() const;
1203
1204 bool IsMethodExtractor() const {
1205 return kind() == RawFunction::kMethodExtractor;
1206 }
1207
1198 // Returns true iff an implicit closure function has been created 1208 // Returns true iff an implicit closure function has been created
1199 // for this function. 1209 // for this function.
1200 bool HasImplicitClosureFunction() const { 1210 bool HasImplicitClosureFunction() const {
1201 return implicit_closure_function() != null(); 1211 return implicit_closure_function() != null();
1202 } 1212 }
1203 1213
1204 // Return the closure function implicitly created for this function. 1214 // Return the closure function implicitly created for this function.
1205 // If none exists yet, create one and remember it. 1215 // If none exists yet, create one and remember it.
1206 RawFunction* ImplicitClosureFunction() const; 1216 RawFunction* ImplicitClosureFunction() const;
1207 1217
(...skipping 22 matching lines...) Expand all
1230 bool IsDynamicFunction() const { 1240 bool IsDynamicFunction() const {
1231 if (is_static() || is_abstract()) { 1241 if (is_static() || is_abstract()) {
1232 return false; 1242 return false;
1233 } 1243 }
1234 switch (kind()) { 1244 switch (kind()) {
1235 case RawFunction::kRegularFunction: 1245 case RawFunction::kRegularFunction:
1236 case RawFunction::kGetterFunction: 1246 case RawFunction::kGetterFunction:
1237 case RawFunction::kSetterFunction: 1247 case RawFunction::kSetterFunction:
1238 case RawFunction::kImplicitGetter: 1248 case RawFunction::kImplicitGetter:
1239 case RawFunction::kImplicitSetter: 1249 case RawFunction::kImplicitSetter:
1250 case RawFunction::kMethodExtractor:
1240 return true; 1251 return true;
1241 case RawFunction::kClosureFunction: 1252 case RawFunction::kClosureFunction:
1242 case RawFunction::kConstructor: 1253 case RawFunction::kConstructor:
1243 case RawFunction::kConstImplicitGetter: 1254 case RawFunction::kConstImplicitGetter:
1244 return false; 1255 return false;
1245 default: 1256 default:
1246 UNREACHABLE(); 1257 UNREACHABLE();
1247 return false; 1258 return false;
1248 } 1259 }
1249 } 1260 }
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 RawInstance* implicit_static_closure() const { 1615 RawInstance* implicit_static_closure() const {
1605 return raw_ptr()->closure_; 1616 return raw_ptr()->closure_;
1606 } 1617 }
1607 void set_implicit_static_closure(const Instance& closure) const; 1618 void set_implicit_static_closure(const Instance& closure) const;
1608 1619
1609 RawCode* closure_allocation_stub() const { 1620 RawCode* closure_allocation_stub() const {
1610 return raw_ptr()->closure_allocation_stub_; 1621 return raw_ptr()->closure_allocation_stub_;
1611 } 1622 }
1612 void set_closure_allocation_stub(const Code& value) const; 1623 void set_closure_allocation_stub(const Code& value) const;
1613 1624
1625 RawFunction* method_extractor() const {
1626 return raw_ptr()->method_extractor_;
1627 }
1628 void set_method_extractor(const Function& value) const;
1629
1614 static RawClosureData* New(); 1630 static RawClosureData* New();
1615 1631
1616 HEAP_OBJECT_IMPLEMENTATION(ClosureData, Object); 1632 HEAP_OBJECT_IMPLEMENTATION(ClosureData, Object);
1617 friend class Class; 1633 friend class Class;
1618 friend class Function; 1634 friend class Function;
1619 friend class HeapProfiler; 1635 friend class HeapProfiler;
1620 }; 1636 };
1621 1637
1622 1638
1623 class RedirectionData: public Object { 1639 class RedirectionData: public Object {
(...skipping 4629 matching lines...) Expand 10 before | Expand all | Expand 10 after
6253 6269
6254 6270
6255 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6271 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6256 intptr_t index) { 6272 intptr_t index) {
6257 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6273 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6258 } 6274 }
6259 6275
6260 } // namespace dart 6276 } // namespace dart
6261 6277
6262 #endif // VM_OBJECT_H_ 6278 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698