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

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: ready for review. Created 8 years 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 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 // Signature class of this closure function or signature function. 1149 // Signature class of this closure function or signature function.
1150 RawClass* signature_class() const; 1150 RawClass* signature_class() const;
1151 void set_signature_class(const Class& value) const; 1151 void set_signature_class(const Class& value) const;
1152 1152
1153 RawInstance* implicit_static_closure() const; 1153 RawInstance* implicit_static_closure() const;
1154 void set_implicit_static_closure(const Instance& closure) const; 1154 void set_implicit_static_closure(const Instance& closure) const;
1155 1155
1156 RawCode* closure_allocation_stub() const; 1156 RawCode* closure_allocation_stub() const;
1157 void set_closure_allocation_stub(const Code& value) const; 1157 void set_closure_allocation_stub(const Code& value) const;
1158 1158
1159 RawFunction* method_extractor() const;
1160 void set_method_extractor(const Function& value) const;
1161
1162 void set_extracted_method_closure(const Function& function) const;
1163 RawFunction* extracted_method_closure() const;
1164
1165 bool IsMethodExtractor() const {
1166 return kind() == RawFunction::kMethodExtractor;
1167 }
1168
1159 // Returns true iff an implicit closure function has been created 1169 // Returns true iff an implicit closure function has been created
1160 // for this function. 1170 // for this function.
1161 bool HasImplicitClosureFunction() const { 1171 bool HasImplicitClosureFunction() const {
1162 return implicit_closure_function() != null(); 1172 return implicit_closure_function() != null();
1163 } 1173 }
1164 1174
1165 // Return the closure function implicitly created for this function. 1175 // Return the closure function implicitly created for this function.
1166 // If none exists yet, create one and remember it. 1176 // If none exists yet, create one and remember it.
1167 RawFunction* ImplicitClosureFunction() const; 1177 RawFunction* ImplicitClosureFunction() const;
1168 1178
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1565 RawInstance* implicit_static_closure() const { 1575 RawInstance* implicit_static_closure() const {
1566 return raw_ptr()->closure_; 1576 return raw_ptr()->closure_;
1567 } 1577 }
1568 void set_implicit_static_closure(const Instance& closure) const; 1578 void set_implicit_static_closure(const Instance& closure) const;
1569 1579
1570 RawCode* closure_allocation_stub() const { 1580 RawCode* closure_allocation_stub() const {
1571 return raw_ptr()->closure_allocation_stub_; 1581 return raw_ptr()->closure_allocation_stub_;
1572 } 1582 }
1573 void set_closure_allocation_stub(const Code& value) const; 1583 void set_closure_allocation_stub(const Code& value) const;
1574 1584
1585 RawFunction* method_extractor() const {
1586 return raw_ptr()->method_extractor_;
1587 }
1588 void set_method_extractor(const Function& value) const;
1589
1575 static RawClosureData* New(); 1590 static RawClosureData* New();
1576 1591
1577 HEAP_OBJECT_IMPLEMENTATION(ClosureData, Object); 1592 HEAP_OBJECT_IMPLEMENTATION(ClosureData, Object);
1578 friend class Class; 1593 friend class Class;
1579 friend class Function; 1594 friend class Function;
1580 friend class HeapProfiler; 1595 friend class HeapProfiler;
1581 }; 1596 };
1582 1597
1583 1598
1584 class RedirectionData: public Object { 1599 class RedirectionData: public Object {
(...skipping 4612 matching lines...) Expand 10 before | Expand all | Expand 10 after
6197 6212
6198 6213
6199 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6214 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6200 intptr_t index) { 6215 intptr_t index) {
6201 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6216 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6202 } 6217 }
6203 6218
6204 } // namespace dart 6219 } // namespace dart
6205 6220
6206 #endif // VM_OBJECT_H_ 6221 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698