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

Unified Diff: runtime/vm/object.cc

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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 40fc1b7d493c1cd948df846dd8975645efac5334..4f01d1be8c06db23de2394cc637f934dc6ed9913 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -3220,6 +3220,37 @@ void Function::set_closure_allocation_stub(const Code& value) const {
}
+RawFunction* Function::method_extractor() const {
+ ASSERT(IsImplicitClosureFunction());
+ const Object& obj = Object::Handle(raw_ptr()->data_);
+ ASSERT(!obj.IsNull());
+ return ClosureData::Cast(obj).method_extractor();
+}
+
+
+void Function::set_method_extractor(const Function& value) const {
+ ASSERT(IsImplicitClosureFunction());
+ const Object& obj = Object::Handle(raw_ptr()->data_);
+ ASSERT(!obj.IsNull());
+ ClosureData::Cast(obj).set_method_extractor(value);
+}
+
+
+RawFunction* Function::extracted_method_closure() const {
+ ASSERT(kind() == RawFunction::kMethodExtractor);
+ const Object& obj = Object::Handle(raw_ptr()->data_);
+ ASSERT(obj.IsFunction());
+ return Function::Cast(obj).raw();
+}
+
+
+void Function::set_extracted_method_closure(const Function& value) const {
+ ASSERT(kind() == RawFunction::kMethodExtractor);
+ ASSERT(raw_ptr()->data_ == Object::null());
+ set_data(value);
+}
+
+
RawFunction* Function::parent_function() const {
if (IsClosureFunction()) {
const Object& obj = Object::Handle(raw_ptr()->data_);
@@ -4309,6 +4340,9 @@ const char* Function::ToCString() const {
case RawFunction::kConstImplicitGetter:
kind_str = " const-getter";
break;
+ case RawFunction::kMethodExtractor:
+ kind_str = " method-extractor";
+ break;
default:
UNREACHABLE();
}
@@ -4342,6 +4376,13 @@ void ClosureData::set_closure_allocation_stub(const Code& value) const {
}
+void ClosureData::set_method_extractor(const Function& value) const {
+ ASSERT(!value.IsNull());
+ ASSERT(raw_ptr()->method_extractor_ == Function::null());
+ StorePointer(&raw_ptr()->method_extractor_, value.raw());
+}
+
+
void ClosureData::set_parent_function(const Function& value) const {
StorePointer(&raw_ptr()->parent_function_, value.raw());
}

Powered by Google App Engine
This is Rietveld 408576698